diff options
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 9946ac5a..a3ff8a3e 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -83,18 +83,18 @@ iDefineObjectConstruction(SidebarItem) | |||
83 | /*----------------------------------------------------------------------------------------------*/ | 83 | /*----------------------------------------------------------------------------------------------*/ |
84 | 84 | ||
85 | struct Impl_SidebarWidget { | 85 | struct Impl_SidebarWidget { |
86 | iWidget widget; | 86 | iWidget widget; |
87 | enum iSidebarMode mode; | 87 | enum iSidebarMode mode; |
88 | iWidget *blank; | 88 | iWidget * blank; |
89 | iListWidget *list; | 89 | iListWidget * list; |
90 | int modeScroll[max_SidebarMode]; | 90 | int modeScroll[max_SidebarMode]; |
91 | int width; | 91 | iLabelWidget * modeButtons[max_SidebarMode]; |
92 | iLabelWidget *modeButtons[max_SidebarMode]; | 92 | int maxButtonLabelWidth; |
93 | int maxButtonLabelWidth; | 93 | int width; |
94 | iWidget *resizer; | 94 | iWidget * resizer; |
95 | SDL_Cursor *resizeCursor; | 95 | SDL_Cursor * resizeCursor; |
96 | iWidget *menu; | 96 | iWidget * menu; |
97 | iSidebarItem *menuItem; /* list item accessed in the context menu */ | 97 | iSidebarItem * menuItem; /* list item accessed in the context menu */ |
98 | }; | 98 | }; |
99 | 99 | ||
100 | iDefineObjectConstruction(SidebarWidget) | 100 | iDefineObjectConstruction(SidebarWidget) |
@@ -149,10 +149,6 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
149 | const iBookmark *bm = get_Bookmarks(bookmarks_App(), entry->bookmarkId); | 149 | const iBookmark *bm = get_Bookmarks(bookmarks_App(), entry->bookmarkId); |
150 | if (bm) { | 150 | if (bm) { |
151 | item->icon = bm->icon; | 151 | item->icon = bm->icon; |
152 | // appendCStr_String(&item->meta, uiTextCaution_ColorEscape); | ||
153 | // appendChar_String(&item->meta, bm->icon); | ||
154 | // appendChar_String(&item->meta, ' '); | ||
155 | // appendCStr_String(&item->meta, uiText_ColorEscape); | ||
156 | append_String(&item->meta, &bm->title); | 152 | append_String(&item->meta, &bm->title); |
157 | } | 153 | } |
158 | addItem_ListWidget(d->list, item); | 154 | addItem_ListWidget(d->list, item); |
@@ -167,8 +163,10 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
167 | { "Add Bookmark...", 0, 0, "feed.entry.bookmark" }, | 163 | { "Add Bookmark...", 0, 0, "feed.entry.bookmark" }, |
168 | { "Edit Feed...", 0, 0, "feed.entry.edit" }, | 164 | { "Edit Feed...", 0, 0, "feed.entry.edit" }, |
169 | { "---", 0, 0, NULL }, | 165 | { "---", 0, 0, NULL }, |
170 | { uiTextCaution_ColorEscape "Unsubscribe", 0, 0, "feed.entry.unsubscribe" } }, | 166 | { uiTextCaution_ColorEscape "Unsubscribe...", 0, 0, "feed.entry.unsubscribe" }, |
171 | 8); | 167 | { "---", 0, 0, NULL }, |
168 | { "Refresh Feeds", SDLK_r, KMOD_PRIMARY | KMOD_SHIFT, "feeds.refresh" } }, | ||
169 | 10); | ||
172 | break; | 170 | break; |
173 | } | 171 | } |
174 | case documentOutline_SidebarMode: { | 172 | case documentOutline_SidebarMode: { |
@@ -942,6 +940,7 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect, | |||
942 | } | 940 | } |
943 | iInt2 pos = itemRect.pos; | 941 | iInt2 pos = itemRect.pos; |
944 | /* Selection indicator. */ | 942 | /* Selection indicator. */ |
943 | /* TODO: Make a better-looking one. */ | ||
945 | if (d->listItem.isSelected && (sidebar->mode == feeds_SidebarMode || | 944 | if (d->listItem.isSelected && (sidebar->mode == feeds_SidebarMode || |
946 | sidebar->mode == identities_SidebarMode)) { | 945 | sidebar->mode == identities_SidebarMode)) { |
947 | drawRectThickness_Paint(p, | 946 | drawRectThickness_Paint(p, |
@@ -962,7 +961,7 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect, | |||
962 | const int fg = isHover ? (isPressing ? uiTextPressed_ColorId : uiTextFramelessHover_ColorId) | 961 | const int fg = isHover ? (isPressing ? uiTextPressed_ColorId : uiTextFramelessHover_ColorId) |
963 | : uiText_ColorId; | 962 | : uiText_ColorId; |
964 | if (d->listItem.isSeparator) { | 963 | if (d->listItem.isSeparator) { |
965 | if (itemRect.pos.y > 0) { | 964 | if (d != constItem_ListWidget(list, 0)) { |
966 | drawHLine_Paint(p, | 965 | drawHLine_Paint(p, |
967 | addY_I2(pos, 2 * gap_UI), | 966 | addY_I2(pos, 2 * gap_UI), |
968 | width_Rect(itemRect) - scrollBarWidth, | 967 | width_Rect(itemRect) - scrollBarWidth, |
@@ -995,7 +994,9 @@ static void draw_SidebarItem_(const iSidebarItem *d, iPaint *p, iRect itemRect, | |||
995 | drawCentered_Text(uiContent_FontId, | 994 | drawCentered_Text(uiContent_FontId, |
996 | adjusted_Rect(iconArea, init_I2(gap_UI, 0), zero_I2()), | 995 | adjusted_Rect(iconArea, init_I2(gap_UI, 0), zero_I2()), |
997 | iTrue, | 996 | iTrue, |
998 | isHover && isPressing ? iconColor : uiTextCaution_ColorId, | 997 | isHover && isPressing |
998 | ? iconColor | ||
999 | : (isUnread ? uiTextCaution_ColorId : iconColor), | ||
999 | "%s", | 1000 | "%s", |
1000 | cstr_String(&str)); | 1001 | cstr_String(&str)); |
1001 | deinit_String(&str); | 1002 | deinit_String(&str); |