diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-06 08:11:31 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-12-06 08:11:31 +0200 |
commit | f3e1ede71056e121b80206055fab0b4045107c2f (patch) | |
tree | bcbf2af63c441e16fd305ea29fbaac3d789a2583 /src/ui/root.c | |
parent | f135d7c989e397d00434d8e8b4b90dbb9a9950bd (diff) |
Mobile: Tablet fixes
Various issues with safe areas and font sizes.
Diffstat (limited to 'src/ui/root.c')
-rw-r--r-- | src/ui/root.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ui/root.c b/src/ui/root.c index 18a71200..a5dcd46d 100644 --- a/src/ui/root.c +++ b/src/ui/root.c | |||
@@ -333,6 +333,11 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) { | |||
333 | openMenuFlags_Widget(menu, zero_I2(), postCommands_MenuOpenFlags | center_MenuOpenFlags); | 333 | openMenuFlags_Widget(menu, zero_I2(), postCommands_MenuOpenFlags | center_MenuOpenFlags); |
334 | return iTrue; | 334 | return iTrue; |
335 | } | 335 | } |
336 | else if (deviceType_App() == tablet_AppDeviceType && equal_Command(cmd, "toolbar.showident")) { | ||
337 | /* No toolbar on tablet, so we handle this command here. */ | ||
338 | postCommand_App("preferences idents:1"); | ||
339 | return iTrue; | ||
340 | } | ||
336 | else if (equal_Command(cmd, "identmenu.open")) { | 341 | else if (equal_Command(cmd, "identmenu.open")) { |
337 | iWidget *toolBar = findWidget_Root("toolbar"); | 342 | iWidget *toolBar = findWidget_Root("toolbar"); |
338 | iWidget *button = findWidget_Root(toolBar && isPortraitPhone_App() ? "toolbar.ident" : "navbar.ident"); | 343 | iWidget *button = findWidget_Root(toolBar && isPortraitPhone_App() ? "toolbar.ident" : "navbar.ident"); |
@@ -486,6 +491,13 @@ static iBool handleRootCommands_(iWidget *root, const char *cmd) { | |||
486 | SDL_PushEvent(&(SDL_Event){ .type = SDL_QUIT }); | 491 | SDL_PushEvent(&(SDL_Event){ .type = SDL_QUIT }); |
487 | return iTrue; | 492 | return iTrue; |
488 | } | 493 | } |
494 | else if (deviceType_App() == tablet_AppDeviceType && equal_Command(cmd, "window.resized")) { | ||
495 | iSidebarWidget *sidebar = findChild_Widget(root, "sidebar"); | ||
496 | iSidebarWidget *sidebar2 = findChild_Widget(root, "sidebar2"); | ||
497 | setWidth_SidebarWidget(sidebar, 73.0f); | ||
498 | setWidth_SidebarWidget(sidebar2, 73.0f); | ||
499 | return iFalse; | ||
500 | } | ||
489 | else if (deviceType_App() == phone_AppDeviceType && equal_Command(cmd, "window.resized")) { | 501 | else if (deviceType_App() == phone_AppDeviceType && equal_Command(cmd, "window.resized")) { |
490 | /* Place the sidebar next to or under doctabs depending on orientation. */ | 502 | /* Place the sidebar next to or under doctabs depending on orientation. */ |
491 | iSidebarWidget *sidebar = findChild_Widget(root, "sidebar"); | 503 | iSidebarWidget *sidebar = findChild_Widget(root, "sidebar"); |
@@ -1056,7 +1068,7 @@ static iBool handleToolBarCommands_(iWidget *toolBar, const char *cmd) { | |||
1056 | return iTrue; | 1068 | return iTrue; |
1057 | } | 1069 | } |
1058 | else if (equal_Command(cmd, "toolbar.showident")) { | 1070 | else if (equal_Command(cmd, "toolbar.showident")) { |
1059 | iWidget *sidebar = findWidget_App("sidebar"); | 1071 | iWidget *sidebar = findWidget_App("sidebar"); |
1060 | if (isVisible_Widget(sidebar)) { | 1072 | if (isVisible_Widget(sidebar)) { |
1061 | postCommandf_App("sidebar.toggle"); | 1073 | postCommandf_App("sidebar.toggle"); |
1062 | } | 1074 | } |