diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-10-09 12:50:40 +0300 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-10-09 12:50:40 +0300 |
commit | aeaf46c5ac708bc225ea4095b7ce8fc607c74867 (patch) | |
tree | 43ba5f5f70504482da5a8e3b9210b50942ae818b /src/ui/util.c | |
parent | d197e02ae35d8439c80106db6ce1c561499e5629 (diff) |
Preferences: Selecting fonts to use
Now all the available fonts are selectable in the dialog. Added preformatted and UI font settings and shuffled the order a bit to make more sense.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r-- | src/ui/util.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/ui/util.c b/src/ui/util.c index 73193c7a..0e079efb 100644 --- a/src/ui/util.c +++ b/src/ui/util.c | |||
@@ -2523,8 +2523,6 @@ iWidget *makePreferences_Widget(void) { | |||
2523 | /* Fonts. */ { | 2523 | /* Fonts. */ { |
2524 | setId_Widget(appendTwoColumnTabPage_Widget(tabs, "${heading.prefs.fonts}", '4', &headings, &values), "prefs.page.fonts"); | 2524 | setId_Widget(appendTwoColumnTabPage_Widget(tabs, "${heading.prefs.fonts}", '4', &headings, &values), "prefs.page.fonts"); |
2525 | /* Fonts. */ { | 2525 | /* Fonts. */ { |
2526 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.ui}"))); | ||
2527 | addFontButtons_(values, "ui"); | ||
2528 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.heading}"))); | 2526 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.heading}"))); |
2529 | addFontButtons_(values, "heading"); | 2527 | addFontButtons_(values, "heading"); |
2530 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.body}"))); | 2528 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.body}"))); |
@@ -2532,41 +2530,44 @@ iWidget *makePreferences_Widget(void) { | |||
2532 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.mono}"))); | 2530 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.mono}"))); |
2533 | addFontButtons_(values, "mono"); | 2531 | addFontButtons_(values, "mono"); |
2534 | addDialogPadding_(headings, values); | 2532 | addDialogPadding_(headings, values); |
2535 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.mono}"))); | 2533 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.boldlink}"))); |
2536 | iWidget *mono = new_Widget(); { | 2534 | iWidget *boldLink = new_Widget(); { |
2535 | /* TODO: Add a utility function for this type of toggles? (also for above) */ | ||
2537 | iWidget *tog; | 2536 | iWidget *tog; |
2538 | setTextCStr_LabelWidget( | 2537 | setTextCStr_LabelWidget( |
2539 | addChild_Widget(mono, tog = iClob(makeToggle_Widget("prefs.mono.gemini"))), | 2538 | addChild_Widget(boldLink, tog = iClob(makeToggle_Widget("prefs.boldlink.dark"))), |
2540 | "${prefs.mono.gemini}"); | 2539 | "${prefs.boldlink.dark}"); |
2541 | setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); | 2540 | setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); |
2542 | updateSize_LabelWidget((iLabelWidget *) tog); | 2541 | updateSize_LabelWidget((iLabelWidget *) tog); |
2543 | setTextCStr_LabelWidget( | 2542 | setTextCStr_LabelWidget( |
2544 | addChild_Widget(mono, tog = iClob(makeToggle_Widget("prefs.mono.gopher"))), | 2543 | addChild_Widget(boldLink, tog = iClob(makeToggle_Widget("prefs.boldlink.light"))), |
2545 | "${prefs.mono.gopher}"); | 2544 | "${prefs.boldlink.light}"); |
2546 | setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); | 2545 | setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); |
2547 | updateSize_LabelWidget((iLabelWidget *) tog); | 2546 | updateSize_LabelWidget((iLabelWidget *) tog); |
2548 | } | 2547 | } |
2549 | addChildFlags_Widget(values, iClob(mono), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); | 2548 | addChildFlags_Widget(values, iClob(boldLink), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); |
2550 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.monodoc}"))); | ||
2551 | addFontButtons_(values, "monodoc"); | ||
2552 | addDialogPadding_(headings, values); | 2549 | addDialogPadding_(headings, values); |
2553 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.boldlink}"))); | 2550 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.mono}"))); |
2554 | iWidget *boldLink = new_Widget(); { | 2551 | iWidget *mono = new_Widget(); { |
2555 | /* TODO: Add a utility function for this type of toggles? (also for above) */ | ||
2556 | iWidget *tog; | 2552 | iWidget *tog; |
2557 | setTextCStr_LabelWidget( | 2553 | setTextCStr_LabelWidget( |
2558 | addChild_Widget(boldLink, tog = iClob(makeToggle_Widget("prefs.boldlink.dark"))), | 2554 | addChild_Widget(mono, tog = iClob(makeToggle_Widget("prefs.mono.gemini"))), |
2559 | "${prefs.boldlink.dark}"); | 2555 | "${prefs.mono.gemini}"); |
2560 | setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); | 2556 | setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); |
2561 | updateSize_LabelWidget((iLabelWidget *) tog); | 2557 | updateSize_LabelWidget((iLabelWidget *) tog); |
2562 | setTextCStr_LabelWidget( | 2558 | setTextCStr_LabelWidget( |
2563 | addChild_Widget(boldLink, tog = iClob(makeToggle_Widget("prefs.boldlink.light"))), | 2559 | addChild_Widget(mono, tog = iClob(makeToggle_Widget("prefs.mono.gopher"))), |
2564 | "${prefs.boldlink.light}"); | 2560 | "${prefs.mono.gopher}"); |
2565 | setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); | 2561 | setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); |
2566 | updateSize_LabelWidget((iLabelWidget *) tog); | 2562 | updateSize_LabelWidget((iLabelWidget *) tog); |
2567 | } | 2563 | } |
2568 | addChildFlags_Widget(values, iClob(boldLink), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); | 2564 | addChildFlags_Widget(values, iClob(mono), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); |
2565 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.monodoc}"))); | ||
2566 | addFontButtons_(values, "monodoc"); | ||
2569 | addDialogPadding_(headings, values); | 2567 | addDialogPadding_(headings, values); |
2568 | addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.ui}"))); | ||
2569 | addFontButtons_(values, "ui"); | ||
2570 | // addDialogPadding_(headings, values); | ||
2570 | // /* Custom font. */ { | 2571 | // /* Custom font. */ { |
2571 | // iInputWidget *customFont = new_InputWidget(0); | 2572 | // iInputWidget *customFont = new_InputWidget(0); |
2572 | // setHint_InputWidget(customFont, "${hint.prefs.userfont}"); | 2573 | // setHint_InputWidget(customFont, "${hint.prefs.userfont}"); |