From c89389fa21b57771342adb4419a121a4134c7727 Mon Sep 17 00:00:00 2001 From: cage Date: Sat, 29 Jul 2023 11:59:42 +0200 Subject: [PATCH] - [GUI] added configuration directive to toggle visibility of TOC and streams frame. --- etc/gui.conf | 6 ++++++ src/gui/client/client-configuration.lisp | 15 ++++++++++++++- src/gui/client/main-window.lisp | 6 ++++-- src/package.lisp | 4 +++- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/etc/gui.conf b/etc/gui.conf index f75fef0..7fa4995 100644 --- a/etc/gui.conf +++ b/etc/gui.conf @@ -167,6 +167,8 @@ gemini.preformatted.justification = left # width in chars +toc.show = no + toc.maximum.width = 40 toc.minimum.width = 20 @@ -183,6 +185,10 @@ toc.underline = no toc.autoresize = yes +# stream frame + +stream-frame.show = no + # Keybinding # see: https://www.tcl.tk/man/tcl8.7/TkCmd/bind.html#M7 diff --git a/src/gui/client/client-configuration.lisp b/src/gui/client/client-configuration.lisp index 1c7e500..87b46a4 100644 --- a/src/gui/client/client-configuration.lisp +++ b/src/gui/client/client-configuration.lisp @@ -54,7 +54,8 @@ increase decrease reset - refresh) + refresh + stream-frame) (defun load-config-file (&optional (virtual-filepath +client-conf-filename+) (perform-missing-value-check nil)) @@ -298,6 +299,12 @@ (gen-conf-justification gemini swconf:+key-preformatted-text+) +(swconf:gen-simple-access (toc-show-p + :transform-value-fn (lambda (a) (not (swconf:false-value-p a))) + :configuration-tree *client-configuration*) + swconf:+key-toc+ + +key-show+) + (swconf:gen-simple-access (toc-maximum-width :transform-value-fn (lambda (a) (truncate (or (num-utils:safe-parse-number a) @@ -439,3 +446,9 @@ +key-wrapped+ +key-asterisk+))) (not (swconf:false-value-p value)))) + +(swconf:gen-simple-access (stream-frame-show-p + :transform-value-fn (lambda (a) (not (swconf:false-value-p a))) + :configuration-tree *client-configuration*) + +key-stream-frame+ + +key-show+) diff --git a/src/gui/client/main-window.lisp b/src/gui/client/main-window.lisp index 0616870..99c3786 100644 --- a/src/gui/client/main-window.lisp +++ b/src/gui/client/main-window.lisp @@ -1394,10 +1394,12 @@ local file paths." (gui:grid info-text 0 0 :sticky :news) (gui-goodies:gui-resize-grid-all info-frame) (gui:grid tool-bar 0 0 :sticky :news) - (gui:add-pane gemini-paned-frame toc-frame) + (when (client-configuration:config-toc-show-p) + (gui:add-pane gemini-paned-frame toc-frame)) (gui:add-pane gemini-paned-frame gemtext-widget) (gui:add-pane main-paned-frame gemini-paned-frame :weight 2) - (gui:add-pane main-paned-frame stream-frame) + (when (client-configuration:config-stream-frame-show-p) + (gui:add-pane main-paned-frame stream-frame)) (gui:grid main-paned-frame 1 0 :sticky :news) (gui:grid search-frame 2 0 :sticky :news) (gui:grid-forget search-frame) diff --git a/src/package.lisp b/src/package.lisp index bd7a016..5f32613 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -3304,6 +3304,7 @@ :config-toc-minimum-width :config-toc-autoresize-p :toc-font-configuration + :config-toc-show-p :get-keybinding :config-keybinding-tour-shuffle :config-keybinding-tour-manage @@ -3316,7 +3317,8 @@ :config-keybinding-bookmark-toggle :config-keybinding-bookmark-show :main-window-select-colors - :emphasize-wrapped-asterisk-p)) + :emphasize-wrapped-asterisk-p + :config-stream-frame-show-p)) (defpackage :client-os-utils (:use