=> 790a2c49a0290ce872ec8929b063337eacde9880
[1mdiff --git a/src/app.c b/src/app.c[m [1mindex 81fe67af..d1732bf9 100644[m [1m--- a/src/app.c[m [1m+++ b/src/app.c[m [36m@@ -169,6 +169,8 @@[m [mstatic iString *serializePrefs_App_(const iApp *d) {[m appendFormat_String(str, "zoom.set arg:%d\n", d->prefs.zoomPercent);[m appendFormat_String(str, "linewidth.set arg:%d\n", d->prefs.lineWidth);[m appendFormat_String(str, "prefs.biglede.changed arg:%d\n", d->prefs.bigFirstParagraph);[m [32m+[m[32m appendFormat_String(str, "prefs.sideicon.changed arg:%d\n", d->prefs.sideIcon);[m [32m+[m[32m appendFormat_String(str, "prefs.hoveroutline.changed arg:%d\n", d->prefs.hoverOutline);[m appendFormat_String(str, "theme.set arg:%d auto:1\n", d->prefs.theme);[m appendFormat_String(str, "ostheme arg:%d\n", d->prefs.useSystemTheme);[m appendFormat_String(str, "saturation.set arg:%d\n", (int) ((d->prefs.saturation * 100) + 0.5f));[m [36m@@ -868,6 +870,16 @@[m [miBool handleCommand_App(const char *cmd) {[m postCommand_App("document.layout.changed");[m return iTrue;[m }[m [32m+[m[32m else if (equal_Command(cmd, "prefs.sideicon.changed")) {[m [32m+[m[32m d->prefs.sideIcon = arg_Command(cmd) != 0;[m [32m+[m[32m refresh_App();[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m [32m+[m[32m else if (equal_Command(cmd, "prefs.hoveroutline.changed")) {[m [32m+[m[32m d->prefs.hoverOutline = arg_Command(cmd) != 0;[m [32m+[m[32m refresh_App();[m [32m+[m[32m return iTrue;[m [32m+[m[32m }[m else if (equal_Command(cmd, "saturation.set")) {[m d->prefs.saturation = (float) arg_Command(cmd) / 100.0f;[m postCommandf_App("theme.changed auto:1");[m [36m@@ -982,6 +994,7 @@[m [miBool handleCommand_App(const char *cmd) {[m iWidget *dlg = makePreferences_Widget();[m updatePrefsThemeButtons_(dlg);[m setText_InputWidget(findChild_Widget(dlg, "prefs.downloads"), &d->prefs.downloadDir);[m [32m+[m[32m setToggle_Widget(findChild_Widget(dlg, "prefs.hoveroutline"), d->prefs.hoverOutline);[m setToggle_Widget(findChild_Widget(dlg, "prefs.ostheme"), d->prefs.useSystemTheme);[m setToggle_Widget(findChild_Widget(dlg, "prefs.retainwindow"), d->prefs.retainWindowSize);[m setText_InputWidget(findChild_Widget(dlg, "prefs.uiscale"),[m [36m@@ -994,6 +1007,7 @@[m [miBool handleCommand_App(const char *cmd) {[m selected_WidgetFlag,[m iTrue);[m setToggle_Widget(findChild_Widget(dlg, "prefs.biglede"), d->prefs.bigFirstParagraph);[m [32m+[m[32m setToggle_Widget(findChild_Widget(dlg, "prefs.sideicon"), d->prefs.sideIcon);[m setFlags_Widget([m findChild_Widget([m dlg, format_CStr("prefs.saturation.%d", (int) (d->prefs.saturation * 3.99f))),[m [1mdiff --git a/src/prefs.c b/src/prefs.c[m [1mindex 9b77b4f2..af481233 100644[m [1m--- a/src/prefs.c[m [1m+++ b/src/prefs.c[m [36m@@ -9,6 +9,8 @@[m [mvoid init_Prefs(iPrefs *d) {[m d->font = nunito_TextFont;[m d->lineWidth = 40;[m d->bigFirstParagraph = iTrue;[m [32m+[m[32m d->sideIcon = iTrue;[m [32m+[m[32m d->hoverOutline = iFalse;[m d->docThemeDark = colorfulDark_GmDocumentTheme;[m d->docThemeLight = white_GmDocumentTheme;[m d->saturation = 1.0f;[m [1mdiff --git a/src/prefs.h b/src/prefs.h[m [1mindex 42ccff85..324fb6fd 100644[m [1m--- a/src/prefs.h[m [1m+++ b/src/prefs.h[m [36m@@ -23,6 +23,8 @@[m [mstruct Impl_Prefs {[m int lineWidth;[m iBool bigFirstParagraph;[m iBool forceLineWrap;[m [32m+[m[32m iBool sideIcon;[m [32m+[m[32m iBool hoverOutline;[m enum iGmDocumentTheme docThemeDark;[m enum iGmDocumentTheme docThemeLight;[m float saturation;[m [1mdiff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c[m [1mindex 0079465f..ec6288d5 100644[m [1m--- a/src/ui/documentwidget.c[m [1m+++ b/src/ui/documentwidget.c[m [36m@@ -133,7 +133,7 @@[m [mstruct Impl_OutlineItem {[m iRangecc text;[m int font;[m iRect rect;[m [31m- int seenColor;[m [32m+[m[32m int seenColor; /* TODO: not used */[m int sepColor;[m };[m [m [36m@@ -2058,13 +2058,15 @@[m [mstatic void drawRun_DrawContext_(void *context, const iGmRun *run) {[m // drawRect_Paint(&d->paint, (iRect){ visPos, run->visBounds.size }, red_ColorId);[m }[m [m [31m-static void drawSideRect_(iPaint *p, iRect rect, int thickness) {[m [31m- if (equal_Color(get_Color(tmBannerBackground_ColorId), get_Color(tmBackground_ColorId))) {[m [31m- drawRectThickness_Paint(p, rect, thickness, tmBannerIcon_ColorId);[m [31m- }[m [31m- else {[m [31m- fillRect_Paint(p, rect, tmBannerBackground_ColorId);[m [32m+[m[32mstatic int drawSideRect_(iPaint *p, iRect rect) { //}, int thickness) {[m [32m+[m[32m int bg = tmBannerBackground_ColorId;[m [32m+[m[32m int fg = tmBannerIcon_ColorId;[m [32m+[m[32m if (equal_Color(get_Color(bg), get_Color(tmBackground_ColorId))) {[m [32m+[m[32m bg = tmBannerIcon_ColorId;[m [32m+[m[32m fg = tmBannerBackground_ColorId;[m }[m [32m+[m[32m fillRect_Paint(p, rect, bg);[m [32m+[m[32m return fg;[m }[m [m static void drawSideElements_DocumentWidget_(const iDocumentWidget *d) {[m [36m@@ -2079,7 +2081,7 @@[m [mstatic void drawSideElements_DocumentWidget_(const iDocumentWidget *d) {[m iPaint p;[m init_Paint(&p);[m setClip_Paint(&p, bounds);[m [31m- if (avail > minBannerSize) {[m [32m+[m[32m if (prefs_App()->sideIcon && avail > minBannerSize) {[m if (banner && opacity > 0) {[m setOpacity_Text(opacity);[m SDL_SetRenderDrawBlendMode(renderer_Window(get_Window()), SDL_BLENDMODE_BLEND);[m [36m@@ -2088,16 +2090,16 @@[m [mstatic void drawSideElements_DocumentWidget_(const iDocumentWidget *d) {[m p.alpha = opacity * 255;[m //int offset = iMax(0, bottom_Rect(banner->visBounds) - d->scrollY);[m rect.pos.y += height_Rect(bounds) / 2 - rect.size.y / 2 - (banner ? banner->visBounds.size.y / 2 : 0); // offset;[m [31m- drawSideRect_(&p, rect, gap_UI / 2);[m [31m- if (equal_Color(get_Color(tmBannerBackground_ColorId), get_Color(tmBackground_ColorId))) {[m [31m- drawRectThickness_Paint(&p, rect, gap_UI / 2, tmBannerIcon_ColorId);[m [31m- }[m [31m- else {[m [31m- fillRect_Paint(&p, rect, tmBannerBackground_ColorId);[m [31m- }[m [32m+[m[32m int fg = drawSideRect_(&p, rect); //, gap_UI / 2);[m [32m+[m[32m// if (equal_Color(get_Color(tmBannerBackground_ColorId), get_Color(tmBackground_ColorId))) {[m [32m+[m[32m// drawRectThickness_Paint(&p, rect, gap_UI / 2, tmBannerIcon_ColorId);[m [32m+[m[32m// }[m [32m+[m[32m// else {[m [32m+[m[32m// fillRect_Paint(&p, rect, tmBannerBackground_ColorId);[m [32m+[m[32m// }[m iString str;[m initUnicodeN_String(&str, &icon, 1);[m [31m- drawCentered_Text(banner_FontId, rect, iTrue, tmBannerIcon_ColorId, "%s", cstr_String(&str));[m [32m+[m[32m drawCentered_Text(banner_FontId, rect, iTrue, fg, "%s", cstr_String(&str));[m #if 0[m if (avail >= minBannerSize * 2) {[m const char *endp;[m [36m@@ -2139,7 +2141,7 @@[m [mstatic void drawSideElements_DocumentWidget_(const iDocumentWidget *d) {[m }[m /* Outline on the right side. */[m const float outlineOpacity = value_Anim(&d->outlineOpacity);[m [31m- if (!isEmpty_Array(&d->outline) && outlineOpacity > 0.0f) {[m [32m+[m[32m if (prefs_App()->hoverOutline && !isEmpty_Array(&d->outline) && outlineOpacity > 0.0f) {[m // const int font = uiLabel_FontId;[m //iRect outlineRect = initCorners_Rect(topRight_Rect(docBounds), bottomRight_Rect(bounds));[m //const int excess = width_Rect(outlineRect) - 75 * gap_UI;[m [36m@@ -2170,26 +2172,23 @@[m [mstatic void drawSideElements_DocumentWidget_(const iDocumentWidget *d) {[m setOpacity_Text(outlineOpacity);[m SDL_SetRenderDrawBlendMode(renderer_Window(get_Window()), SDL_BLENDMODE_BLEND);[m p.alpha = outlineOpacity * 255;[m [31m- drawSideRect_([m [31m- &p,[m [31m- (iRect){ addY_I2(pos, -outlinePadding_DocumentWidget_ * gap_UI / 2),[m [31m- init_I2(outWidth, outHeight + outlinePadding_DocumentWidget_ * gap_UI * 1.5f) },[m [31m- 1);[m [32m+[m[32m iRect outlineFrame = {[m [32m+[m[32m addY_I2(pos, -outlinePadding_DocumentWidget_ * gap_UI / 2),[m [32m+[m[32m init_I2(outWidth, outHeight + outlinePadding_DocumentWidget_ * gap_UI * 1.5f)[m [32m+[m[32m };[m [32m+[m[32m fillRect_Paint(&p, outlineFrame, tmBannerBackground_ColorId);[m [32m+[m[32m const int textFg = drawSideRect_(&p, outlineFrame); //, 1);[m iConstForEach(Array, i, &d->outline) {[m const iOutlineItem *item = i.value;[m iInt2 visPos = addX_I2(add_I2(pos, item->rect.pos), outlinePadding_DocumentWidget_ * gap_UI);[m [31m-// visPos.y -= scroll;[m [31m-// if (item->sepColor != none_ColorId) {[m [31m-// drawHLine_Paint(&p, addY_I2(visPos, -gap_UI), outWidth, item->sepColor);[m [31m-// }[m [31m-// drawRect_Paint(&p, (iRect){ visPos, item->rect.size }, red_ColorId);[m const iBool isVisible = d->lastVisibleRun && d->lastVisibleRun->text.start >= item->text.start;[m [31m- drawWrapRange_Text(item->font,[m [31m- visPos,[m [31m- innerWidth - left_Rect(item->rect),[m [31m- index_ArrayConstIterator(&i) == 0 || isVisible ? item->seenColor[m [31m- : tmQuoteIcon_ColorId,[m [31m- item->text);[m [32m+[m[32m const int fg = index_ArrayConstIterator(&i) == 0 || isVisible ? textFg[m [32m+[m[32m : tmQuoteIcon_ColorId;[m [32m+[m[32m drawWrapRange_Text([m [32m+[m[32m item->font, visPos, innerWidth - left_Rect(item->rect), fg, item->text);[m [32m+[m[32m if (left_Rect(item->rect) > 0) {[m [32m+[m[32m drawRange_Text(item->font, addX_I2(visPos, -3 * gap_UI), fg, range_CStr("\u2013"));[m [32m+[m[32m }[m }[m setOpacity_Text(1.0f);[m SDL_SetRenderDrawBlendMode(renderer_Window(get_Window()), SDL_BLENDMODE_NONE);[m [1mdiff --git a/src/ui/util.c b/src/ui/util.c[m [1mindex 27bac834..e106bfff 100644[m [1m--- a/src/ui/util.c[m [1m+++ b/src/ui/util.c[m [36m@@ -898,6 +898,8 @@[m [miWidget *makePreferences_Widget(void) {[m appendTwoColumnPage_(tabs, "General", '1', &headings, &values);[m addChild_Widget(headings, iClob(makeHeading_Widget("Downloads folder:")));[m setId_Widget(addChild_Widget(values, iClob(new_InputWidget(0))), "prefs.downloads");[m [32m+[m[32m addChild_Widget(headings, iClob(makeHeading_Widget("Outline on scrollbar:")));[m [32m+[m[32m addChild_Widget(values, iClob(makeToggle_Widget("prefs.hoveroutline")));[m makeTwoColumnHeading_("WINDOW", headings, values);[m #if defined (iPlatformApple) || defined (iPlatformMSys)[m addChild_Widget(headings, iClob(makeHeading_Widget("Use system theme:")));[m [36m@@ -939,6 +941,9 @@[m [miWidget *makePreferences_Widget(void) {[m addChildFlags_Widget(values, iClob(widths), arrangeHorizontal_WidgetFlag | arrangeSize_WidgetFlag);[m addChild_Widget(headings, iClob(makeHeading_Widget("Big 1st paragaph:")));[m addChild_Widget(values, iClob(makeToggle_Widget("prefs.biglede")));[m [32m+[m[32m makeTwoColumnHeading_("WIDE LAYOUT", headings, values);[m [32m+[m[32m addChild_Widget(headings, iClob(makeHeading_Widget("Site icon:")));[m [32m+[m[32m addChild_Widget(values, iClob(makeToggle_Widget("prefs.sideicon")));[m }[m /* Colors. */ {[m appendTwoColumnPage_(tabs, "Colors", '3', &headings, &values);[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).