diff options
Diffstat (limited to 'src/ui/mobile.c')
-rw-r--r-- | src/ui/mobile.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c index 7b34d389..c7b75d3f 100644 --- a/src/ui/mobile.c +++ b/src/ui/mobile.c | |||
@@ -511,6 +511,7 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) { | |||
511 | setId_Widget(as_Widget(drop), id); | 511 | setId_Widget(as_Widget(drop), id); |
512 | widget = makeValuePaddingWithHeading_(heading = makeHeading_Widget(label), as_Widget(drop)); | 512 | widget = makeValuePaddingWithHeading_(heading = makeHeading_Widget(label), as_Widget(drop)); |
513 | setCommandHandler_Widget(widget, dropdownHeadingHandler_); | 513 | setCommandHandler_Widget(widget, dropdownHeadingHandler_); |
514 | widget->padding[2] = gap_UI; | ||
514 | setUserData_Object(widget, drop); | 515 | setUserData_Object(widget, drop); |
515 | } | 516 | } |
516 | else if (equal_Command(spec, "radio") || equal_Command(spec, "buttons")) { | 517 | else if (equal_Command(spec, "radio") || equal_Command(spec, "buttons")) { |
@@ -534,7 +535,20 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) { | |||
534 | resizeWidthOfChildren_WidgetFlag, | 535 | resizeWidthOfChildren_WidgetFlag, |
535 | iTrue); | 536 | iTrue); |
536 | setId_Widget(widget, id); | 537 | setId_Widget(widget, id); |
538 | iBool isFirst = iTrue; | ||
537 | for (const iMenuItem *radioItem = item->data; radioItem->label; radioItem++) { | 539 | for (const iMenuItem *radioItem = item->data; radioItem->label; radioItem++) { |
540 | if (!isHorizontal && !isFirst) { | ||
541 | /* The separator is padded from the left so we need two. */ | ||
542 | iWidget *sep = new_Widget(); | ||
543 | iWidget *sep2 = new_Widget(); | ||
544 | addChildFlags_Widget(sep, iClob(sep2), 0); | ||
545 | setFlags_Widget(sep, arrangeHeight_WidgetFlag | resizeWidthOfChildren_WidgetFlag, iTrue); | ||
546 | setBackgroundColor_Widget(sep2, uiSeparator_ColorId); | ||
547 | setFixedSize_Widget(sep2, init_I2(-1, gap_UI / 4)); | ||
548 | setPadding_Widget(sep, 5 * gap_UI, 0, 0, 0); | ||
549 | addChildFlags_Widget(widget, iClob(sep), 0); | ||
550 | } | ||
551 | isFirst = iFalse; | ||
538 | const char * radId = cstr_Rangecc(range_Command(radioItem->label, "id")); | 552 | const char * radId = cstr_Rangecc(range_Command(radioItem->label, "id")); |
539 | int64_t flags = noBackground_WidgetFlag | frameless_WidgetFlag; | 553 | int64_t flags = noBackground_WidgetFlag | frameless_WidgetFlag; |
540 | if (!isHorizontal) { | 554 | if (!isHorizontal) { |
@@ -554,10 +568,13 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) { | |||
554 | button = (iLabelWidget *) makeToggle_Widget(radId); | 568 | button = (iLabelWidget *) makeToggle_Widget(radId); |
555 | setTextCStr_LabelWidget(button, format_CStr("${%s}", radId)); | 569 | setTextCStr_LabelWidget(button, format_CStr("${%s}", radId)); |
556 | setFlags_Widget(as_Widget(button), fixedWidth_WidgetFlag, iFalse); | 570 | setFlags_Widget(as_Widget(button), fixedWidth_WidgetFlag, iFalse); |
557 | updateSize_LabelWidget(button); | ||
558 | } | 571 | } |
559 | setId_Widget(as_Widget(button), radId); | 572 | setId_Widget(as_Widget(button), radId); |
560 | setFont_LabelWidget(button, isHorizontal ? uiLabelMedium_FontId : uiLabelBig_FontId); | 573 | setFont_LabelWidget(button, isHorizontal ? uiLabelMedium_FontId : uiLabelBig_FontId); |
574 | setCheckMark_LabelWidget(button, !isHorizontal); | ||
575 | setPadding_Widget(as_Widget(button), gap_UI, 1 * gap_UI, 0, 1 * gap_UI); | ||
576 | updateSize_LabelWidget(button); | ||
577 | setPadding_Widget(widget, 0, 0, 0, 0); | ||
561 | addChildFlags_Widget(widget, iClob(button), flags); | 578 | addChildFlags_Widget(widget, iClob(button), flags); |
562 | } | 579 | } |
563 | } | 580 | } |
@@ -575,6 +592,7 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) { | |||
575 | setFlags_Widget(widget, expand_WidgetFlag, iTrue); | 592 | setFlags_Widget(widget, expand_WidgetFlag, iTrue); |
576 | } | 593 | } |
577 | else { | 594 | else { |
595 | setFlags_Widget(as_Widget(input), alignRight_WidgetFlag, iTrue); | ||
578 | setContentPadding_InputWidget(input, 3 * gap_UI, 0); | 596 | setContentPadding_InputWidget(input, 3 * gap_UI, 0); |
579 | if (hasLabel_Command(spec, "unit")) { | 597 | if (hasLabel_Command(spec, "unit")) { |
580 | iWidget *unit = addChildFlags_Widget( | 598 | iWidget *unit = addChildFlags_Widget( |