diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-05 15:03:38 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-03-05 15:03:38 +0200 |
commit | a3457b5d756f434e887288341559a9e5fa6f9f69 (patch) | |
tree | 5e627e6eba584b0be4c47256695f8c39efc6915a /src/ui/sidebarwidget.c | |
parent | 71f3f34782aa6050ede4bf143fa6028653adae6d (diff) |
Defined a set of UI icons; use in menus
Diffstat (limited to 'src/ui/sidebarwidget.c')
-rw-r--r-- | src/ui/sidebarwidget.c | 68 |
1 files changed, 36 insertions, 32 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 1f5a6d01..abeeb2b9 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -23,6 +23,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | |||
23 | #include "sidebarwidget.h" | 23 | #include "sidebarwidget.h" |
24 | 24 | ||
25 | #include "app.h" | 25 | #include "app.h" |
26 | #include "defs.h" | ||
26 | #include "bookmarks.h" | 27 | #include "bookmarks.h" |
27 | #include "command.h" | 28 | #include "command.h" |
28 | #include "documentwidget.h" | 29 | #include "documentwidget.h" |
@@ -196,16 +197,16 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
196 | } | 197 | } |
197 | d->menu = makeMenu_Widget( | 198 | d->menu = makeMenu_Widget( |
198 | as_Widget(d), | 199 | as_Widget(d), |
199 | (iMenuItem[]){ { "Open Entry in New Tab", 0, 0, "feed.entry.opentab" }, | 200 | (iMenuItem[]){ { open_Icon " Open Entry in New Tab", 0, 0, "feed.entry.opentab" }, |
200 | { "Mark as Read", 0, 0, "feed.entry.toggleread" }, | 201 | { "Mark as Read", 0, 0, "feed.entry.toggleread" }, |
201 | { "Add Bookmark...", 0, 0, "feed.entry.bookmark" }, | 202 | { pin_Icon " Add Bookmark...", 0, 0, "feed.entry.bookmark" }, |
202 | { "---", 0, 0, NULL }, | 203 | { "---", 0, 0, NULL }, |
203 | { "Open Feed Page", 0, 0, "feed.entry.openfeed" }, | 204 | { "Open Feed Page", 0, 0, "feed.entry.openfeed" }, |
204 | { "Edit Feed...", 0, 0, "feed.entry.edit" }, | 205 | { edit_Icon " Edit Feed...", 0, 0, "feed.entry.edit" }, |
205 | { uiTextCaution_ColorEscape "Unsubscribe...", 0, 0, "feed.entry.unsubscribe" }, | 206 | { star_Icon " " uiTextCaution_ColorEscape "Unsubscribe...", 0, 0, "feed.entry.unsubscribe" }, |
206 | { "---", 0, 0, NULL }, | 207 | { "---", 0, 0, NULL }, |
207 | { "Mark All as Read", SDLK_a, KMOD_SHIFT, "feeds.markallread" }, | 208 | { check_Icon " Mark All as Read", SDLK_a, KMOD_SHIFT, "feeds.markallread" }, |
208 | { "Refresh Feeds", SDLK_r, KMOD_PRIMARY | KMOD_SHIFT, "feeds.refresh" } }, | 209 | { reload_Icon " Refresh Feeds", SDLK_r, KMOD_PRIMARY | KMOD_SHIFT, "feeds.refresh" } }, |
209 | 10); | 210 | 10); |
210 | break; | 211 | break; |
211 | } | 212 | } |
@@ -255,20 +256,20 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
255 | } | 256 | } |
256 | d->menu = makeMenu_Widget( | 257 | d->menu = makeMenu_Widget( |
257 | as_Widget(d), | 258 | as_Widget(d), |
258 | (iMenuItem[]){ { "Open in New Tab", 0, 0, "bookmark.open newtab:1" }, | 259 | (iMenuItem[]){ { open_Icon " Open in New Tab", 0, 0, "bookmark.open newtab:1" }, |
259 | { "Open in Background Tab", 0, 0, "bookmark.open newtab:2" }, | 260 | { "Open in Background Tab", 0, 0, "bookmark.open newtab:2" }, |
260 | { "---", 0, 0, NULL }, | 261 | { "---", 0, 0, NULL }, |
261 | { "Edit...", 0, 0, "bookmark.edit" }, | 262 | { edit_Icon " Edit...", 0, 0, "bookmark.edit" }, |
262 | { "Duplicate...", 0, 0, "bookmark.dup" }, | 263 | { copy_Icon " Duplicate...", 0, 0, "bookmark.dup" }, |
263 | { "Copy URL", 0, 0, "bookmark.copy" }, | 264 | { "Copy URL", 0, 0, "bookmark.copy" }, |
264 | { "---", 0, 0, NULL }, | 265 | { "---", 0, 0, NULL }, |
265 | { "?", 0, 0, "bookmark.tag tag:subscribed" }, | 266 | { "?", 0, 0, "bookmark.tag tag:subscribed" }, |
266 | { "?", 0, 0, "bookmark.tag tag:homepage" }, | 267 | { "?", 0, 0, "bookmark.tag tag:homepage" }, |
267 | { "?", 0, 0, "bookmark.tag tag:remotesource" }, | 268 | { "?", 0, 0, "bookmark.tag tag:remotesource" }, |
268 | { "---", 0, 0, NULL }, | 269 | { "---", 0, 0, NULL }, |
269 | { uiTextCaution_ColorEscape "Delete Bookmark", 0, 0, "bookmark.delete" }, | 270 | { delete_Icon " " uiTextCaution_ColorEscape "Delete Bookmark", 0, 0, "bookmark.delete" }, |
270 | { "---", 0, 0, NULL }, | 271 | { "---", 0, 0, NULL }, |
271 | { "Refresh Remote Sources", 0, 0, "bookmarks.reload.remote" } }, | 272 | { reload_Icon " Refresh Remote Sources", 0, 0, "bookmarks.reload.remote" } }, |
272 | 14); | 273 | 14); |
273 | break; | 274 | break; |
274 | } | 275 | } |
@@ -316,11 +317,11 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
316 | as_Widget(d), | 317 | as_Widget(d), |
317 | (iMenuItem[]){ | 318 | (iMenuItem[]){ |
318 | { "Copy URL", 0, 0, "history.copy" }, | 319 | { "Copy URL", 0, 0, "history.copy" }, |
319 | { "Add Bookmark...", 0, 0, "history.addbookmark" }, | 320 | { pin_Icon " Add Bookmark...", 0, 0, "history.addbookmark" }, |
320 | { "---", 0, 0, NULL }, | 321 | { "---", 0, 0, NULL }, |
321 | { "Forget URL", 0, 0, "history.delete" }, | 322 | { "Forget URL", 0, 0, "history.delete" }, |
322 | { "---", 0, 0, NULL }, | 323 | { "---", 0, 0, NULL }, |
323 | { uiTextCaution_ColorEscape "Clear History...", 0, 0, "history.clear confirm:1" }, | 324 | { delete_Icon " " uiTextCaution_ColorEscape "Clear History...", 0, 0, "history.clear confirm:1" }, |
324 | }, 6); | 325 | }, 6); |
325 | break; | 326 | break; |
326 | } | 327 | } |
@@ -361,17 +362,17 @@ static void updateItems_SidebarWidget_(iSidebarWidget *d) { | |||
361 | iRelease(item); | 362 | iRelease(item); |
362 | } | 363 | } |
363 | const iMenuItem menuItems[] = { | 364 | const iMenuItem menuItems[] = { |
364 | { "Use on This Page", 0, 0, "ident.use arg:1" }, | 365 | { person_Icon " Use on This Page", 0, 0, "ident.use arg:1" }, |
365 | { "Stop Using on This Page", 0, 0, "ident.use arg:0" }, | 366 | { close_Icon " Stop Using on This Page", 0, 0, "ident.use arg:0" }, |
366 | { "Stop Using Everywhere", 0, 0, "ident.use arg:0 clear:1" }, | 367 | { close_Icon " Stop Using Everywhere", 0, 0, "ident.use arg:0 clear:1" }, |
367 | { "Show Usage", 0, 0, "ident.showuse" }, | 368 | { "Show Usage", 0, 0, "ident.showuse" }, |
368 | { "---", 0, 0, NULL }, | 369 | { "---", 0, 0, NULL }, |
369 | { "Edit Notes...", 0, 0, "ident.edit" }, | 370 | { edit_Icon " Edit Notes...", 0, 0, "ident.edit" }, |
370 | { "Copy Fingerprint", 0, 0, "ident.fingerprint" }, | 371 | { "Copy Fingerprint", 0, 0, "ident.fingerprint" }, |
371 | // { "Pick Icon...", 0, 0, "ident.pickicon" }, | 372 | // { "Pick Icon...", 0, 0, "ident.pickicon" }, |
372 | { "---", 0, 0, NULL }, | 373 | { "---", 0, 0, NULL }, |
373 | //{ "Reveal Files", 0, 0, "ident.reveal" }, | 374 | //{ "Reveal Files", 0, 0, "ident.reveal" }, |
374 | { uiTextCaution_ColorEscape "Delete Identity...", 0, 0, "ident.delete confirm:1" }, | 375 | { delete_Icon " " uiTextCaution_ColorEscape "Delete Identity...", 0, 0, "ident.delete confirm:1" }, |
375 | }; | 376 | }; |
376 | d->menu = makeMenu_Widget(as_Widget(d), menuItems, iElemCount(menuItems)); | 377 | d->menu = makeMenu_Widget(as_Widget(d), menuItems, iElemCount(menuItems)); |
377 | break; | 378 | break; |
@@ -449,18 +450,18 @@ int width_SidebarWidget(const iSidebarWidget *d) { | |||
449 | } | 450 | } |
450 | 451 | ||
451 | static const char *normalModeLabels_[max_SidebarMode] = { | 452 | static const char *normalModeLabels_[max_SidebarMode] = { |
452 | "\U0001f588 Bookmarks", | 453 | pin_Icon " Bookmarks", |
453 | "\U00002605 Feeds", | 454 | star_Icon " Feeds", |
454 | "\U0001f553 History", | 455 | clock_Icon " History", |
455 | "\U0001f464 Identities", | 456 | person_Icon " Identities", |
456 | "\U0001f5b9 Outline", | 457 | "\U0001f5b9 Outline", |
457 | }; | 458 | }; |
458 | 459 | ||
459 | static const char *tightModeLabels_[max_SidebarMode] = { | 460 | static const char *tightModeLabels_[max_SidebarMode] = { |
460 | "\U0001f588", | 461 | pin_Icon, |
461 | "\U00002605", | 462 | star_Icon, |
462 | "\U0001f553", | 463 | clock_Icon, |
463 | "\U0001f464", | 464 | person_Icon, |
464 | "\U0001f5b9", | 465 | "\U0001f5b9", |
465 | }; | 466 | }; |
466 | 467 | ||
@@ -1162,22 +1163,25 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
1162 | if (menuItem) { | 1163 | if (menuItem) { |
1163 | setTextCStr_LabelWidget(menuItem, | 1164 | setTextCStr_LabelWidget(menuItem, |
1164 | hasTag_Bookmark(bm, "homepage") | 1165 | hasTag_Bookmark(bm, "homepage") |
1165 | ? "Remove Homepage" | 1166 | ? home_Icon " Remove Homepage" |
1166 | : "Use as Homepage"); | 1167 | : home_Icon " Use as Homepage"); |
1168 | checkIcon_LabelWidget(menuItem); | ||
1167 | } | 1169 | } |
1168 | menuItem = findMenuItem_Widget(d->menu, "bookmark.tag tag:subscribed"); | 1170 | menuItem = findMenuItem_Widget(d->menu, "bookmark.tag tag:subscribed"); |
1169 | if (menuItem) { | 1171 | if (menuItem) { |
1170 | setTextCStr_LabelWidget(menuItem, | 1172 | setTextCStr_LabelWidget(menuItem, |
1171 | hasTag_Bookmark(bm, "subscribed") | 1173 | hasTag_Bookmark(bm, "subscribed") |
1172 | ? "Unsubscribe from Feed" | 1174 | ? star_Icon " Unsubscribe from Feed" |
1173 | : "Subscribe to Feed"); | 1175 | : star_Icon " Subscribe to Feed"); |
1176 | checkIcon_LabelWidget(menuItem); | ||
1174 | } | 1177 | } |
1175 | menuItem = findMenuItem_Widget(d->menu, "bookmark.tag tag:remotesource"); | 1178 | menuItem = findMenuItem_Widget(d->menu, "bookmark.tag tag:remotesource"); |
1176 | if (menuItem) { | 1179 | if (menuItem) { |
1177 | setTextCStr_LabelWidget(menuItem, | 1180 | setTextCStr_LabelWidget(menuItem, |
1178 | hasTag_Bookmark(bm, "remotesource") | 1181 | hasTag_Bookmark(bm, "remotesource") |
1179 | ? "Remove Bookmark Source" | 1182 | ? downArrowBar_Icon " Remove Bookmark Source" |
1180 | : "Use as Bookmark Source"); | 1183 | : downArrowBar_Icon " Use as Bookmark Source"); |
1184 | checkIcon_LabelWidget(menuItem); | ||
1181 | } | 1185 | } |
1182 | } | 1186 | } |
1183 | } | 1187 | } |