summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/mobile.c13
-rw-r--r--src/ui/sidebarwidget.c4
-rw-r--r--src/ui/util.c6
3 files changed, 15 insertions, 8 deletions
diff --git a/src/ui/mobile.c b/src/ui/mobile.c
index abc91218..7b34d389 100644
--- a/src/ui/mobile.c
+++ b/src/ui/mobile.c
@@ -515,6 +515,7 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {
515 } 515 }
516 else if (equal_Command(spec, "radio") || equal_Command(spec, "buttons")) { 516 else if (equal_Command(spec, "radio") || equal_Command(spec, "buttons")) {
517 const iBool isRadio = equal_Command(spec, "radio"); 517 const iBool isRadio = equal_Command(spec, "radio");
518 const iBool isHorizontal = argLabel_Command(spec, "horizontal");
518 addChild_Widget(panel, iClob(makePadding_Widget(lineHeight_Text(labelFont_())))); 519 addChild_Widget(panel, iClob(makePadding_Widget(lineHeight_Text(labelFont_()))));
519 iLabelWidget *head = makeHeading_Widget(label); 520 iLabelWidget *head = makeHeading_Widget(label);
520 setAllCaps_LabelWidget(head, iTrue); 521 setAllCaps_LabelWidget(head, iTrue);
@@ -522,11 +523,12 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {
522 addChild_Widget(panel, iClob(head)); 523 addChild_Widget(panel, iClob(head));
523 widget = new_Widget(); 524 widget = new_Widget();
524 setBackgroundColor_Widget(widget, uiBackgroundSidebar_ColorId); 525 setBackgroundColor_Widget(widget, uiBackgroundSidebar_ColorId);
525 setPadding_Widget(widget, 4 * gap_UI, 2 * gap_UI, 4 * gap_UI, 2 * gap_UI); 526 const int hPad = (isHorizontal ? 0 : 1);
527 setPadding_Widget(widget, hPad * gap_UI, 2 * gap_UI, hPad * gap_UI, 2 * gap_UI);
526 setFlags_Widget(widget, 528 setFlags_Widget(widget,
527 borderTop_WidgetFlag | 529 borderTop_WidgetFlag |
528 borderBottom_WidgetFlag | 530 borderBottom_WidgetFlag |
529 arrangeHorizontal_WidgetFlag | 531 (isHorizontal ? arrangeHorizontal_WidgetFlag : arrangeVertical_WidgetFlag) |
530 arrangeHeight_WidgetFlag | 532 arrangeHeight_WidgetFlag |
531 resizeToParentWidth_WidgetFlag | 533 resizeToParentWidth_WidgetFlag |
532 resizeWidthOfChildren_WidgetFlag, 534 resizeWidthOfChildren_WidgetFlag,
@@ -534,7 +536,10 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {
534 setId_Widget(widget, id); 536 setId_Widget(widget, id);
535 for (const iMenuItem *radioItem = item->data; radioItem->label; radioItem++) { 537 for (const iMenuItem *radioItem = item->data; radioItem->label; radioItem++) {
536 const char * radId = cstr_Rangecc(range_Command(radioItem->label, "id")); 538 const char * radId = cstr_Rangecc(range_Command(radioItem->label, "id"));
537 int64_t flags = noBackground_WidgetFlag; 539 int64_t flags = noBackground_WidgetFlag | frameless_WidgetFlag;
540 if (!isHorizontal) {
541 flags |= alignLeft_WidgetFlag;
542 }
538 iLabelWidget *button; 543 iLabelWidget *button;
539 if (isRadio) { 544 if (isRadio) {
540 const char *radLabel = 545 const char *radLabel =
@@ -552,7 +557,7 @@ void makePanelItem_Mobile(iWidget *panel, const iMenuItem *item) {
552 updateSize_LabelWidget(button); 557 updateSize_LabelWidget(button);
553 } 558 }
554 setId_Widget(as_Widget(button), radId); 559 setId_Widget(as_Widget(button), radId);
555 setFont_LabelWidget(button, uiLabelMedium_FontId); 560 setFont_LabelWidget(button, isHorizontal ? uiLabelMedium_FontId : uiLabelBig_FontId);
556 addChildFlags_Widget(widget, iClob(button), flags); 561 addChildFlags_Widget(widget, iClob(button), flags);
557 } 562 }
558 } 563 }
diff --git a/src/ui/sidebarwidget.c b/src/ui/sidebarwidget.c
index 8440a597..674e2b7c 100644
--- a/src/ui/sidebarwidget.c
+++ b/src/ui/sidebarwidget.c
@@ -582,7 +582,9 @@ static void updateItemHeight_SidebarWidget_(iSidebarWidget *d) {
582 if (d->list) { 582 if (d->list) {
583 setItemHeight_ListWidget(d->list, heights[d->mode] * lineHeight_Text(d->itemFonts[0])); 583 setItemHeight_ListWidget(d->list, heights[d->mode] * lineHeight_Text(d->itemFonts[0]));
584 } 584 }
585 updateItemHeight_CertListWidget(d->certList); 585 if (d->certList) {
586 updateItemHeight_CertListWidget(d->certList);
587 }
586} 588}
587 589
588iBool setMode_SidebarWidget(iSidebarWidget *d, enum iSidebarMode mode) { 590iBool setMode_SidebarWidget(iSidebarWidget *d, enum iSidebarMode mode) {
diff --git a/src/ui/util.c b/src/ui/util.c
index 695e43aa..04483e8d 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -2380,7 +2380,7 @@ iWidget *makePreferences_Widget(void) {
2380 { "heading id:heading.prefs.pagecontent" }, 2380 { "heading id:heading.prefs.pagecontent" },
2381 { "dropdown id:prefs.doctheme.dark", 0, 0, (const void *) docThemes[0] }, 2381 { "dropdown id:prefs.doctheme.dark", 0, 0, (const void *) docThemes[0] },
2382 { "dropdown id:prefs.doctheme.light", 0, 0, (const void *) docThemes[1] }, 2382 { "dropdown id:prefs.doctheme.light", 0, 0, (const void *) docThemes[1] },
2383 { "radio id:prefs.saturation", 0, 0, (const void *) satItems }, 2383 { "radio horizontal:1 id:prefs.saturation", 0, 0, (const void *) satItems },
2384 { "padding" }, 2384 { "padding" },
2385 { "dropdown id:prefs.imagestyle", 0, 0, (const void *) imgStyles }, 2385 { "dropdown id:prefs.imagestyle", 0, 0, (const void *) imgStyles },
2386 { NULL } 2386 { NULL }
@@ -2397,12 +2397,12 @@ iWidget *makePreferences_Widget(void) {
2397 { "padding" }, 2397 { "padding" },
2398 { "dropdown id:prefs.font.ui", 0, 0, (const void *) constData_Array(makeFontItems_("ui")) }, 2398 { "dropdown id:prefs.font.ui", 0, 0, (const void *) constData_Array(makeFontItems_("ui")) },
2399 { "padding" }, 2399 { "padding" },
2400 { "button text:" fontpack_Icon " ${menu.fonts}", 0, 0, "!open url:about:fonts" }, 2400 { "button text:" fontpack_Icon " " uiTextAction_ColorEscape "${menu.fonts}", 0, 0, "!open url:about:fonts" },
2401 { NULL } 2401 { NULL }
2402 }; 2402 };
2403 const iMenuItem stylePanelItems[] = { 2403 const iMenuItem stylePanelItems[] = {
2404 { "title id:heading.prefs.style" }, 2404 { "title id:heading.prefs.style" },
2405 { "radio id:prefs.linewidth", 0, 0, (const void *) lineWidthItems }, 2405 { "radio horizontal:1 id:prefs.linewidth", 0, 0, (const void *) lineWidthItems },
2406 { "padding" }, 2406 { "padding" },
2407 { "input id:prefs.linespacing maxlen:5" }, 2407 { "input id:prefs.linespacing maxlen:5" },
2408 { "radio id:prefs.quoteicon", 0, 0, (const void *) quoteItems }, 2408 { "radio id:prefs.quoteicon", 0, 0, (const void *) quoteItems },