diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-19 12:08:26 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-05-19 12:08:26 +0300 |
commit | f765b50caed9f2858ddf4e20ba3a6427e4750240 (patch) | |
tree | 0546c4d97d705cf8ceb6e807edfa0b05ab128678 /src/ui/mobile.c | |
parent | 462e5085392eb78610e9b991ed295f0168a079bb (diff) | |
parent | d2a76230effce8586b7d90beff519e221e744bf7 (diff) |
Merge branch 'dev' into work/typesetter
Diffstat (limited to 'src/ui/mobile.c')
-rw-r--r-- | src/ui/mobile.c | 18 |
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 | ||
307 | static iWidget *makeValuePaddingWithHeading_(iLabelWidget *heading, iWidget *value) { | 309 | static 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(); |