summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/mobile.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c
index 9e4fef84..5382cbce 100644
--- a/src/ui/mobile.c
+++ b/src/ui/mobile.c
@@ -100,6 +100,16 @@ static iWidget *findTitleLabel_(iWidget *panel) {
100 return NULL; 100 return NULL;
101} 101}
102 102
103static void updateCertListHeight_(iWidget *detailStack) {
104 iWidget *certList = findChild_Widget(detailStack, "certlist");
105 if (certList) {
106 setFixedSize_Widget(certList,
107 init_I2(-1,
108 -1 * gap_UI + bottom_Rect(safeRect_Root(certList->root)) -
109 top_Rect(boundsWithoutVisualOffset_Widget(certList))));
110 }
111}
112
103static iBool mainDetailSplitHandler_(iWidget *mainDetailSplit, const char *cmd) { 113static iBool mainDetailSplitHandler_(iWidget *mainDetailSplit, const char *cmd) {
104 if (equal_Command(cmd, "window.resized")) { 114 if (equal_Command(cmd, "window.resized")) {
105 const iBool isPortrait = (deviceType_App() == phone_AppDeviceType && isPortrait_App()); 115 const iBool isPortrait = (deviceType_App() == phone_AppDeviceType && isPortrait_App());
@@ -147,6 +157,7 @@ static iBool mainDetailSplitHandler_(iWidget *mainDetailSplit, const char *cmd)
147 setPadding_Widget(panel, pad, 0, pad, pad); 157 setPadding_Widget(panel, pad, 0, pad, pad);
148 } 158 }
149 arrange_Widget(mainDetailSplit); 159 arrange_Widget(mainDetailSplit);
160 updateCertListHeight_(detailStack);
150 } 161 }
151 else if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) { 162 else if (equal_Command(cmd, "mouse.clicked") && arg_Command(cmd)) {
152 if (focus_Widget() && class_Widget(focus_Widget()) == &Class_InputWidget) { 163 if (focus_Widget() && class_Widget(focus_Widget()) == &Class_InputWidget) {
@@ -199,6 +210,7 @@ static iBool topPanelHandler_(iWidget *topPanel, const char *cmd) {
199 postCommand_Widget(topPanel, "panel.changed arg:%d", panelIndex); 210 postCommand_Widget(topPanel, "panel.changed arg:%d", panelIndex);
200 //printTree_Widget(findDetailStack_(topPanel)); 211 //printTree_Widget(findDetailStack_(topPanel));
201// updateVisible_ListWidget(findChild_Widget(findDetailStack_(topPanel), "certlist")); 212// updateVisible_ListWidget(findChild_Widget(findDetailStack_(topPanel), "certlist"));
213 updateCertListHeight_(findDetailStack_(topPanel));
202 return iTrue; 214 return iTrue;
203 } 215 }
204 if (equal_Command(cmd, "swipe.back")) { 216 if (equal_Command(cmd, "swipe.back")) {
@@ -619,8 +631,6 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {
619 widget = as_Widget(certList); 631 widget = as_Widget(certList);
620 updateItems_CertListWidget(certList); 632 updateItems_CertListWidget(certList);
621 invalidate_ListWidget(list); 633 invalidate_ListWidget(list);
622 setFixedSize_Widget(widget,
623 init_I2(-1, numItems_ListWidget(list) * itemHeight_ListWidget(list)));
624 } 634 }
625 else if (equal_Command(spec, "button")) { 635 else if (equal_Command(spec, "button")) {
626 widget = as_Widget(heading = makePanelButton_(label, item->command)); 636 widget = as_Widget(heading = makePanelButton_(label, item->command));
@@ -885,18 +895,21 @@ void setupMenuTransition_Mobile(iWidget *sheet, iBool isIncoming) {
885 if (!isUsingPanelLayout_Mobile()) { 895 if (!isUsingPanelLayout_Mobile()) {
886 return; 896 return;
887 } 897 }
888 const iBool isSlidePanel = (flags_Widget(sheet) & horizontalOffset_WidgetFlag) != 0; 898 const iBool isHorizPanel = (flags_Widget(sheet) & horizontalOffset_WidgetFlag) != 0;
889 if (isSlidePanel && isLandscape_App()) { 899 if (isHorizPanel && isLandscape_App()) {
890 return; 900 return;
891 } 901 }
902 const int maxOffset = isHorizPanel ? width_Widget(sheet)
903 : isPortraitPhone_App() ? height_Widget(sheet)
904 : (12 * gap_UI);
892 if (isIncoming) { 905 if (isIncoming) {
893 setVisualOffset_Widget(sheet, isSlidePanel ? width_Widget(sheet) : height_Widget(sheet), 0, 0); 906 setVisualOffset_Widget(sheet, maxOffset, 0, 0);
894 setVisualOffset_Widget(sheet, 0, 330, easeOut_AnimFlag | softer_AnimFlag); 907 setVisualOffset_Widget(sheet, 0, 330, easeOut_AnimFlag | softer_AnimFlag);
895 } 908 }
896 else { 909 else {
897 const iBool wasDragged = iAbs(value_Anim(&sheet->visualOffset) - 0) > 1; 910 const iBool wasDragged = iAbs(value_Anim(&sheet->visualOffset) - 0) > 1;
898 setVisualOffset_Widget(sheet, 911 setVisualOffset_Widget(sheet,
899 isSlidePanel ? width_Widget(sheet) : height_Widget(sheet), 912 maxOffset,
900 wasDragged ? 100 : 200, 913 wasDragged ? 100 : 200,
901 wasDragged ? 0 : easeIn_AnimFlag | softer_AnimFlag); 914 wasDragged ? 0 : easeIn_AnimFlag | softer_AnimFlag);
902 } 915 }