summaryrefslogtreecommitdiff
path: root/src/ui/util.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-10-22 18:38:27 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-10-22 18:38:27 +0300
commitb86322d28b0598e2d64128b0dd99a1d86561e23a (patch)
treeae62efc54114217032019a374e87d0656a4aa4b0 /src/ui/util.c
parent0470de0e450b7623254967593fb524db781c44e2 (diff)
Mobile: Minor fixes and tweaks
Tab close button visibility, newly added preferences, "Manage Fonts" button, button icon color.
Diffstat (limited to 'src/ui/util.c')
-rw-r--r--src/ui/util.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/ui/util.c b/src/ui/util.c
index 55adeffc..994f4671 100644
--- a/src/ui/util.c
+++ b/src/ui/util.c
@@ -1449,19 +1449,24 @@ static iLabelWidget *tabButtonForPage_Widget_(iWidget *tabs, const iWidget *page
1449} 1449}
1450 1450
1451void addTabCloseButton_Widget(iWidget *tabs, const iWidget *page, const char *command) { 1451void addTabCloseButton_Widget(iWidget *tabs, const iWidget *page, const char *command) {
1452 if (deviceType_App() == phone_AppDeviceType) {
1453 return; /* Close buttons not used on a phone due to lack of space. */
1454 }
1452 iLabelWidget *tabButton = tabButtonForPage_Widget_(tabs, page); 1455 iLabelWidget *tabButton = tabButtonForPage_Widget_(tabs, page);
1453// setPadding1_Widget(as_Widget(tabButton), gap_UI / 8);
1454 setPadding_Widget(as_Widget(tabButton), 0, 0, 0, gap_UI / 4); 1456 setPadding_Widget(as_Widget(tabButton), 0, 0, 0, gap_UI / 4);
1455 setFlags_Widget(as_Widget(tabButton), arrangeVertical_WidgetFlag | resizeHeightOfChildren_WidgetFlag, iTrue); 1457 setFlags_Widget(as_Widget(tabButton), arrangeVertical_WidgetFlag | resizeHeightOfChildren_WidgetFlag, iTrue);
1456 iLabelWidget *close = addChildFlags_Widget( 1458 iLabelWidget *close = addChildFlags_Widget(
1457 as_Widget(tabButton), 1459 as_Widget(tabButton),
1458 iClob(new_LabelWidget(close_Icon, 1460 iClob(new_LabelWidget(close_Icon,
1459 format_CStr("%s id:%s", command, cstr_String(id_Widget(page))))), 1461 format_CStr("%s id:%s", command, cstr_String(id_Widget(page))))),
1460 moveToParentRightEdge_WidgetFlag | tight_WidgetFlag | frameless_WidgetFlag | 1462 moveToParentRightEdge_WidgetFlag | tight_WidgetFlag | frameless_WidgetFlag |
1461 noBackground_WidgetFlag | hidden_WidgetFlag | visibleOnParentHover_WidgetFlag); 1463 noBackground_WidgetFlag | hidden_WidgetFlag | visibleOnParentHover_WidgetFlag);
1464 if (deviceType_App() != desktop_AppDeviceType) {
1465 setFlags_Widget(as_Widget(close),
1466 hidden_WidgetFlag | visibleOnParentHover_WidgetFlag, iFalse);
1467 }
1462 setNoAutoMinHeight_LabelWidget(close, iTrue); 1468 setNoAutoMinHeight_LabelWidget(close, iTrue);
1463 updateSize_LabelWidget(close); 1469 updateSize_LabelWidget(close);
1464// printTree_Widget(tabs);
1465} 1470}
1466 1471
1467void showTabPage_Widget(iWidget *tabs, const iWidget *page) { 1472void showTabPage_Widget(iWidget *tabs, const iWidget *page) {
@@ -2259,6 +2264,7 @@ iWidget *makePreferences_Widget(void) {
2259 { NULL } 2264 { NULL }
2260 }; 2265 };
2261 const iMenuItem boldLinkItems[] = { 2266 const iMenuItem boldLinkItems[] = {
2267 { "button id:prefs.boldlink.visited" },
2262 { "button id:prefs.boldlink.dark" }, 2268 { "button id:prefs.boldlink.dark" },
2263 { "button id:prefs.boldlink.light" }, 2269 { "button id:prefs.boldlink.light" },
2264 { NULL } 2270 { NULL }
@@ -2273,6 +2279,7 @@ iWidget *makePreferences_Widget(void) {
2273 { "heading text:${prefs.searchurl}" }, 2279 { "heading text:${prefs.searchurl}" },
2274 { "input id:prefs.searchurl url:1 noheading:1" }, 2280 { "input id:prefs.searchurl url:1 noheading:1" },
2275 { "padding" }, 2281 { "padding" },
2282 { "toggle id:prefs.bookmarks.addbottom" },
2276 { "toggle id:prefs.archive.openindex" }, 2283 { "toggle id:prefs.archive.openindex" },
2277 { "radio device:1 id:prefs.pinsplit", 0, 0, (const void *) pinSplitItems }, 2284 { "radio device:1 id:prefs.pinsplit", 0, 0, (const void *) pinSplitItems },
2278 { "padding" }, 2285 { "padding" },
@@ -2305,10 +2312,17 @@ iWidget *makePreferences_Widget(void) {
2305 }; 2312 };
2306 const iMenuItem fontPanelItems[] = { 2313 const iMenuItem fontPanelItems[] = {
2307 { "title id:heading.prefs.fonts" }, 2314 { "title id:heading.prefs.fonts" },
2308 { "dropdown id:prefs.headingfont", 0, 0, (const void *) constData_Array(makeFontItems_("headingfont")) }, 2315 { "dropdown id:prefs.font.heading", 0, 0, (const void *) constData_Array(makeFontItems_("heading")) },
2309 { "dropdown id:prefs.font", 0, 0, (const void *) constData_Array(makeFontItems_("font")) }, 2316 { "dropdown id:prefs.font.body", 0, 0, (const void *) constData_Array(makeFontItems_("body")) },
2317 { "dropdown id:prefs.font.mono", 0, 0, (const void *) constData_Array(makeFontItems_("mono")) },
2310 { "buttons id:prefs.mono", 0, 0, (const void *) monoFontItems }, 2318 { "buttons id:prefs.mono", 0, 0, (const void *) monoFontItems },
2311 { "buttons id:prefs.boldlink", 0, 0, (const void *) boldLinkItems }, 2319 { "dropdown id:prefs.font.monodoc", 0, 0, (const void *) constData_Array(makeFontItems_("monodoc")) },
2320 { "padding" },
2321 { "toggle id:prefs.font.smooth" },
2322 { "padding" },
2323 { "dropdown id:prefs.font.ui", 0, 0, (const void *) constData_Array(makeFontItems_("ui")) },
2324 { "padding" },
2325 { "button text:" fontpack_Icon " ${menu.fonts}", 0, 0, "!open url:about:fonts" },
2312 { NULL } 2326 { NULL }
2313 }; 2327 };
2314 const iMenuItem stylePanelItems[] = { 2328 const iMenuItem stylePanelItems[] = {
@@ -2317,6 +2331,7 @@ iWidget *makePreferences_Widget(void) {
2317 { "padding" }, 2331 { "padding" },
2318 { "input id:prefs.linespacing maxlen:5" }, 2332 { "input id:prefs.linespacing maxlen:5" },
2319 { "radio id:prefs.quoteicon", 0, 0, (const void *) quoteItems }, 2333 { "radio id:prefs.quoteicon", 0, 0, (const void *) quoteItems },
2334 { "buttons id:prefs.boldlink", 0, 0, (const void *) boldLinkItems },
2320 { "padding" }, 2335 { "padding" },
2321 { "toggle id:prefs.biglede" }, 2336 { "toggle id:prefs.biglede" },
2322 { "toggle id:prefs.plaintext.wrap" }, 2337 { "toggle id:prefs.plaintext.wrap" },
@@ -2582,8 +2597,8 @@ iWidget *makePreferences_Widget(void) {
2582 addChildFlags_Widget(values, iClob(ansi), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag); 2597 addChildFlags_Widget(values, iClob(ansi), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag);
2583 addDialogToggle_(headings, values, "${prefs.font.smooth}", "prefs.font.smooth"); 2598 addDialogToggle_(headings, values, "${prefs.font.smooth}", "prefs.font.smooth");
2584 addDialogPadding_(headings, values); 2599 addDialogPadding_(headings, values);
2585 addFontButtons_(values, "ui");
2586 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.ui}"))); 2600 addChild_Widget(headings, iClob(makeHeading_Widget("${prefs.font.ui}")));
2601 addFontButtons_(values, "ui");
2587 // addDialogPadding_(headings, values); 2602 // addDialogPadding_(headings, values);
2588// /* Custom font. */ { 2603// /* Custom font. */ {
2589// iInputWidget *customFont = new_InputWidget(0); 2604// iInputWidget *customFont = new_InputWidget(0);