=> 39ac9ed88e4a5b7bbd08b07ab700586c80752e11
[1mdiff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c[m [1mindex eae0432f..3d785e0a 100644[m [1m--- a/src/ui/sidebarwidget.c[m [1m+++ b/src/ui/sidebarwidget.c[m [36m@@ -106,7 +106,8 @@[m [mstruct Impl_SidebarWidget {[m size_t numUnreadEntries;[m iWidget * resizer;[m iWidget * menu;[m [31m- iSidebarItem * contextItem; /* list item accessed in the context menu */[m [32m+[m[32m iSidebarItem * contextItem; /* list item accessed in the context menu */[m [32m+[m[32m size_t contextIndex; /* index of list item accessed in the context menu */[m };[m [m iDefineObjectConstructionArgs(SidebarWidget, (enum iSidebarSide side), side)[m [36m@@ -644,6 +645,7 @@[m [mvoid init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) {[m "actions");[m setBackgroundColor_Widget(d->actions, uiBackgroundSidebar_ColorId);[m d->contextItem = NULL;[m [32m+[m[32m d->contextIndex = iInvalidPos;[m d->blank = new_Widget();[m addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag);[m addChildFlags_Widget(vdiv, iClob(content), expand_WidgetFlag);[m [36m@@ -844,7 +846,6 @@[m [miBool handleBookmarkEditorCommands_SidebarWidget_(iWidget *editor, const char *c[m isSelected_Widget(findChild_Widget(editor, "bmed.tag.linksplit")));[m postCommand_App("bookmarks.changed");[m }[m [31m- setFlags_Widget(as_Widget(d), disabled_WidgetFlag, iFalse);[m destroy_Widget(editor);[m return iTrue;[m }[m [36m@@ -985,11 +986,8 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m itemClicked_SidebarWidget_(d, pointerLabel_Command(cmd, "item"));[m return iTrue;[m }[m [31m- else if (isCommand_Widget(w, ev, "menu.opened")) {[m [31m- setFlags_Widget(as_Widget(d->list), disabled_WidgetFlag, iTrue);[m [31m- }[m else if (isCommand_Widget(w, ev, "menu.closed")) {[m [31m- setFlags_Widget(as_Widget(d->list), disabled_WidgetFlag, iFalse);[m [32m+[m[32m // invalidateItem_ListWidget(d->list, d->contextIndex);[m }[m else if (isCommand_Widget(w, ev, "bookmark.open")) {[m const iSidebarItem *item = d->contextItem;[m [36m@@ -1010,7 +1008,6 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m else if (isCommand_Widget(w, ev, "bookmark.edit")) {[m const iSidebarItem *item = d->contextItem;[m if (d->mode == bookmarks_SidebarMode && item) {[m [31m- setFlags_Widget(w, disabled_WidgetFlag, iTrue);[m iWidget *dlg = makeBookmarkEditor_Widget();[m setId_Widget(dlg, format_CStr("bmed.%s", cstr_String(id_Widget(w))));[m iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id);[m [36m@@ -1038,7 +1035,6 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m else if (isCommand_Widget(w, ev, "bookmark.dup")) {[m const iSidebarItem *item = d->contextItem;[m if (d->mode == bookmarks_SidebarMode && item) {[m [31m- setFlags_Widget(w, disabled_WidgetFlag, iTrue);[m iBookmark *bm = get_Bookmarks(bookmarks_App(), item->id);[m const iBool isRemote = hasTag_Bookmark(bm, remote_BookmarkTag);[m iChar icon = isRemote ? 0x1f588 : bm->icon;[m [36m@@ -1131,7 +1127,6 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m return iTrue;[m }[m if (isCommand_Widget(w, ev, "feed.entry.edit")) {[m [31m- setFlags_Widget(w, disabled_WidgetFlag, iTrue);[m makeFeedSettings_Widget(id_Bookmark(feedBookmark));[m return iTrue;[m }[m [36m@@ -1307,6 +1302,10 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m setCursor_Window(get_Window(), SDL_SYSTEM_CURSOR_ARROW);[m }[m }[m [32m+[m[32m if (d->contextIndex != iInvalidPos) {[m [32m+[m[32m invalidateItem_ListWidget(d->list, d->contextIndex);[m [32m+[m[32m d->contextIndex = iInvalidPos;[m [32m+[m[32m }[m }[m if (d->menu && ev->type == SDL_MOUSEBUTTONDOWN) {[m if (ev->button.button == SDL_BUTTON_RIGHT) {[m [36m@@ -1315,7 +1314,12 @@[m [mstatic iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev)[m updateMouseHover_ListWidget(d->list);[m }[m if (constHoverItem_ListWidget(d->list) || isVisible_Widget(d->menu)) {[m [31m- d->contextItem = hoverItem_ListWidget(d->list);[m [32m+[m[32m d->contextItem = hoverItem_ListWidget(d->list);[m [32m+[m[32m /* Context is drawn in hover state. */[m [32m+[m[32m if (d->contextIndex != iInvalidPos) {[m [32m+[m[32m invalidateItem_ListWidget(d->list, d->contextIndex);[m [32m+[m[32m }[m [32m+[m[32m d->contextIndex = hoverItemIndex_ListWidget(d->list);[m /* Update menu items. */[m /* TODO: Some callback-based mechanism would be nice for updating menus right[m before they open? */[m [36m@@ -1436,9 +1440,13 @@[m [mstatic void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect,[m const iListWidget *list) {[m const iSidebarWidget *sidebar = findParentClass_Widget(constAs_Widget(list),[m &Class_SidebarWidget);[m [32m+[m[32m const iBool isMenuVisible = isVisible_Widget(sidebar->menu);[m const iBool isPressing = isMouseDown_ListWidget(list);[m [31m- const iBool isHover = isHover_Widget(constAs_Widget(list)) &&[m [31m- constHoverItem_ListWidget(list) == d;[m [32m+[m[32m const iBool isHover =[m [32m+[m[32m (!isMenuVisible &&[m [32m+[m[32m isHover_Widget(constAs_Widget(list)) &&[m [32m+[m[32m constHoverItem_ListWidget(list) == d) ||[m [32m+[m[32m (isMenuVisible && sidebar->contextItem == d);[m const int scrollBarWidth = scrollBarWidth_ListWidget(list);[m #if defined (iPlatformApple)[m const int blankWidth = 0;[m [1mdiff --git a/src/ui/util.c b/src/ui/util.c[m [1mindex 92cf85b7..ac1540bb 100644[m [1m--- a/src/ui/util.c[m [1m+++ b/src/ui/util.c[m [36m@@ -2493,11 +2493,6 @@[m [miWidget *makeBookmarkEditor_Widget(void) {[m return dlg;[m }[m [m [31m-static void enableSidebars_(void) {[m [31m- setFlags_Widget(findWidget_App("sidebar"), disabled_WidgetFlag, iFalse);[m [31m- setFlags_Widget(findWidget_App("sidebar2"), disabled_WidgetFlag, iFalse);[m [31m-}[m [31m-[m static iBool handleBookmarkCreationCommands_SidebarWidget_(iWidget *editor, const char *cmd) {[m if (equal_Command(cmd, "bmed.accept") || equal_Command(cmd, "cancel")) {[m if (equal_Command(cmd, "bmed.accept")) {[m [36m@@ -2522,8 +2517,6 @@[m [mstatic iBool handleBookmarkCreationCommands_SidebarWidget_(iWidget *editor, cons[m postCommand_App("bookmarks.changed");[m }[m destroy_Widget(editor);[m [31m- /* Sidebars are disabled when a dialog is opened. */[m [31m- enableSidebars_();[m return iTrue;[m }[m return iFalse;[m [36m@@ -2553,8 +2546,6 @@[m [miWidget *makeBookmarkCreation_Widget(const iString *url, const iString *title, i[m static iBool handleFeedSettingCommands_(iWidget *dlg, const char *cmd) {[m if (equal_Command(cmd, "cancel")) {[m destroy_Widget(dlg);[m [31m- /* Sidebars are disabled when a dialog is opened. */[m [31m- enableSidebars_();[m return iTrue;[m }[m if (equal_Command(cmd, "feedcfg.accept")) {[m [36m@@ -2589,8 +2580,6 @@[m [mstatic iBool handleFeedSettingCommands_(iWidget *dlg, const char *cmd) {[m }[m postCommand_App("bookmarks.changed");[m destroy_Widget(dlg);[m [31m- /* Sidebars are disabled when a dialog is opened. */[m [31m- enableSidebars_();[m return iTrue;[m }[m return iFalse;[m
text/gemini; charset=utf-8
This content has been proxied by September (3851b).