summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-04-05 14:26:49 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-04-05 14:26:49 +0300
commit1137e9ab552ed2fecb019cc5574826f1dcce5cb7 (patch)
treebc727e677a8a4b15dd40f9141cdc80c4c52a8aa0 /src/ui
parentcc35373ce184f6aedb2f92979ed162710c7b4840 (diff)
Added option to disable bold links
IssueID #233
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/util.c53
1 files changed, 37 insertions, 16 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 4793f447..cdc58154 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1933,7 +1933,7 @@ iWidget *makePreferences_Widget(void) {
1933 setBackgroundColor_Widget(findChild_Widget(tabs, "tabs.buttons"), uiBackgroundSidebar_ColorId); 1933 setBackgroundColor_Widget(findChild_Widget(tabs, "tabs.buttons"), uiBackgroundSidebar_ColorId);
1934 setId_Widget(tabs, "prefs.tabs"); 1934 setId_Widget(tabs, "prefs.tabs");
1935 iWidget *headings, *values; 1935 iWidget *headings, *values;
1936 const int lineGap = lineHeight_Text(uiLabel_FontId); 1936 const int bigGap = lineHeight_Text(uiLabel_FontId) * 3 / 4;
1937 /* General preferences. */ { 1937 /* General preferences. */ {
1938 appendTwoColumnPage_(tabs, "${heading.prefs.general}", '1', &headings, &values); 1938 appendTwoColumnPage_(tabs, "${heading.prefs.general}", '1', &headings, &values);
1939#if defined (LAGRANGE_DOWNLOAD_EDIT) 1939#if defined (LAGRANGE_DOWNLOAD_EDIT)
@@ -1942,8 +1942,8 @@ iWidget *makePreferences_Widget(void) {
1942#endif 1942#endif
1943 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.searchurl}"))); 1943 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.searchurl}")));
1944 setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.searchurl"); 1944 setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.searchurl");
1945 addChild_Widget(headings, iClob(makePadding_Widget(lineGap))); 1945 addChild_Widget(headings, iClob(makePadding_Widget(bigGap)));
1946 addChild_Widget(values, iClob(makePadding_Widget(lineGap))); 1946 addChild_Widget(values, iClob(makePadding_Widget(bigGap)));
1947 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.collapsepreonload}"))); 1947 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.collapsepreonload}")));
1948 addChild_Widget(values, iClob(makeToggle_Widget("prefs.collapsepreonload"))); 1948 addChild_Widget(values, iClob(makeToggle_Widget("prefs.collapsepreonload")));
1949 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.plaintext.wrap}"))); 1949 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.plaintext.wrap}")));
@@ -1952,8 +1952,8 @@ iWidget *makePreferences_Widget(void) {
1952 addChild_Widget(values, iClob(makeToggle_Widget("prefs.centershort"))); 1952 addChild_Widget(values, iClob(makeToggle_Widget("prefs.centershort")));
1953 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.hoverlink}"))); 1953 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.hoverlink}")));
1954 addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink"))); 1954 addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoverlink")));
1955 addChild_Widget(headings, iClob(makePadding_Widget(lineGap))); 1955 addChild_Widget(headings, iClob(makePadding_Widget(bigGap)));
1956 addChild_Widget(values, iClob(makePadding_Widget(lineGap))); 1956 addChild_Widget(values, iClob(makePadding_Widget(bigGap)));
1957 /* UI languages. */ { 1957 /* UI languages. */ {
1958 iArray *uiLangs = collectNew_Array(sizeof(iMenuItem)); 1958 iArray *uiLangs = collectNew_Array(sizeof(iMenuItem));
1959 const iMenuItem langItems[] = { 1959 const iMenuItem langItems[] = {
@@ -2076,17 +2076,36 @@ iWidget *makePreferences_Widget(void) {
2076 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font}"))); 2076 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font}")));
2077 addFontButtons_(values, "font"); 2077 addFontButtons_(values, "font");
2078 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.mono}"))); 2078 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.mono}")));
2079 iWidget *mono = new_Widget(); 2079 iWidget *mono = new_Widget(); {
2080 iWidget *tog; 2080 iWidget *tog;
2081 setTextCStr_LabelWidget( 2081 setTextCStr_LabelWidget(
2082 addChild_Widget(mono, tog = iClob(makeToggle_Widget("prefs.mono.gemini"))), "${prefs.mono.gemini}"); 2082 addChild_Widget(mono, tog = iClob(makeToggle_Widget("prefs.mono.gemini"))),
2083 setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); 2083 "${prefs.mono.gemini}");
2084 updateSize_LabelWidget((iLabelWidget *) tog); 2084 setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse);
2085 setTextCStr_LabelWidget( 2085 updateSize_LabelWidget((iLabelWidget *) tog);
2086 addChild_Widget(mono, tog = iClob(makeToggle_Widget("prefs.mono.gopher"))), "${prefs.mono.gopher}"); 2086 setTextCStr_LabelWidget(
2087 setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse); 2087 addChild_Widget(mono, tog = iClob(makeToggle_Widget("prefs.mono.gopher"))),
2088 updateSize_LabelWidget((iLabelWidget *) tog); 2088 "${prefs.mono.gopher}");
2089 setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse);
2090 updateSize_LabelWidget((iLabelWidget *) tog);
2091 }
2089 addChildFlags_Widget(values, iClob(mono), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); 2092 addChildFlags_Widget(values, iClob(mono), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag);
2093 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.boldlink}")));
2094 iWidget *boldLink = new_Widget(); {
2095 /* TODO: Add a utility function for this type of toggles? (also for above) */
2096 iWidget *tog;
2097 setTextCStr_LabelWidget(
2098 addChild_Widget(boldLink, tog = iClob(makeToggle_Widget("prefs.boldlink.dark"))),
2099 "${prefs.boldlink.dark}");
2100 setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse);
2101 updateSize_LabelWidget((iLabelWidget *) tog);
2102 setTextCStr_LabelWidget(
2103 addChild_Widget(boldLink, tog = iClob(makeToggle_Widget("prefs.boldlink.light"))),
2104 "${prefs.boldlink.light}");
2105 setFlags_Widget(tog, fixedWidth_WidgetFlag, iFalse);
2106 updateSize_LabelWidget((iLabelWidget *) tog);
2107 }
2108 addChildFlags_Widget(values, iClob(boldLink), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag);
2090 } 2109 }
2091 makeTwoColumnHeading_("${heading.prefs.paragraph}", headings, values); 2110 makeTwoColumnHeading_("${heading.prefs.paragraph}", headings, values);
2092 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.linewidth}"))); 2111 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.linewidth}")));
@@ -2108,7 +2127,9 @@ iWidget *makePreferences_Widget(void) {
2108 addChildFlags_Widget(values, iClob(quote), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); 2127 addChildFlags_Widget(values, iClob(quote), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag);
2109 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.biglede}"))); 2128 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.biglede}")));
2110 addChild_Widget(values, iClob(makeToggle_Widget("prefs.biglede"))); 2129 addChild_Widget(values, iClob(makeToggle_Widget("prefs.biglede")));
2111 makeTwoColumnHeading_("${heading.prefs.widelayout}", headings, values); 2130// makeTwoColumnHeading_("${heading.prefs.widelayout}", headings, values);
2131 addChild_Widget(headings, iClob(makePadding_Widget(bigGap)));
2132 addChild_Widget(values, iClob(makePadding_Widget(bigGap)));
2112 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.sideicon}"))); 2133 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.sideicon}")));
2113 addChild_Widget(values, iClob(makeToggle_Widget("prefs.sideicon"))); 2134 addChild_Widget(values, iClob(makeToggle_Widget("prefs.sideicon")));
2114 } 2135 }