diff options
Diffstat (limited to 'src/ui/mobile.c')
-rw-r--r-- | src/ui/mobile.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c index 64a5a7cc..9bb55132 100644 --- a/src/ui/mobile.c +++ b/src/ui/mobile.c | |||
@@ -41,10 +41,18 @@ iBool isUsingPanelLayout_Mobile(void) { | |||
41 | return deviceType_App() != desktop_AppDeviceType; | 41 | return deviceType_App() != desktop_AppDeviceType; |
42 | } | 42 | } |
43 | 43 | ||
44 | #define sidebarMinWidth_Mobile (80 * gap_UI) | ||
45 | |||
44 | static iBool isSideBySideLayout_(void) { | 46 | static iBool isSideBySideLayout_(void) { |
47 | /* Minimum is an even split. */ | ||
48 | const int safeWidth = safeRect_Root(get_Root()).size.x; | ||
49 | if (safeWidth / 2 < sidebarMinWidth_Mobile) { | ||
50 | return iFalse; | ||
51 | } | ||
45 | if (deviceType_App() == phone_AppDeviceType) { | 52 | if (deviceType_App() == phone_AppDeviceType) { |
46 | return isLandscape_App(); | 53 | return isLandscape_App(); |
47 | } | 54 | } |
55 | /* Tablet may still be too narrow. */ | ||
48 | return numRoots_Window(get_Window()) == 1; | 56 | return numRoots_Window(get_Window()) == 1; |
49 | } | 57 | } |
50 | 58 | ||
@@ -128,8 +136,9 @@ static iBool mainDetailSplitHandler_(iWidget *mainDetailSplit, const char *cmd) | |||
128 | const int pad = isPortrait ? 0 : 3 * gap_UI; | 136 | const int pad = isPortrait ? 0 : 3 * gap_UI; |
129 | if (isSideBySide) { | 137 | if (isSideBySide) { |
130 | iAssert(topPanel); | 138 | iAssert(topPanel); |
131 | topPanel->rect.size.x = (deviceType_App() == phone_AppDeviceType ? | 139 | topPanel->rect.size.x = iMax(sidebarMinWidth_Mobile, |
132 | safeRoot.size.x * 2 / 5 : (safeRoot.size.x / 3)); | 140 | (deviceType_App() == phone_AppDeviceType ? |
141 | safeRoot.size.x * 2 / 5 : safeRoot.size.x / 3)); | ||
133 | } | 142 | } |
134 | if (deviceType_App() == tablet_AppDeviceType) { | 143 | if (deviceType_App() == tablet_AppDeviceType) { |
135 | setPadding_Widget(topPanel, pad, 0, pad, pad); | 144 | setPadding_Widget(topPanel, pad, 0, pad, pad); |