diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-26 17:43:49 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-26 17:43:49 +0200 |
commit | 7787cdd1c32ab1f48f5aee50024409702864a2e7 (patch) | |
tree | 0aa04bb3f1ef59e4a341fa8c357980e5d7ae6c89 /src/ui | |
parent | 57bd24d57826e0fe6ca49b9e378bd2ddb90278c2 (diff) |
Feeds: Manual refresh
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/sidebarwidget.c | 3 | ||||
-rw-r--r-- | src/ui/window.c | 34 |
2 files changed, 27 insertions, 10 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c index 3fdfe190..3bd0f229 100644 --- a/src/ui/sidebarwidget.c +++ b/src/ui/sidebarwidget.c | |||
@@ -690,6 +690,9 @@ static iBool processEvent_SidebarWidget_(iSidebarWidget *d, const SDL_Event *ev) | |||
690 | (d->mode == history_SidebarMode || d->mode == feeds_SidebarMode)) { | 690 | (d->mode == history_SidebarMode || d->mode == feeds_SidebarMode)) { |
691 | updateItems_SidebarWidget_(d); | 691 | updateItems_SidebarWidget_(d); |
692 | } | 692 | } |
693 | else if (equal_Command(cmd, "feeds.update.finished") && d->mode == feeds_SidebarMode) { | ||
694 | updateItems_SidebarWidget_(d); | ||
695 | } | ||
693 | else if (equal_Command(cmd, "bookmarks.changed") && d->mode == bookmarks_SidebarMode) { | 696 | else if (equal_Command(cmd, "bookmarks.changed") && d->mode == bookmarks_SidebarMode) { |
694 | updateItems_SidebarWidget_(d); | 697 | updateItems_SidebarWidget_(d); |
695 | } | 698 | } |
diff --git a/src/ui/window.c b/src/ui/window.c index 6e046bdc..b4b8fff6 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -159,8 +159,9 @@ static const iMenuItem viewMenuItems_[] = { | |||
159 | static iMenuItem bookmarksMenuItems_[] = { | 159 | static iMenuItem bookmarksMenuItems_[] = { |
160 | { "Bookmark This Page...", SDLK_d, KMOD_PRIMARY, "bookmark.add" }, | 160 | { "Bookmark This Page...", SDLK_d, KMOD_PRIMARY, "bookmark.add" }, |
161 | { "---", 0, 0, NULL }, | 161 | { "---", 0, 0, NULL }, |
162 | { "Subscribe as Feed", 0, 0, "bookmark.addtag tag:subscribed" }, | 162 | { "Subscribe to This Page", 0, 0, "bookmark.addtag tag:subscribed" }, |
163 | { "---", 0, 0, NULL }, | 163 | { "---", 0, 0, NULL }, |
164 | { "Show Feed Entries", 0, 0, "open url:about:feeds" }, | ||
164 | { "Refresh Feeds", SDLK_r, KMOD_PRIMARY | KMOD_SHIFT, "feeds.refresh" }, | 165 | { "Refresh Feeds", SDLK_r, KMOD_PRIMARY | KMOD_SHIFT, "feeds.refresh" }, |
165 | }; | 166 | }; |
166 | 167 | ||
@@ -401,16 +402,29 @@ static void setupUserInterface_Window(iWindow *d) { | |||
401 | setNotifyEdits_InputWidget(url, iTrue); | 402 | setNotifyEdits_InputWidget(url, iTrue); |
402 | setTextCStr_InputWidget(url, "gemini://"); | 403 | setTextCStr_InputWidget(url, "gemini://"); |
403 | addChildFlags_Widget(navBar, iClob(url), expand_WidgetFlag); | 404 | addChildFlags_Widget(navBar, iClob(url), expand_WidgetFlag); |
404 | /* Download progress indicator is inside the input field, but hidden normally. */ | ||
405 | setPadding_Widget(as_Widget(url),0, 0, gap_UI * 1, 0); | 405 | setPadding_Widget(as_Widget(url),0, 0, gap_UI * 1, 0); |
406 | iLabelWidget *progress = new_LabelWidget(uiTextCaution_ColorEscape "00.000 MB", NULL); | 406 | /* Feeds refresh indicator is inside the input field. */ { |
407 | setId_Widget(as_Widget(progress), "document.progress"); | 407 | iLabelWidget *fprog = new_LabelWidget(uiTextCaution_ColorEscape |
408 | setAlignVisually_LabelWidget(progress, iTrue); | 408 | "\u2605 Refreshing Feeds...", NULL); |
409 | shrink_Rect(&as_Widget(progress)->rect, init_I2(0, gap_UI)); | 409 | setId_Widget(as_Widget(fprog), "feeds.progress"); |
410 | addChildFlags_Widget(as_Widget(url), | 410 | setBackgroundColor_Widget(as_Widget(fprog), uiBackground_ColorId); |
411 | iClob(progress), | 411 | setAlignVisually_LabelWidget(fprog, iTrue); |
412 | moveToParentRightEdge_WidgetFlag); | 412 | shrink_Rect(&as_Widget(fprog)->rect, init_I2(0, gap_UI)); |
413 | setBackgroundColor_Widget(as_Widget(progress), uiBackground_ColorId); | 413 | addChildFlags_Widget(as_Widget(url), |
414 | iClob(fprog), | ||
415 | moveToParentRightEdge_WidgetFlag | hidden_WidgetFlag); | ||
416 | } | ||
417 | /* Download progress indicator is also inside the input field, but hidden normally. | ||
418 | TODO: It shouldn't overlap the feeds indicator... */ { | ||
419 | iLabelWidget *progress = new_LabelWidget(uiTextCaution_ColorEscape "00.000 MB", NULL); | ||
420 | setId_Widget(as_Widget(progress), "document.progress"); | ||
421 | setBackgroundColor_Widget(as_Widget(progress), uiBackground_ColorId); | ||
422 | setAlignVisually_LabelWidget(progress, iTrue); | ||
423 | shrink_Rect(&as_Widget(progress)->rect, init_I2(0, gap_UI)); | ||
424 | addChildFlags_Widget(as_Widget(url), | ||
425 | iClob(progress), | ||
426 | moveToParentRightEdge_WidgetFlag); | ||
427 | } | ||
414 | } | 428 | } |
415 | setId_Widget(addChild_Widget( | 429 | setId_Widget(addChild_Widget( |
416 | navBar, iClob(newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"))), | 430 | navBar, iClob(newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"))), |