From 22bce9cdd9b9f1a2f663a5540851f0dd71b73dbe Mon Sep 17 00:00:00 2001 From: cage Date: Fri, 12 Nov 2021 21:06:28 +0100 Subject: [PATCH] - made width of TOC customizable (when using tinmop in gemini fullscreen mode). --- etc/shared.conf | 15 ++++++++++----- src/gemini-page-toc.lisp | 2 +- src/package.lisp | 1 + src/software-configuration.lisp | 11 +++++++++++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/etc/shared.conf b/etc/shared.conf index e6a557b..6c0d997 100644 --- a/etc/shared.conf +++ b/etc/shared.conf @@ -155,6 +155,11 @@ color-regexp = ":aborted" red color-regexp = ":rendering" cyan +# The width of the generated table of contents for gemini pages when +# tinmop is ran as exclusive gemini client (command line option "-G") + +gemini.exclusive.mode.toc.width = 1/5 + # the signature file path relative to $HOME # signature-file = ".signature" @@ -165,10 +170,6 @@ color-regexp = ":rendering" cyan # ignore-user-regexp = "^user-name@domain-name" -# Use gemini favicon? -# see gemini://mozz.us/files/rfc_gemini_favicon.gmi -# gemini.fetch.favicon = no - # you can instruct the program to open some non gemini link with a # program installed with your system like below # syntax open "REGEXP" with "PROGRAM-NAME" [use cache] @@ -215,4 +216,8 @@ open ".gpub$" with "tinmop" # E.g. gemini://foo/bar.gmi#baz will jump to the first occurence of "baz". # The fragment is used as a, perl compatible, regular expression -experimental.gemini.iri.fragment.regex = no \ No newline at end of file +experimental.gemini.iri.fragment.regex = no + +# Use gemini favicon? +# see gemini://mozz.us/files/rfc_gemini_favicon.gmi +gemini.fetch.favicon = no diff --git a/src/gemini-page-toc.lisp b/src/gemini-page-toc.lisp index e3f54a9..da91a43 100644 --- a/src/gemini-page-toc.lisp +++ b/src/gemini-page-toc.lisp @@ -37,7 +37,7 @@ (selected-fg (swconf:selected-foreground theme-style)) (selected-bg (swconf:selected-background theme-style)) (width (if command-line:*gemini-full-screen-mode* - (truncate (* 1/4 (win-width *main-window*))) + (swconf:config-gemini-fullscreen-toc-width) (- (win-width *main-window*) (win-width *thread-window*)))) (raw-height (swconf:win-height swconf:+key-gemini-toc-window+)) diff --git a/src/package.lisp b/src/package.lisp index cf8bc50..5396de7 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1219,6 +1219,7 @@ :tree-config-rendering-values :make-tree-colormap :left-arrow + :config-gemini-fullscreen-toc-width :config-post-allowed-language :config-purge-history-days-offset :config-purge-cage-days-offset diff --git a/src/software-configuration.lisp b/src/software-configuration.lisp index e271447..9182335 100644 --- a/src/software-configuration.lisp +++ b/src/software-configuration.lisp @@ -477,6 +477,9 @@ width height position + exclusive + mode + toc downloading animation x @@ -935,6 +938,14 @@ (,transform-value-fn (access:accesses *software-configuration* ,@keys)))) +(gen-simple-access (gemini-fullscreen-toc-width + :transform-value-fn main-window:parse-subwin-w) + +key-gemini+ + +key-exclusive+ + +key-mode+ + +key-toc+ + +key-width+) + (gen-simple-access (post-allowed-language :transform-value-fn (lambda (a) (cl-ppcre:create-scanner a :case-insensitive-mode t)))