summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-12-10 17:49:41 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-12-10 17:49:41 +0200
commit63eae507fbff06c1e8c65d1ec68827bf8abefcad (patch)
tree93715228ff9343e453fb742111b6dd6bb98947f8
parent30a12f48193a949f146f21618e82a689f9e28061 (diff)
SidebarWidget: Cleanup; Identities context menu
-rw-r--r--src/ui/sidebarwidget.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 78b51a54..8024b240 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -291,7 +291,7 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) {
291 format_String( 291 format_String(
292 &item->meta, 292 &item->meta,
293 "%s", 293 "%s",
294 isActive ? "Using" 294 isActive ? "Using on this page"
295 : isUsed_GmIdentity(ident) 295 : isUsed_GmIdentity(ident)
296 ? format_CStr("Used on %zu URLs", size_StringSet(ident->useUrls)) 296 ? format_CStr("Used on %zu URLs", size_StringSet(ident->useUrls))
297 : "Not used"); 297 : "Not used");
@@ -315,7 +315,7 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) {
315 } 315 }
316 const iMenuItem menuItems[] = { 316 const iMenuItem menuItems[] = {
317 { "Use on This Page", 0, 0, "ident.use arg:1" }, 317 { "Use on This Page", 0, 0, "ident.use arg:1" },
318 { "Stop Using This Page", 0, 0, "ident.use arg:0" }, 318 { "Stop Using on This Page", 0, 0, "ident.use arg:0" },
319 { "Stop Using Everywhere", 0, 0, "ident.use arg:0 clear:1" }, 319 { "Stop Using Everywhere", 0, 0, "ident.use arg:0 clear:1" },
320 { "Show Usage", 0, 0, "ident.showuse" }, 320 { "Show Usage", 0, 0, "ident.showuse" },
321 { "---", 0, 0, NULL }, 321 { "---", 0, 0, NULL },
@@ -1056,17 +1056,17 @@ static void draw_SidebarWidget_(const iSidebarWidget *d) {
1056 1056
1057static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect, 1057static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect,
1058 const iListWidget *list) { 1058 const iListWidget *list) {
1059 const iSidebarWidget *sidebar = 1059 const iSidebarWidget *sidebar = findParentClass_Widget(constAs_Widget(list),
1060 findParentClass_Widget(constAs_Widget(list), &Class_SidebarWidget); 1060 &Class_SidebarWidget);
1061 const iBool isPressing = isMouseDown_ListWidget(list); 1061 const iBool isPressing = isMouseDown_ListWidget(list);
1062 const iBool isHover = 1062 const iBool isHover = isHover_Widget(constAs_Widget(list)) &&
1063 isHover_Widget(constAs_Widget(list)) && constHoverItem_ListWidget(list) == d; 1063 constHoverItem_ListWidget(list) == d;
1064 const int scrollBarWidth = scrollBarWidth_ListWidget(list); 1064 const int scrollBarWidth = scrollBarWidth_ListWidget(list);
1065 const int itemHeight = height_Rect(itemRect); 1065 const int itemHeight = height_Rect(itemRect);
1066 const int iconColor = 1066 const int iconColor = isHover ? (isPressing ? uiTextPressed_ColorId : uiIconHover_ColorId)
1067 isHover ? (isPressing ? uiTextPressed_ColorId : uiIconHover_ColorId) : uiIcon_ColorId; 1067 : uiIcon_ColorId;
1068 const int font = uiContent_FontId; 1068 const int font = uiContent_FontId;
1069 int bg = uiBackground_ColorId; 1069 int bg = uiBackground_ColorId;
1070 if (isHover) { 1070 if (isHover) {
1071 bg = isPressing ? uiBackgroundPressed_ColorId 1071 bg = isPressing ? uiBackgroundPressed_ColorId
1072 : uiBackgroundFramelessHover_ColorId; 1072 : uiBackgroundFramelessHover_ColorId;