Rename selecthover to outputhover and add selecthover function.

This commit is contained in:
speedie 2023-07-25 00:27:39 +02:00
parent 0ec1c73053
commit 0f69bd63b1
3 changed files with 16 additions and 1 deletions

View file

@ -623,7 +623,7 @@ void switchmode(Arg *arg) {
* The only difference is "selectitem" was replaced with "mouseitem" and tx.text output
* was removed.
*/
void selecthover(Arg *arg) {
void outputhover(Arg *arg) {
char *selection;
if (printindex && mouseitem && arg->i) {
@ -650,6 +650,19 @@ void selecthover(Arg *arg) {
exit(0);
}
void selecthover(Arg *arg) {
if (selecteditem != mouseitem) {
selecteditem = mouseitem;
} else {
selecteditem = mouseitem;
outputhover(arg);
return;
}
drawmenu();
}
void markhover(Arg *arg) {
if (!mark) return;
if (mouseitem && is_selected(mouseitem->index)) {

View file

@ -77,4 +77,5 @@ static void toggleimg(Arg *arg);
/* hover */
static void selecthover(Arg *arg);
static void outputhover(Arg *arg);
static void markhover(Arg *arg);

View file

@ -395,6 +395,7 @@ static FuncList fl[] = {
{ "setprofile", setprofile },
{ "setlineheight", setlineheight },
{ "switchmode", switchmode },
{ "outputhover", outputhover },
{ "selecthover", selecthover },
{ "markhover", markhover },
{ "spawn", spawn },