summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-20 15:49:25 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-20 15:49:25 +0200
commitaa70507d43d17ca2c426acd6bf91548fe267ac19 (patch)
treea53f23f16ac9e39031bbc1c7fc23f137dd15a74d
parentb51981e0d853f84d18bc5366894fd57764ae60de (diff)
Mobile: Sidebar toggling navbar button
-rw-r--r--src/ui/window.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index 8aea1581..689037f9 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -574,9 +574,8 @@ static iBool handleNavBarCommands_(iWidget *navBar, const char *cmd) {
574 embedButtonWidth * 0.75f); 574 embedButtonWidth * 0.75f);
575 } 575 }
576 if (isPhone) { 576 if (isPhone) {
577 static const char *buttons[] = { 577 static const char *buttons[] = { "navbar.back", "navbar.forward", "navbar.sidebar",
578 "navbar.back", "navbar.forward", "navbar.ident", "navbar.home", "navbar.menu" 578 "navbar.ident", "navbar.home", "navbar.menu" };
579 };
580 setFlags_Widget(findWidget_App("toolbar"), hidden_WidgetFlag, isLandscape_App()); 579 setFlags_Widget(findWidget_App("toolbar"), hidden_WidgetFlag, isLandscape_App());
581 iForIndices(i, buttons) { 580 iForIndices(i, buttons) {
582 iLabelWidget *btn = findChild_Widget(navBar, buttons[i]); 581 iLabelWidget *btn = findChild_Widget(navBar, buttons[i]);
@@ -954,6 +953,14 @@ static void setupUserInterface_Window(iWindow *d) {
954 setCommandHandler_Widget(navBar, handleNavBarCommands_); 953 setCommandHandler_Widget(navBar, handleNavBarCommands_);
955 setId_Widget(addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(backArrow_Icon, 0, 0, "navigate.back")), collapse_WidgetFlag), "navbar.back"); 954 setId_Widget(addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(backArrow_Icon, 0, 0, "navigate.back")), collapse_WidgetFlag), "navbar.back");
956 setId_Widget(addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(forwardArrow_Icon, 0, 0, "navigate.forward")), collapse_WidgetFlag), "navbar.forward"); 955 setId_Widget(addChildFlags_Widget(navBar, iClob(newIcon_LabelWidget(forwardArrow_Icon, 0, 0, "navigate.forward")), collapse_WidgetFlag), "navbar.forward");
956 /* Mobile devices have a button for easier access to the left sidebar. */
957 if (deviceType_App() != desktop_AppDeviceType) {
958 setId_Widget(addChildFlags_Widget(
959 navBar,
960 iClob(newIcon_LabelWidget(leftHalf_Icon, 0, 0, "sidebar.toggle")),
961 collapse_WidgetFlag),
962 "navbar.sidebar");
963 }
957 addChildFlags_Widget(navBar, iClob(new_Widget()), expand_WidgetFlag); 964 addChildFlags_Widget(navBar, iClob(new_Widget()), expand_WidgetFlag);
958 iLabelWidget *idMenu = makeMenuButton_LabelWidget( 965 iLabelWidget *idMenu = makeMenuButton_LabelWidget(
959 "\U0001f464", identityButtonMenuItems_, iElemCount(identityButtonMenuItems_)); 966 "\U0001f464", identityButtonMenuItems_, iElemCount(identityButtonMenuItems_));