diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-08 07:09:44 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-08 07:09:44 +0200 |
commit | c1d3cf1f0acb8ea8e45ccd4daebebba63df89fca (patch) | |
tree | e218eb69a01f275a61bd91e01171fdcb01ab8b37 /src | |
parent | 63ad3813f76d53a6fa98f45868e8b096331a2d18 (diff) |
Mobile: Outline mode for disabled toolbar arrows
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/root.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/ui/root.c b/src/ui/root.c index d3eb221e..2a7bf4ff 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -581,14 +581,20 @@ static void updateNavBarIdentity_(iWidget *navBar) { | |||
581 | 581 | ||
582 | static void updateNavDirButtons_(iWidget *navBar) { | 582 | static void updateNavDirButtons_(iWidget *navBar) { |
583 | const iHistory *history = history_DocumentWidget(document_App()); | 583 | const iHistory *history = history_DocumentWidget(document_App()); |
584 | setFlags_Widget(findChild_Widget(navBar, "navbar.back"), disabled_WidgetFlag, | 584 | const iBool atOldest = atOldest_History(history); |
585 | atOldest_History(history)); | 585 | const iBool atNewest = atNewest_History(history); |
586 | setFlags_Widget(findChild_Widget(navBar, "navbar.forward"), disabled_WidgetFlag, | 586 | setFlags_Widget(findChild_Widget(navBar, "navbar.back"), disabled_WidgetFlag, atOldest); |
587 | atLatest_History(history)); | 587 | setFlags_Widget(findChild_Widget(navBar, "navbar.forward"), disabled_WidgetFlag, atNewest); |
588 | setFlags_Widget(findWidget_App("toolbar.back"), disabled_WidgetFlag, | 588 | iWidget *toolBar = findWidget_App("toolbar"); |
589 | atOldest_History(history)); | 589 | if (toolBar) { |
590 | setFlags_Widget(findWidget_App("toolbar.forward"), disabled_WidgetFlag, | 590 | iLabelWidget *back = findChild_Widget(toolBar, "toolbar.back"); |
591 | atLatest_History(history)); | 591 | iLabelWidget *fwd = findChild_Widget(toolBar, "toolbar.forward"); |
592 | setFlags_Widget(as_Widget(back), disabled_WidgetFlag, atOldest); | ||
593 | setOutline_LabelWidget(back, atOldest); | ||
594 | setFlags_Widget(as_Widget(fwd), disabled_WidgetFlag, atNewest); | ||
595 | setOutline_LabelWidget(fwd, atNewest); | ||
596 | refresh_Widget(toolBar); | ||
597 | } | ||
592 | } | 598 | } |
593 | 599 | ||
594 | static const char *loadAnimationCStr_(void) { | 600 | static const char *loadAnimationCStr_(void) { |