summaryrefslogtreecommitdiff
path: root/src/ui/mobile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/mobile.c')
-rw-r--r--src/ui/mobile.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c
index 1f5e9758..6c3a0b32 100644
--- a/src/ui/mobile.c
+++ b/src/ui/mobile.c
@@ -253,7 +253,9 @@ static iAnyObject *addPanelChild_(iWidget *panel, iAnyObject *child, int64_t fla
253 } 253 }
254 } 254 }
255 if ((elementType == toggle_PrefsElement && precedingElementType != toggle_PrefsElement) || 255 if ((elementType == toggle_PrefsElement && precedingElementType != toggle_PrefsElement) ||
256 (elementType == textInput_PrefsElement && precedingElementType != textInput_PrefsElement)) { 256 (elementType == textInput_PrefsElement && precedingElementType != textInput_PrefsElement) ||
257 (elementType == dropdown_PrefsElement && precedingElementType != dropdown_PrefsElement) ||
258 (elementType == radioButton_PrefsElement && precedingElementType == heading_PrefsElement)) {
257 flags |= borderTop_WidgetFlag; 259 flags |= borderTop_WidgetFlag;
258 } 260 }
259 return addChildFlags_Widget(panel, child, flags); 261 return addChildFlags_Widget(panel, child, flags);
@@ -305,6 +307,7 @@ static iWidget *makeValuePadding_(iWidget *value) {
305} 307}
306 308
307static iWidget *makeValuePaddingWithHeading_(iLabelWidget *heading, iWidget *value) { 309static iWidget *makeValuePaddingWithHeading_(iLabelWidget *heading, iWidget *value) {
310 const iBool isInput = isInstance_Object(value, &Class_InputWidget);
308 iWidget *div = new_Widget(); 311 iWidget *div = new_Widget();
309 setFlags_Widget(div, 312 setFlags_Widget(div,
310 borderBottom_WidgetFlag | arrangeHeight_WidgetFlag | 313 borderBottom_WidgetFlag | arrangeHeight_WidgetFlag |
@@ -313,10 +316,11 @@ static iWidget *makeValuePaddingWithHeading_(iLabelWidget *heading, iWidget *val
313 setBackgroundColor_Widget(div, uiBackgroundSidebar_ColorId); 316 setBackgroundColor_Widget(div, uiBackgroundSidebar_ColorId);
314 setPadding_Widget(div, gap_UI, gap_UI, 4 * gap_UI, gap_UI); 317 setPadding_Widget(div, gap_UI, gap_UI, 4 * gap_UI, gap_UI);
315 addChildFlags_Widget(div, iClob(heading), 0); 318 addChildFlags_Widget(div, iClob(heading), 0);
319 setPadding1_Widget(as_Widget(heading), 0);
316 //setFixedSize_Widget(as_Widget(heading), init_I2(-1, height_Widget(value))); 320 //setFixedSize_Widget(as_Widget(heading), init_I2(-1, height_Widget(value)));
317 setFont_LabelWidget(heading, labelFont_()); 321 setFont_LabelWidget(heading, labelFont_());
318 setTextColor_LabelWidget(heading, uiTextStrong_ColorId); 322 setTextColor_LabelWidget(heading, uiTextStrong_ColorId);
319 if (isInstance_Object(value, &Class_InputWidget)) { 323 if (isInput) {
320 addChildFlags_Widget(div, iClob(value), expand_WidgetFlag); 324 addChildFlags_Widget(div, iClob(value), expand_WidgetFlag);
321 } 325 }
322 else if (isInstance_Object(value, &Class_LabelWidget) && 326 else if (isInstance_Object(value, &Class_LabelWidget) &&
@@ -332,6 +336,7 @@ static iWidget *makeValuePaddingWithHeading_(iLabelWidget *heading, iWidget *val
332 addChildFlags_Widget(div, iClob(new_Widget()), expand_WidgetFlag); 336 addChildFlags_Widget(div, iClob(new_Widget()), expand_WidgetFlag);
333 addChild_Widget(div, iClob(value)); 337 addChild_Widget(div, iClob(value));
334 } 338 }
339 printTree_Widget(div);
335 return div; 340 return div;
336} 341}
337 342
@@ -374,7 +379,9 @@ void finalizeSheet_Mobile(iWidget *sheet) {
374 postRefresh_App(); 379 postRefresh_App();
375 return; 380 return;
376 } 381 }
377 /* Landscape Layout    Portrait Layout 382 /* TODO: In portrait, top panel and detail stack are all stacked together.
383
384 Landscape Layout    Portrait Layout
378    385   
379 ┌─────────┬──────Detail─Stack─────┐    ┌─────────┬ ─ ─ ─ ─ ┐ 386 ┌─────────┬──────Detail─Stack─────┐    ┌─────────┬ ─ ─ ─ ─ ┐
380 │ │┌───────────────────┐ │    │ │Detail 387 │ │┌───────────────────┐ │    │ │Detail
@@ -616,10 +623,9 @@ void finalizeSheet_Mobile(iWidget *sheet) {
616 addChild_Widget(topPanel, iClob(makePadding_Widget(lineHeight_Text(labelFont_())))); 623 addChild_Widget(topPanel, iClob(makePadding_Widget(lineHeight_Text(labelFont_()))));
617 iLabelWidget *aboutButton = addChildFlags_Widget(topPanel, 624 iLabelWidget *aboutButton = addChildFlags_Widget(topPanel,
618 iClob(makePanelButton_(planet_Icon " ${menu.about}", "panel.open")), 625 iClob(makePanelButton_(planet_Icon " ${menu.about}", "panel.open")),
619 chevron_WidgetFlag); 626 chevron_WidgetFlag | borderTop_WidgetFlag);
620 addChildFlags_Widget(topPanel, 627 addChildFlags_Widget(topPanel,
621 iClob(makePanelButton_(info_Icon " ${menu.help}", "!open url:about:help")), 628 iClob(makePanelButton_(info_Icon " ${menu.help}", "!open url:about:help")), 0);
622 borderTop_WidgetFlag);
623 /* The About panel. */ { 629 /* The About panel. */ {
624 iWidget *panel = addChildPanel_(detailStack, aboutButton, NULL); 630 iWidget *panel = addChildPanel_(detailStack, aboutButton, NULL);
625 iString *msg = collectNew_String(); 631 iString *msg = collectNew_String();