summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-12 14:31:48 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-12 14:31:48 +0300
commitfc6f5c1e0d72042a274ce7b33b9f04f7cad7de77 (patch)
tree2bc10e742fa1062404c64fd50f55f17059dc0496 /src
parent77156d7405351e4bc3e4e5f36f60bc914decade9 (diff)
Mobile: Sidebar tweaks
Adjusted font sizes and action buttons moved to the top.
Diffstat (limited to 'src')
-rw-r--r--src/ui/sidebarwidget.c36
-rw-r--r--src/ui/window.c4
2 files changed, 25 insertions, 15 deletions
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 1a769f64..4d1cb3b0 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -138,9 +138,10 @@ static iLabelWidget *addActionButton_SidebarWidget_(iSidebarWidget *d, const cha
138 const char *command, int64_t flags) { 138 const char *command, int64_t flags) {
139 iLabelWidget *btn = addChildFlags_Widget(d->actions, 139 iLabelWidget *btn = addChildFlags_Widget(d->actions,
140 iClob(new_LabelWidget(label, command)), 140 iClob(new_LabelWidget(label, command)),
141 (deviceType_App() != desktop_AppDeviceType ? 141 //(deviceType_App() != desktop_AppDeviceType ?
142 extraPadding_WidgetFlag : 0) | flags); 142 // extraPadding_WidgetFlag : 0) |
143 setFont_LabelWidget(btn, d->buttonFont == uiLabelLarge_FontId ? defaultBig_FontId : d->buttonFont); 143 flags);
144 setFont_LabelWidget(btn, d->buttonFont);
144 checkIcon_LabelWidget(btn); 145 checkIcon_LabelWidget(btn);
145 return btn; 146 return btn;
146} 147}
@@ -601,7 +602,7 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) {
601 format_CStr("%s.mode arg:%d", cstr_String(id_Widget(w)), i))), 602 format_CStr("%s.mode arg:%d", cstr_String(id_Widget(w)), i))),
602 frameless_WidgetFlag | noBackground_WidgetFlag); 603 frameless_WidgetFlag | noBackground_WidgetFlag);
603 } 604 }
604 setButtonFont_SidebarWidget(d, isPhone ? uiLabelLarge_FontId : uiLabel_FontId); 605 setButtonFont_SidebarWidget(d, isPhone ? defaultBig_FontId : uiLabel_FontId);
605 addChildFlags_Widget(vdiv, 606 addChildFlags_Widget(vdiv,
606 iClob(buttons), 607 iClob(buttons),
607 arrangeHorizontal_WidgetFlag | 608 arrangeHorizontal_WidgetFlag |
@@ -626,15 +627,23 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) {
626 addChild_Widget(content, iClob(listAndActions)); 627 addChild_Widget(content, iClob(listAndActions));
627 d->list = new_ListWidget(); 628 d->list = new_ListWidget();
628 setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI); 629 setPadding_Widget(as_Widget(d->list), 0, gap_UI, 0, gap_UI);
629 addChildFlags_Widget(listAndActions, 630 if (!isPhone) {
630 iClob(d->list), 631 addChildFlags_Widget(listAndActions,
631 expand_WidgetFlag | drawBackgroundToHorizontalSafeArea_WidgetFlag); 632 iClob(d->list),
632 addChildFlags_Widget(listAndActions, iClob(d->actions = new_Widget()), 633 expand_WidgetFlag | drawBackgroundToHorizontalSafeArea_WidgetFlag);
633 arrangeHorizontal_WidgetFlag | 634 }
634 arrangeHeight_WidgetFlag | 635 setId_Widget(addChildFlags_Widget(listAndActions,
635 resizeWidthOfChildren_WidgetFlag | 636 iClob(d->actions = new_Widget()),
636 drawBackgroundToHorizontalSafeArea_WidgetFlag); 637 arrangeHorizontal_WidgetFlag | arrangeHeight_WidgetFlag |
637 setBackgroundColor_Widget(d->actions, uiBackground_ColorId); 638 resizeWidthOfChildren_WidgetFlag |
639 drawBackgroundToHorizontalSafeArea_WidgetFlag),
640 "actions");
641 setBackgroundColor_Widget(d->actions, uiBackgroundSidebar_ColorId);
642 if (isPhone) {
643 addChildFlags_Widget(listAndActions,
644 iClob(d->list),
645 expand_WidgetFlag | drawBackgroundToHorizontalSafeArea_WidgetFlag);
646 }
638 d->contextItem = NULL; 647 d->contextItem = NULL;
639 d->blank = new_Widget(); 648 d->blank = new_Widget();
640 addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag); 649 addChildFlags_Widget(content, iClob(d->blank), resizeChildren_WidgetFlag);
@@ -660,6 +669,7 @@ void init_SidebarWidget(iSidebarWidget *d, enum iSidebarSide side) {
660 if (side == left_SideBarSide) { 669 if (side == left_SideBarSide) {
661 postCommand_App("~sidebar.update"); /* unread count */ 670 postCommand_App("~sidebar.update"); /* unread count */
662 } 671 }
672 printTree_Widget(as_Widget(d));
663} 673}
664 674
665void deinit_SidebarWidget(iSidebarWidget *d) { 675void deinit_SidebarWidget(iSidebarWidget *d) {
diff --git a/src/ui/window.c b/src/ui/window.c
index b1df3805..970eeeac 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -153,8 +153,8 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) {
153 iSidebarWidget *sidebar = findChild_Widget(root, "sidebar"); 153 iSidebarWidget *sidebar = findChild_Widget(root, "sidebar");
154 iSidebarWidget *sidebar2 = findChild_Widget(root, "sidebar2"); 154 iSidebarWidget *sidebar2 = findChild_Widget(root, "sidebar2");
155 removeChild_Widget(parent_Widget(sidebar), sidebar); 155 removeChild_Widget(parent_Widget(sidebar), sidebar);
156 setButtonFont_SidebarWidget(sidebar, isLandscape_App() ? uiLabel_FontId : uiLabelLarge_FontId); 156 setButtonFont_SidebarWidget(sidebar, isLandscape_App() ? uiLabel_FontId : defaultBig_FontId);
157 setButtonFont_SidebarWidget(sidebar2, isLandscape_App() ? uiLabel_FontId : uiLabelLarge_FontId); 157 setButtonFont_SidebarWidget(sidebar2, isLandscape_App() ? uiLabel_FontId : defaultBig_FontId);
158// setBackgroundColor_Widget(findChild_Widget(as_Widget(sidebar), "buttons"), 158// setBackgroundColor_Widget(findChild_Widget(as_Widget(sidebar), "buttons"),
159// isPortrait_App() ? uiBackgroundUnfocusedSelection_ColorId 159// isPortrait_App() ? uiBackgroundUnfocusedSelection_ColorId
160// : uiBackgroundSidebar_ColorId); 160// : uiBackgroundSidebar_ColorId);