1
0
Fork 0

- [GUI] added configurable text selection color in gemtext window.

This commit is contained in:
cage 2023-05-16 19:32:02 +02:00
parent 32ea984845
commit 5e226644b8
5 changed files with 33 additions and 9 deletions

View File

@ -6,6 +6,10 @@
gemini.favicon = "🌍" gemini.favicon = "🌍"
gemini.main-window.select.background = #ff00ff
gemini.main-window.select.foreground = #ffffff
gemini.main-window.foreground = #5b4636 gemini.main-window.foreground = #5b4636
gemini.main-window.background = #f4ecd8 gemini.main-window.background = #f4ecd8

View File

@ -43,7 +43,8 @@
up up
bookmark bookmark
toggle toggle
show) show
select)
(defun load-config-file (&optional (virtual-filepath +client-conf-filename+) (defun load-config-file (&optional (virtual-filepath +client-conf-filename+)
(perform-missing-value-check nil)) (perform-missing-value-check nil))
@ -308,3 +309,15 @@
+key-keybinding+ +key-keybinding+
+key-bookmark+ +key-bookmark+
+key-show+) +key-show+)
(defun main-window-select-colors ()
(values (gui-goodies:parse-color (access:accesses *client-configuration*
swconf:+key-gemini+
swconf:+key-main-window+
+key-select+
swconf:+key-background+))
(gui-goodies:parse-color (access:accesses *client-configuration*
swconf:+key-gemini+
swconf:+key-main-window+
+key-select+
swconf:+key-foreground+))))

View File

@ -1190,12 +1190,16 @@
(let* ((gemtext-font (gui-conf:gemini-text-font-configuration)) (let* ((gemtext-font (gui-conf:gemini-text-font-configuration))
(padding (client-configuration:config-gemtext-padding)) (padding (client-configuration:config-gemtext-padding))
(padding-pixel (* padding (gui:font-measure gemtext-font "0")))) (padding-pixel (* padding (gui:font-measure gemtext-font "0"))))
(setf gemtext-widget (make-instance 'gui:scrolled-text (multiple-value-bind (select-bg select-fg)
:background (gui-conf:gemini-window-colors) (gui-conf:main-window-select-colors)
:padx padding-pixel (setf gemtext-widget (make-instance 'gui:scrolled-text
:master object :background (gui-conf:gemini-window-colors)
:read-only t :selectbackground select-bg
:font gemtext-font))) :selectforeground select-fg
:padx padding-pixel
:master object
:read-only t
:font gemtext-font))))
(gui:configure gemtext-widget :wrap :word) (gui:configure gemtext-widget :wrap :word)
(setf info-frame (make-instance 'gui:frame :master object :relief :sunken :borderwidth 1)) (setf info-frame (make-instance 'gui:frame :master object :relief :sunken :borderwidth 1))
(setf info-text (make-instance 'gui:text :height 2 :wrap :none :master info-frame)) (setf info-text (make-instance 'gui:text :height 2 :wrap :none :master info-frame))

View File

@ -37,8 +37,10 @@
(loop for match in (matches search-frame) do (loop for match in (matches search-frame) do
(gui:tag-configure gemtext-widget (gui:tag-configure gemtext-widget
(gui:match-tag-name match) (gui:match-tag-name match)
:foreground (gui:cget gemtext-widget
:selectforeground)
:background (gui:cget gemtext-widget :background (gui:cget gemtext-widget
:highlightbackground))))) :selectbackground)))))
(defun init-window (main-window) (defun init-window (main-window)
(let* ((frame (make-instance 'search-frame :master main-window)) (let* ((frame (make-instance 'search-frame :master main-window))
(gemtext-widget (client-main-window::gemtext-widget main-window)) (gemtext-widget (client-main-window::gemtext-widget main-window))

View File

@ -3293,7 +3293,8 @@
:config-keybinding-tour-next :config-keybinding-tour-next
:config-gemtext-padding :config-gemtext-padding
:config-keybinding-bookmark-toggle :config-keybinding-bookmark-toggle
:config-keybinding-bookmark-show)) :config-keybinding-bookmark-show
:main-window-select-colors))
(defpackage :client-os-utils (defpackage :client-os-utils
(:use (:use