summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index a4411ea5..354b1467 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -2169,6 +2169,15 @@ iWidget *makePreferences_Widget(void) {
2169 { "${prefs.imagestyle.preformat}", 0, 0, format_CStr("imagestyle.set arg:%d", preformatColorized_ImageStyle) }, 2169 { "${prefs.imagestyle.preformat}", 0, 0, format_CStr("imagestyle.set arg:%d", preformatColorized_ImageStyle) },
2170 { NULL } 2170 { NULL }
2171 }; 2171 };
2172 const iMenuItem lineWidthItems[] = {
2173 { "button id:prefs.linewidth.50 text:\u20132", 0, 0, "linewidth.set arg:50" },
2174 { "button id:prefs.linewidth.58 text:\u20131", 0, 0, "linewidth.set arg:58" },
2175 { "button id:prefs.linewidth.66 label:prefs.linewidth.normal", 0, 0, "linewidth.set arg:66" },
2176 { "button id:prefs.linewidth.76 text:+1", 0, 0, "linewidth.set arg:76" },
2177 { "button id:prefs.linewidth.86 text:+2", 0, 0, "linewidth.set arg:86" },
2178 { "button id:prefs.linewidth.1000 label:prefs.linewidth.fill", 0, 0, "linewidth.set arg:1000" },
2179 { NULL }
2180 };
2172 /* Create the Preferences UI. */ 2181 /* Create the Preferences UI. */
2173 if (isUsingPanelLayout_Mobile()) { 2182 if (isUsingPanelLayout_Mobile()) {
2174 const iMenuItem pinSplitItems[] = { 2183 const iMenuItem pinSplitItems[] = {
@@ -2206,15 +2215,6 @@ iWidget *makePreferences_Widget(void) {
2206 { "button id:prefs.boldlink.light" }, 2215 { "button id:prefs.boldlink.light" },
2207 { NULL } 2216 { NULL }
2208 }; 2217 };
2209 const iMenuItem lineWidthItems[] = {
2210 { "button id:prefs.linewidth.30 text:\u20132", 0, 0, "linewidth.set arg:30" },
2211 { "button id:prefs.linewidth.34 text:\u20131", 0, 0, "linewidth.set arg:34" },
2212 { "button id:prefs.linewidth.38 label:prefs.linewidth.normal", 0, 0, "linewidth.set arg:38" },
2213 { "button id:prefs.linewidth.43 text:+1", 0, 0, "linewidth.set arg:43" },
2214 { "button id:prefs.linewidth.48 text:+2", 0, 0, "linewidth.set arg:48" },
2215 { "button id:prefs.linewidth.1000 label:prefs.linewidth.fill", 0, 0, "linewidth.set arg:1000" },
2216 { NULL }
2217 };
2218 const iMenuItem quoteItems[] = { 2218 const iMenuItem quoteItems[] = {
2219 { "button id:prefs.quoteicon.1 label:prefs.quoteicon.icon", 0, 0, "quoteicon.set arg:1" }, 2219 { "button id:prefs.quoteicon.1 label:prefs.quoteicon.icon", 0, 0, "quoteicon.set arg:1" },
2220 { "button id:prefs.quoteicon.0 label:prefs.quoteicon.line", 0, 0, "quoteicon.set arg:0" }, 2220 { "button id:prefs.quoteicon.0 label:prefs.quoteicon.line", 0, 0, "quoteicon.set arg:0" },
@@ -2541,12 +2541,16 @@ iWidget *makePreferences_Widget(void) {
2541 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.linewidth}"))); 2541 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.linewidth}")));
2542 iWidget *widths = new_Widget(); 2542 iWidget *widths = new_Widget();
2543 /* Line widths. */ { 2543 /* Line widths. */ {
2544 addRadioButton_(widths, "prefs.linewidth.30", "\u20132", "linewidth.set arg:30"); 2544 /* TODO: Make this a utility function to build radio buttons from items. */
2545 addRadioButton_(widths, "prefs.linewidth.34", "\u20131", "linewidth.set arg:34"); 2545 for (size_t i = 0; lineWidthItems[i].label; i++) {
2546 addRadioButton_(widths, "prefs.linewidth.38", "${prefs.linewidth.normal}", "linewidth.set arg:38"); 2546 const iMenuItem *lw = &lineWidthItems[i];
2547 addRadioButton_(widths, "prefs.linewidth.43", "+1", "linewidth.set arg:43"); 2547 addRadioButton_(widths,
2548 addRadioButton_(widths, "prefs.linewidth.48", "+2", "linewidth.set arg:48"); 2548 cstr_Command(lw->label, "id"),
2549 addRadioButton_(widths, "prefs.linewidth.1000", "${prefs.linewidth.fill}", "linewidth.set arg:1000"); 2549 hasLabel_Command(lw->label, "label")
2550 ? cstr_Lang(cstr_Command(lw->label, "label"))
2551 : cstr_Command(lw->label, "text"),
2552 lw->command);
2553 }
2550 } 2554 }
2551 addChildFlags_Widget(values, iClob(widths), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); 2555 addChildFlags_Widget(values, iClob(widths), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag);
2552 addPrefsInputWithHeading_(headings, values, "prefs.linespacing", iClob(new_InputWidget(5))); 2556 addPrefsInputWithHeading_(headings, values, "prefs.linespacing", iClob(new_InputWidget(5)));