summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-09-10 14:24:25 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-09-10 14:24:25 +0300
commitf8be77b76b08405e88580d482e0704a50f54805d (patch)
tree52590ddd2c013cdd4cbff07812503b3b01f167cf /src/ui
parentfbdb0a92a6107fc21ffcd4be6a413a6c34167c52 (diff)
SidebarWidget: Show menu only for items
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/sidebarwidget.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 3b02f85c..6dc1e9f2 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -527,14 +527,14 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)
527 updateItems_SidebarWidget_(d); 527 updateItems_SidebarWidget_(d);
528 } 528 }
529 else if (equal_Command(cmd, "bookmark.copy")) { 529 else if (equal_Command(cmd, "bookmark.copy")) {
530 const iSidebarItem *item = d->menuItem; //hoverItem_ListWidget(d->list); 530 const iSidebarItem *item = d->menuItem;
531 if (d->mode == bookmarks_SidebarMode && item) { 531 if (d->mode == bookmarks_SidebarMode && item) {
532 SDL_SetClipboardText(cstr_String(&item->url)); 532 SDL_SetClipboardText(cstr_String(&item->url));
533 } 533 }
534 return iTrue; 534 return iTrue;
535 } 535 }
536 else if (equal_Command(cmd, "bookmark.edit")) { 536 else if (equal_Command(cmd, "bookmark.edit")) {
537 const iSidebarItem *item = d->menuItem; //hoverItem_ListWidget(d->list); 537 const iSidebarItem *item = d->menuItem;
538 if (d->mode == bookmarks_SidebarMode && item) { 538 if (d->mode == bookmarks_SidebarMode && item) {
539 setFlags_Widget(w, disabled_WidgetFlag, iTrue); 539 setFlags_Widget(w, disabled_WidgetFlag, iTrue);
540 iWidget *dlg = makeBookmarkEditor_Widget(); 540 iWidget *dlg = makeBookmarkEditor_Widget();
@@ -660,6 +660,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)
660 &item->url, 660 &item->url,
661 collect_String(newRange_String(urlHost_String(&item->url))), 661 collect_String(newRange_String(urlHost_String(&item->url))),
662 0x1f310 /* globe */); 662 0x1f310 /* globe */);
663 postCommand_App("focus.set id:bmed.title");
663 } 664 }
664 } 665 }
665 else if (equal_Command(cmd, "history.clear")) { 666 else if (equal_Command(cmd, "history.clear")) {
@@ -678,7 +679,7 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)
678 } 679 }
679 return iTrue; 680 return iTrue;
680 } 681 }
681 } 682 }
682 if (ev->type == SDL_MOUSEMOTION && !isVisible_Widget(d->menu)) { 683 if (ev->type == SDL_MOUSEMOTION && !isVisible_Widget(d->menu)) {
683 const iInt2 mouse = init_I2(ev->motion.x, ev->motion.y); 684 const iInt2 mouse = init_I2(ev->motion.x, ev->motion.y);
684 if (contains_Widget(d->resizer, mouse)) { 685 if (contains_Widget(d->resizer, mouse)) {
@@ -733,7 +734,9 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)
733 } 734 }
734 } 735 }
735 } 736 }
736 processContextMenuEvent_Widget(d->menu, ev, {}); 737 if (hoverItem_ListWidget(d->list) || isVisible_Widget(d->menu)) {
738 processContextMenuEvent_Widget(d->menu, ev, {});
739 }
737 return processEvent_Widget(w, ev); 740 return processEvent_Widget(w, ev);
738} 741}
739 742