summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-05-17 14:28:50 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-05-17 14:28:50 +0300
commit42ac51ac631ce111324aaa8cba4659af0489da7b (patch)
treeb084d9922398cfc157ff4fc2919da02666fb73f3 /src
parent2068c2cd5880f27f9b5af53f5bf62bcd7d4cff14 (diff)
Mobile: Landscape Preferences layout
Diffstat (limited to 'src')
-rw-r--r--src/ui/mobile.c26
-rw-r--r--src/ui/mobile.h1
2 files changed, 10 insertions, 17 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c
index 9e877968..b1d4d71c 100644
--- a/src/ui/mobile.c
+++ b/src/ui/mobile.c
@@ -74,12 +74,21 @@ static iBool mainDetailSplitHandler_(iWidget *mainDetailSplit, const char *cmd)
74 setPos_Widget(mainDetailSplit, topLeft_Rect(safeRoot)); 74 setPos_Widget(mainDetailSplit, topLeft_Rect(safeRoot));
75 setFixedSize_Widget(mainDetailSplit, safeRoot.size); 75 setFixedSize_Widget(mainDetailSplit, safeRoot.size);
76 setFlags_Widget(mainDetailSplit, arrangeHorizontal_WidgetFlag, !isPortrait); 76 setFlags_Widget(mainDetailSplit, arrangeHorizontal_WidgetFlag, !isPortrait);
77 iForEach(ObjectList, i, children_Widget(findChild_Widget(mainDetailSplit, "detailstack"))) { 77 iWidget *detailStack = findChild_Widget(mainDetailSplit, "detailstack");
78 setFlags_Widget(detailStack, expand_WidgetFlag, !isPortrait);
79 if (!isPortrait) {
80 iWidget *topPanel = findChild_Widget(mainDetailSplit, "panel.top");
81 iAssert(topPanel);
82 topPanel->rect.size.x = safeRoot.size.x * 2 / 5;
83 }
84 iForEach(ObjectList, i, children_Widget(detailStack)) {
78 iWidget *panel = i.object; 85 iWidget *panel = i.object;
79 setFlags_Widget(panel, edgeDraggable_WidgetFlag, isPortrait); 86 setFlags_Widget(panel, edgeDraggable_WidgetFlag, isPortrait);
80 if (!isPortrait) { 87 if (!isPortrait) {
81 setVisualOffset_Widget(panel, 0, 0, 0); 88 setVisualOffset_Widget(panel, 0, 0, 0);
82 } 89 }
90 const int pad = isPortrait ? 0 : 3 * gap_UI;
91 setPadding_Widget(panel, pad, 0, pad, pad);
83 } 92 }
84 arrange_Widget(mainDetailSplit); 93 arrange_Widget(mainDetailSplit);
85 } 94 }
@@ -711,21 +720,6 @@ void finalizeSheet_Mobile(iWidget *sheet) {
711 postRefresh_App(); 720 postRefresh_App();
712} 721}
713 722
714#if 0
715void setupDetailPanelTransition_Mobile(iWidget *panel, iBool isIncoming) {
716 if (isIncoming || deviceType_App() != phone_AppDeviceType) {
717 setVisualOffset_Widget(panel, 0, 200, easeOut_AnimFlag | softer_AnimFlag);
718 }
719 else {
720 const iBool wasDragged = iAbs(value_Anim(&panel->visualOffset)) > -width_Widget(panel);
721 setVisualOffset_Widget(panel,
722 -width_Widget(panel),
723 wasDragged ? 100 : 200,
724 wasDragged ? 0 : easeOut_AnimFlag | softer_AnimFlag);
725 }
726}
727#endif
728
729void setupMenuTransition_Mobile(iWidget *sheet, iBool isIncoming) { 723void setupMenuTransition_Mobile(iWidget *sheet, iBool isIncoming) {
730 if (deviceType_App() != phone_AppDeviceType) { 724 if (deviceType_App() != phone_AppDeviceType) {
731 return; 725 return;
diff --git a/src/ui/mobile.h b/src/ui/mobile.h
index 209b41b8..44134389 100644
--- a/src/ui/mobile.h
+++ b/src/ui/mobile.h
@@ -28,6 +28,5 @@ iDeclareType(Widget)
28 28
29void setupMenuTransition_Mobile (iWidget *menu, iBool isIncoming); 29void setupMenuTransition_Mobile (iWidget *menu, iBool isIncoming);
30void setupSheetTransition_Mobile (iWidget *sheet, iBool isIncoming); 30void setupSheetTransition_Mobile (iWidget *sheet, iBool isIncoming);
31//void setupDetailPanelTransition_Mobile (iWidget *Panel, iBool isIncoming);
32 31
33void finalizeSheet_Mobile (iWidget *sheet); 32void finalizeSheet_Mobile (iWidget *sheet);