summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/app.c b/src/app.c
index 2de4c370..1f7abbc4 100644
--- a/src/app.c
+++ b/src/app.c
@@ -215,6 +215,7 @@ static iString *serializePrefs_App_(const iApp *d) {
215 appendFormat_String(str, "memorysize.set arg:%d\n", d->prefs.maxMemorySize); 215 appendFormat_String(str, "memorysize.set arg:%d\n", d->prefs.maxMemorySize);
216 appendFormat_String(str, "decodeurls arg:%d\n", d->prefs.decodeUserVisibleURLs); 216 appendFormat_String(str, "decodeurls arg:%d\n", d->prefs.decodeUserVisibleURLs);
217 appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth); 217 appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth);
218 appendFormat_String(str, "linespacing.set arg:%f\n", d->prefs.lineSpacing);
218 /* TODO: Set up an array of booleans in Prefs and do these in a loop. */ 219 /* TODO: Set up an array of booleans in Prefs and do these in a loop. */
219 appendFormat_String(str, "prefs.animate.changed arg:%d\n", d->prefs.uiAnimations); 220 appendFormat_String(str, "prefs.animate.changed arg:%d\n", d->prefs.uiAnimations);
220 appendFormat_String(str, "prefs.mono.gemini.changed arg:%d\n", d->prefs.monospaceGemini); 221 appendFormat_String(str, "prefs.mono.gemini.changed arg:%d\n", d->prefs.monospaceGemini);
@@ -1707,6 +1708,12 @@ static iBool handlePrefsCommands_(iWidget *d, const char *cmd) {
1707 updateFontButton_(findChild_Widget(d, "prefs.headingfont"), arg_Command(cmd)); 1708 updateFontButton_(findChild_Widget(d, "prefs.headingfont"), arg_Command(cmd));
1708 return iFalse; 1709 return iFalse;
1709 } 1710 }
1711 else if (startsWith_CStr(cmd, "input.ended id:prefs.linespacing")) {
1712 /* Apply line spacing changes immediately. */
1713 const iInputWidget *lineSpacing = findWidget_App("prefs.linespacing");
1714 postCommandf_App("linespacing.set arg:%f", toFloat_String(text_InputWidget(lineSpacing)));
1715 return iTrue;
1716 }
1710 else if (equal_Command(cmd, "prefs.ostheme.changed")) { 1717 else if (equal_Command(cmd, "prefs.ostheme.changed")) {
1711 postCommandf_App("ostheme arg:%d", arg_Command(cmd)); 1718 postCommandf_App("ostheme arg:%d", arg_Command(cmd));
1712 } 1719 }
@@ -2118,6 +2125,11 @@ iBool handleCommand_App(const char *cmd) {
2118 postCommand_App("document.layout.changed"); 2125 postCommand_App("document.layout.changed");
2119 return iTrue; 2126 return iTrue;
2120 } 2127 }
2128 else if (equal_Command(cmd, "linespacing.set")) {
2129 d->prefs.lineSpacing = iMax(0.5f, argf_Command(cmd));
2130 postCommand_App("document.layout.changed redo:1");
2131 return iTrue;
2132 }
2121 else if (equal_Command(cmd, "quoteicon.set")) { 2133 else if (equal_Command(cmd, "quoteicon.set")) {
2122 d->prefs.quoteIcon = arg_Command(cmd) != 0; 2134 d->prefs.quoteIcon = arg_Command(cmd) != 0;
2123 postCommand_App("document.layout.changed"); 2135 postCommand_App("document.layout.changed");
@@ -2516,6 +2528,8 @@ iBool handleCommand_App(const char *cmd) {
2516 findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)), 2528 findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)),
2517 selected_WidgetFlag, 2529 selected_WidgetFlag,
2518 iTrue); 2530 iTrue);
2531 setText_InputWidget(findChild_Widget(dlg, "prefs.linespacing"),
2532 collectNewFormat_String("%.2f", d->prefs.lineSpacing));
2519 setFlags_Widget( 2533 setFlags_Widget(
2520 findChild_Widget(dlg, format_CStr("prefs.quoteicon.%d", d->prefs.quoteIcon)), 2534 findChild_Widget(dlg, format_CStr("prefs.quoteicon.%d", d->prefs.quoteIcon)),
2521 selected_WidgetFlag, 2535 selected_WidgetFlag,