summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ui/mobile.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c
index f0c471de..abc91218 100644
--- a/src/ui/mobile.c
+++ b/src/ui/mobile.c
@@ -176,13 +176,17 @@ static iBool topPanelHandler_(iWidget *topPanel, const char *cmd) {
176// openMenu_Widget(panel, innerToWindow_Widget(panel, zero_I2())); 176// openMenu_Widget(panel, innerToWindow_Widget(panel, zero_I2()));
177// setFlags_Widget(panel, hidden_WidgetFlag, iFalse); 177// setFlags_Widget(panel, hidden_WidgetFlag, iFalse);
178 unselectAllPanelButtons_(topPanel); 178 unselectAllPanelButtons_(topPanel);
179 int panelIndex = -1;
180 size_t childIndex = 0;
179 iForEach(ObjectList, i, children_Widget(findDetailStack_(topPanel))) { 181 iForEach(ObjectList, i, children_Widget(findDetailStack_(topPanel))) {
180 iWidget *child = i.object; 182 iWidget *child = i.object;
181 setFlags_Widget(child, hidden_WidgetFlag | disabled_WidgetFlag, child != panel); 183 setFlags_Widget(child, hidden_WidgetFlag | disabled_WidgetFlag, child != panel);
182 /* Animate the current panel in. */ 184 /* Animate the current panel in. */
183 if (child == panel && isPortrait) { 185 if (child == panel && isPortrait) {
184 setupSheetTransition_Mobile(panel, iTrue); 186 setupSheetTransition_Mobile(panel, iTrue);
187 panelIndex = childIndex;
185 } 188 }
189 childIndex++;
186 } 190 }
187 iLabelWidget *detailTitle = 191 iLabelWidget *detailTitle =
188 findChild_Widget(parent_Widget(parent_Widget(topPanel)), "detailtitle"); 192 findChild_Widget(parent_Widget(parent_Widget(topPanel)), "detailtitle");
@@ -191,6 +195,7 @@ static iBool topPanelHandler_(iWidget *topPanel, const char *cmd) {
191 setTextColor_LabelWidget(detailTitle, uiHeading_ColorId); 195 setTextColor_LabelWidget(detailTitle, uiHeading_ColorId);
192 setText_LabelWidget(detailTitle, text_LabelWidget((iLabelWidget *) findTitleLabel_(panel))); 196 setText_LabelWidget(detailTitle, text_LabelWidget((iLabelWidget *) findTitleLabel_(panel)));
193 setFlags_Widget(button, selected_WidgetFlag, iTrue); 197 setFlags_Widget(button, selected_WidgetFlag, iTrue);
198 postCommand_Widget(topPanel, "panel.changed arg:%d", panelIndex);
194 return iTrue; 199 return iTrue;
195 } 200 }
196 if (equal_Command(cmd, "swipe.back")) { 201 if (equal_Command(cmd, "swipe.back")) {
@@ -209,6 +214,7 @@ static iBool topPanelHandler_(iWidget *topPanel, const char *cmd) {
209 setFocus_Widget(NULL); 214 setFocus_Widget(NULL);
210 updateTextCStr_LabelWidget(findWidget_App("panel.back"), "Back"); 215 updateTextCStr_LabelWidget(findWidget_App("panel.back"), "Back");
211 wasClosed = iTrue; 216 wasClosed = iTrue;
217 postCommand_Widget(topPanel, "panel.changed arg:-1");
212 } 218 }
213 } 219 }
214 } 220 }
@@ -741,6 +747,9 @@ void initPanels_Mobile(iWidget *panels, iWidget *parentWidget,
741 setIcon_LabelWidget(button, icon); 747 setIcon_LabelWidget(button, icon);
742 } 748 }
743 iWidget *panel = addChildPanel_(detailStack, button, NULL); 749 iWidget *panel = addChildPanel_(detailStack, button, NULL);
750 if (argLabel_Command(item->label, "noscroll")) {
751 setFlags_Widget(panel, overflowScrollable_WidgetFlag, iFalse);
752 }
744 makePanelItems_Mobile(panel, item->data); 753 makePanelItems_Mobile(panel, item->data);
745 } 754 }
746 else { 755 else {