forked from speedie/spmenu
Rename selecthover to outputhover and add selecthover function.
This commit is contained in:
parent
0ec1c73053
commit
0f69bd63b1
15
libs/arg.c
15
libs/arg.c
|
@ -623,7 +623,7 @@ void switchmode(Arg *arg) {
|
||||||
* The only difference is "selectitem" was replaced with "mouseitem" and tx.text output
|
* The only difference is "selectitem" was replaced with "mouseitem" and tx.text output
|
||||||
* was removed.
|
* was removed.
|
||||||
*/
|
*/
|
||||||
void selecthover(Arg *arg) {
|
void outputhover(Arg *arg) {
|
||||||
char *selection;
|
char *selection;
|
||||||
|
|
||||||
if (printindex && mouseitem && arg->i) {
|
if (printindex && mouseitem && arg->i) {
|
||||||
|
@ -650,6 +650,19 @@ void selecthover(Arg *arg) {
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void selecthover(Arg *arg) {
|
||||||
|
if (selecteditem != mouseitem) {
|
||||||
|
selecteditem = mouseitem;
|
||||||
|
} else {
|
||||||
|
selecteditem = mouseitem;
|
||||||
|
outputhover(arg);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
drawmenu();
|
||||||
|
}
|
||||||
|
|
||||||
void markhover(Arg *arg) {
|
void markhover(Arg *arg) {
|
||||||
if (!mark) return;
|
if (!mark) return;
|
||||||
if (mouseitem && is_selected(mouseitem->index)) {
|
if (mouseitem && is_selected(mouseitem->index)) {
|
||||||
|
|
|
@ -77,4 +77,5 @@ static void toggleimg(Arg *arg);
|
||||||
|
|
||||||
/* hover */
|
/* hover */
|
||||||
static void selecthover(Arg *arg);
|
static void selecthover(Arg *arg);
|
||||||
|
static void outputhover(Arg *arg);
|
||||||
static void markhover(Arg *arg);
|
static void markhover(Arg *arg);
|
||||||
|
|
|
@ -395,6 +395,7 @@ static FuncList fl[] = {
|
||||||
{ "setprofile", setprofile },
|
{ "setprofile", setprofile },
|
||||||
{ "setlineheight", setlineheight },
|
{ "setlineheight", setlineheight },
|
||||||
{ "switchmode", switchmode },
|
{ "switchmode", switchmode },
|
||||||
|
{ "outputhover", outputhover },
|
||||||
{ "selecthover", selecthover },
|
{ "selecthover", selecthover },
|
||||||
{ "markhover", markhover },
|
{ "markhover", markhover },
|
||||||
{ "spawn", spawn },
|
{ "spawn", spawn },
|
||||||
|
|
Loading…
Reference in a new issue