diff --git a/etc/shared-gui.conf b/etc/shared-gui.conf index 59587dd..0eca347 100644 --- a/etc/shared-gui.conf +++ b/etc/shared-gui.conf @@ -2,232 +2,240 @@ # customize it according to your taste , and do not forget to share! # :) +# scaling icons: 1 (or 0) means no scaling. A negative integer number +# will shrink the icons and a positive number will expand the size. + +# E.g: a value of 2 will render the size twice larger. -2 will shrink +# the icons in half + +icons.scaling = -2 + # gemini browser -gemini.favicon = "🌍" +gemini.favicon = "🌍" -gemini.main-window.select.background = #f2d8f4 +gemini.main-window.select.background = #f2d8f4 -gemini.main-window.select.foreground = #5b4636 +gemini.main-window.select.foreground = #5b4636 -gemini.main-window.foreground = #5b4636 +gemini.main-window.foreground = #5b4636 -gemini.main-window.background = #f4ecd8 +gemini.main-window.background = #f4ecd8 # the font name -gemini.main-window.text.font = "Sans" +gemini.main-window.text.font = "Sans" -# positive number units in point, negatine units in pixel +# positive number units in point, negative units in pixel -gemini.main-window.text.size = 11 +gemini.main-window.text.size = 11 # normal or bold -gemini.main-window.text.weight = normal +gemini.main-window.text.weight = normal # roman or italic -gemini.main-window.text.slant = roman +gemini.main-window.text.slant = roman # boolean value -gemini.main-window.text.underline = no +gemini.main-window.text.underline = no # horizontal padding: unit of measure is the width of the '0' char, # using the font specified in 'gemini.main-window.text.font', above. -gemini.main-window.text.padding = 5 +gemini.main-window.text.padding = 5 # links -gemini.link.foreground = #5b4636 +gemini.link.foreground = #5b4636 -gemini.link.background = #f4ecd8 +gemini.link.background = #f4ecd8 -gemini.link.font = "Sans" +gemini.link.font = "Sans" -gemini.link.size = 12 +gemini.link.size = 12 -gemini.link.weight = bold +gemini.link.weight = bold -gemini.link.slant = roman +gemini.link.slant = roman -gemini.link.underline = yes +gemini.link.underline = yes -gemini.link.scheme.gemini.prefix = "→♊ " +gemini.link.scheme.gemini.prefix = "→♊ " -gemini.link.scheme.other.prefix = "→ " +gemini.link.scheme.other.prefix = "→ " -gemini.link.scheme.http.prefix = "→🕸 " +gemini.link.scheme.http.prefix = "→🕸 " # quotation -gemini.quote.prefix = "🞂 " +gemini.quote.prefix = "🞂 " -gemini.quote.foreground = #5b4636 +gemini.quote.foreground = #5b4636 -gemini.quote.background = #f4ecd8 +gemini.quote.background = #f4ecd8 -gemini.quote.font = Serif +gemini.quote.font = Serif -gemini.quote.size = 12 +gemini.quote.size = 12 -gemini.quote.weight = normal +gemini.quote.weight = normal -gemini.quote.slant = italic +gemini.quote.slant = italic -gemini.quote.underline = no +gemini.quote.underline = no -gemini.quote.justification = left +gemini.quote.justification = left # unordered list -gemini.bullet.prefix = "• " +gemini.bullet.prefix = "• " # header level 1 -gemini.h1.prefix = "" +gemini.h1.prefix = "" -gemini.h1.foreground = #5b4636 +gemini.h1.foreground = #5b4636 -gemini.h1.background = #f4ecd8 +gemini.h1.background = #f4ecd8 -gemini.h1.font = "Sans" +gemini.h1.font = "Sans" -gemini.h1.size = 20 +gemini.h1.size = 20 -gemini.h1.weight = bold +gemini.h1.weight = bold -gemini.h1.slant = roman +gemini.h1.slant = roman -gemini.h1.underline = no +gemini.h1.underline = no -gemini.h1.justification = center +gemini.h1.justification = center # header level 2 -gemini.h2.prefix = "" +gemini.h2.prefix = "" -gemini.h2.foreground = #5b4636 +gemini.h2.foreground = #5b4636 -gemini.h2.background = #f4ecd8 +gemini.h2.background = #f4ecd8 -gemini.h2.font = "Sans" +gemini.h2.font = "Sans" -gemini.h2.size = 15 +gemini.h2.size = 15 -gemini.h2.weight = bold +gemini.h2.weight = bold -gemini.h2.slant = roman +gemini.h2.slant = roman -gemini.h2.underline = no +gemini.h2.underline = no -gemini.h2.justification = left +gemini.h2.justification = left # header level 3 -gemini.h3.prefix = "" +gemini.h3.prefix = "" -gemini.h3.foreground = #5b4636 +gemini.h3.foreground = #5b4636 -gemini.h3.background = #f4ecd8 +gemini.h3.background = #f4ecd8 -gemini.h3.font = Sans +gemini.h3.font = Sans -gemini.h3.size = 14 +gemini.h3.size = 14 -gemini.h3.weight = normal +gemini.h3.weight = normal -gemini.h3.slant = roman +gemini.h3.slant = roman -gemini.h3.underline = no +gemini.h3.underline = no -gemini.h3.justification = left +gemini.h3.justification = left # preformatted text -gemini.preformatted-text.foreground = #5b4636 +gemini.preformatted-text.foreground = #5b4636 -gemini.preformatted-text.background = #f4ecd8 +gemini.preformatted-text.background = #f4ecd8 -gemini.preformatted-text.font = Monospace +gemini.preformatted-text.font = Monospace -gemini.preformatted-text.size = 12 +gemini.preformatted-text.size = 12 -gemini.preformatted-text.weight = bold +gemini.preformatted-text.weight = bold -gemini.preformatted-text.slant = roman +gemini.preformatted-text.slant = roman -gemini.preformatted-text.underline = no +gemini.preformatted-text.underline = no -gemini.preformatted.justification = left +gemini.preformatted.justification = left # Table of contents (TOC) # width in chars -toc.show = yes +toc.show = yes -toc.maximum.width = 40 +toc.maximum.width = 40 -toc.minimum.width = 20 +toc.minimum.width = 20 -toc.font = Monospace +toc.font = Monospace -toc.size = 12 +toc.size = 12 -toc.weight = normal +toc.weight = normal -toc.slant = roman +toc.slant = roman -toc.underline = no +toc.underline = no -toc.autoresize = yes +toc.autoresize = yes # stream frame -stream-frame.show = yes +stream-frame.show = yes # Keybinding # see: https://www.tcl.tk/man/tcl8.7/TkCmd/bind.html#M7 -keybinding.quit = "Control-q" +keybinding.quit = "Control-q" -keybinding.search = "Alt-f" +keybinding.search = "Alt-f" -keybinding.stream = "Alt-s" +keybinding.stream = "Alt-s" -keybinding.certificates = "Alt-c" +keybinding.certificates = "Alt-c" -keybinding.tour.manage = "Alt-t" +keybinding.tour.manage = "Alt-t" -keybinding.tour.next = "Control-t" +keybinding.tour.next = "Control-t" -keybinding.tour.shuffle = "Alt-S" +keybinding.tour.shuffle = "Alt-S" -keybinding.gemlog = "Alt-g" +keybinding.gemlog = "Alt-g" -keybinding.about = "Alt-a" +keybinding.about = "Alt-a" -keybinding.type-address = "Alt-d" +keybinding.type-address = "Alt-d" -keybinding.back = "Control-BackSpace" +keybinding.back = "Control-BackSpace" -keybinding.up = "U" +keybinding.up = "U" -keybinding.bookmark.toggle = "Control-d" +keybinding.bookmark.toggle = "Control-d" -keybinding.bookmark.show = "Alt-b" +keybinding.bookmark.show = "Alt-b" -keybinding.gemtext.scaling.increase = "Control-plus" +keybinding.gemtext.scaling.increase = "Control-plus" -keybinding.gemtext.scaling.decrease = "Control-minus" +keybinding.gemtext.scaling.decrease = "Control-minus" -keybinding.gemtext.scaling.reset = "Control-0" +keybinding.gemtext.scaling.reset = "Control-0" -keybinding.gemtext.refresh = "Control-r" +keybinding.gemtext.refresh = "Control-r" # emphasize text diff --git a/src/gui/client/client-configuration.lisp b/src/gui/client/client-configuration.lisp index 4b687d7..59edb61 100644 --- a/src/gui/client/client-configuration.lisp +++ b/src/gui/client/client-configuration.lisp @@ -26,6 +26,7 @@ (a:define-constant +client-sys-conf-filename+ "shared-gui.conf" :test #'string=) (swconf::gen-key-constants text + icons font size weight @@ -82,6 +83,16 @@ ;;;; end of parser +(swconf:gen-simple-access (icons-scaling + :transform-value-fn (lambda (a) + (let ((value (parse-integer a))) + (if (zerop value) + 1 + value))) + :configuration-tree *client-configuration*) + +key-icons+ + +key-scaling+) + (defun gemini-default-favicon () (swconf:access-non-null-conf-value *client-configuration* swconf:+key-gemini+ diff --git a/src/gui/client/icons.lisp b/src/gui/client/icons.lisp index ff7f24c..376c34e 100644 --- a/src/gui/client/icons.lisp +++ b/src/gui/client/icons.lisp @@ -97,7 +97,8 @@ (res:get-data-file (fs:cat-parent-dir +icon-dir+ filename))))) (with-open-file (stream path :element-type '(unsigned-byte 8)) (let ((data (gui-utils:read-into-array stream (file-length stream)))) - (gui:make-image data))))) + (gui:image-scale (gui:make-image data) + (client-configuration:config-icons-scaling)))))) (defun load-icons () (setf *search* (load-icon +search+)) diff --git a/src/package.lisp b/src/package.lisp index ecefd0b..4dfe01f 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -3268,6 +3268,7 @@ :+client-conf-filename+ :+client-sys-conf-filename+ :load-config-file + :config-icons-scaling :gemini-default-favicon :gemini-fetch-favicon-p :gemini-text-font-configuration