diff options
Diffstat (limited to 'src/app.c')
-rw-r--r-- | src/app.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -234,6 +234,7 @@ static iString *serializePrefs_App_(const iApp *d) { | |||
234 | iConstForEach(StringSet, fp, d->prefs.disabledFontPacks) { | 234 | iConstForEach(StringSet, fp, d->prefs.disabledFontPacks) { |
235 | appendFormat_String(str, "fontpack.disable id:%s\n", cstr_String(fp.value)); | 235 | appendFormat_String(str, "fontpack.disable id:%s\n", cstr_String(fp.value)); |
236 | } | 236 | } |
237 | appendFormat_String(str, "ansiescape arg:%d\n", d->prefs.gemtextAnsiEscapes); | ||
237 | /* TODO: This array belongs in Prefs. It can then be used for command handling as well. */ | 238 | /* TODO: This array belongs in Prefs. It can then be used for command handling as well. */ |
238 | const struct { | 239 | const struct { |
239 | const char * id; | 240 | const char * id; |
@@ -241,7 +242,6 @@ static iString *serializePrefs_App_(const iApp *d) { | |||
241 | } boolPrefs[] = { | 242 | } boolPrefs[] = { |
242 | { "prefs.animate", &d->prefs.uiAnimations }, | 243 | { "prefs.animate", &d->prefs.uiAnimations }, |
243 | { "prefs.font.smooth", &d->prefs.fontSmoothing }, | 244 | { "prefs.font.smooth", &d->prefs.fontSmoothing }, |
244 | { "prefs.gemtext.ansi", &d->prefs.gemtextAnsiEscapes }, | ||
245 | { "prefs.mono.gemini", &d->prefs.monospaceGemini }, | 245 | { "prefs.mono.gemini", &d->prefs.monospaceGemini }, |
246 | { "prefs.mono.gopher", &d->prefs.monospaceGopher }, | 246 | { "prefs.mono.gopher", &d->prefs.monospaceGopher }, |
247 | { "prefs.boldlink.visited", &d->prefs.boldLinkVisited }, | 247 | { "prefs.boldlink.visited", &d->prefs.boldLinkVisited }, |
@@ -2387,8 +2387,16 @@ iBool handleCommand_App(const char *cmd) { | |||
2387 | } | 2387 | } |
2388 | return iTrue; | 2388 | return iTrue; |
2389 | } | 2389 | } |
2390 | else if (equal_Command(cmd, "prefs.gemtext.ansi.changed")) { | 2390 | else if (equal_Command(cmd, "ansiescape")) { |
2391 | d->prefs.gemtextAnsiEscapes = arg_Command(cmd) != 0; | 2391 | d->prefs.gemtextAnsiEscapes = arg_Command(cmd); |
2392 | return iTrue; | ||
2393 | } | ||
2394 | else if (equal_Command(cmd, "prefs.gemtext.ansi.fg.changed")) { | ||
2395 | iChangeFlags(d->prefs.gemtextAnsiEscapes, allowFg_AnsiFlag, arg_Command(cmd)); | ||
2396 | return iTrue; | ||
2397 | } | ||
2398 | else if (equal_Command(cmd, "prefs.gemtext.ansi.fontstyle.changed")) { | ||
2399 | iChangeFlags(d->prefs.gemtextAnsiEscapes, allowFontStyle_AnsiFlag, arg_Command(cmd)); | ||
2392 | return iTrue; | 2400 | return iTrue; |
2393 | } | 2401 | } |
2394 | else if (equal_Command(cmd, "prefs.mono.gemini.changed") || | 2402 | else if (equal_Command(cmd, "prefs.mono.gemini.changed") || |
@@ -2822,7 +2830,10 @@ iBool handleCommand_App(const char *cmd) { | |||
2822 | setFlags_Widget(findChild_Widget(dlg, "prefs.boldlink.light"), | 2830 | setFlags_Widget(findChild_Widget(dlg, "prefs.boldlink.light"), |
2823 | selected_WidgetFlag, | 2831 | selected_WidgetFlag, |
2824 | d->prefs.boldLinkLight); | 2832 | d->prefs.boldLinkLight); |
2825 | setToggle_Widget(findChild_Widget(dlg, "prefs.gemtext.ansi"), d->prefs.gemtextAnsiEscapes); | 2833 | setToggle_Widget(findChild_Widget(dlg, "prefs.gemtext.ansi.fg"), |
2834 | d->prefs.gemtextAnsiEscapes & allowFg_AnsiFlag); | ||
2835 | setToggle_Widget(findChild_Widget(dlg, "prefs.gemtext.ansi.fontstyle"), | ||
2836 | d->prefs.gemtextAnsiEscapes & allowFontStyle_AnsiFlag); | ||
2826 | setToggle_Widget(findChild_Widget(dlg, "prefs.font.smooth"), d->prefs.fontSmoothing); | 2837 | setToggle_Widget(findChild_Widget(dlg, "prefs.font.smooth"), d->prefs.fontSmoothing); |
2827 | setFlags_Widget( | 2838 | setFlags_Widget( |
2828 | findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)), | 2839 | findChild_Widget(dlg, format_CStr("prefs.linewidth.%d", d->prefs.lineWidth)), |