mirror of
https://codeberg.org/cage/tinmop/
synced 2025-02-01 04:26:47 +01:00
- [GUI] added configuration directive to emphasize text wrappend in asterisk.
This commit is contained in:
parent
80b85ecde2
commit
1af9f1f98a
@ -688,3 +688,11 @@ gopher-window.line.prefix.search = "🔎 "
|
||||
gopher-window.line.prefix.foreground = cyan
|
||||
|
||||
gopher-window.line.prefix.attribute = bold
|
||||
|
||||
#########################
|
||||
# ⚠ EXPERIMENTAL ZONE ⚠ #
|
||||
#########################
|
||||
|
||||
#emphasize text wrapped in asterisk *like this*
|
||||
|
||||
emphasize-text = yes
|
||||
|
@ -212,3 +212,7 @@ keybinding.up = "U"
|
||||
keybinding.bookmark.toggle = "Control-d"
|
||||
|
||||
keybinding.bookmark.show = "Control-b"
|
||||
|
||||
# emphasize text
|
||||
|
||||
emphasize.wrapped.asterisk = yes
|
@ -229,6 +229,10 @@ open "^((gemini://)|(\\.)|(/)).+gmi$" with "tinmop"
|
||||
open "^((gemini://)|(\\.)|(/)).+sh$" with "tinmop"
|
||||
open ".gpub$" with "tinmop"
|
||||
|
||||
gemini.images.montage.geometry = "640x480"
|
||||
|
||||
gemini.images.montage.tile = "1"
|
||||
|
||||
#########################
|
||||
# ⚠ EXPERIMENTAL ZONE ⚠ #
|
||||
#########################
|
||||
@ -242,7 +246,3 @@ experimental.gemini.iri.fragment.regex = no
|
||||
# Use gemini favicon?
|
||||
# see gemini://mozz.us/files/rfc_gemini_favicon.gmi
|
||||
gemini.fetch.favicon = no
|
||||
|
||||
gemini.images.montage.geometry = "640x480"
|
||||
|
||||
gemini.images.montage.tile = "1"
|
||||
|
@ -44,7 +44,10 @@
|
||||
bookmark
|
||||
toggle
|
||||
show
|
||||
select)
|
||||
select
|
||||
emphasize
|
||||
wrapped
|
||||
asterisk)
|
||||
|
||||
(defun load-config-file (&optional (virtual-filepath +client-conf-filename+)
|
||||
(perform-missing-value-check nil))
|
||||
@ -114,6 +117,45 @@
|
||||
|
||||
(gen-font-configuration +key-text+)
|
||||
|
||||
(defun font-text-bold ()
|
||||
(gui-goodies:make-font (access:accesses *client-configuration*
|
||||
swconf:+key-gemini+
|
||||
+key-text+
|
||||
+key-font+)
|
||||
(access:accesses *client-configuration*
|
||||
swconf:+key-gemini+
|
||||
+key-text+
|
||||
+key-size+)
|
||||
"bold"
|
||||
nil
|
||||
nil))
|
||||
|
||||
(defun font-text-italic ()
|
||||
(gui-goodies:make-font (access:accesses *client-configuration*
|
||||
swconf:+key-gemini+
|
||||
+key-text+
|
||||
+key-font+)
|
||||
(access:accesses *client-configuration*
|
||||
swconf:+key-gemini+
|
||||
+key-text+
|
||||
+key-size+)
|
||||
nil
|
||||
"italic"
|
||||
nil))
|
||||
|
||||
(defun font-text-underlined ()
|
||||
(gui-goodies:make-font (access:accesses *client-configuration*
|
||||
swconf:+key-gemini+
|
||||
+key-text+
|
||||
+key-font+)
|
||||
(access:accesses *client-configuration*
|
||||
swconf:+key-gemini+
|
||||
+key-text+
|
||||
+key-size+)
|
||||
nil
|
||||
nil
|
||||
t))
|
||||
|
||||
(gen-font-configuration swconf:+key-link+)
|
||||
|
||||
(gen-font-configuration swconf:+key-quote+)
|
||||
@ -321,3 +363,10 @@
|
||||
swconf:+key-main-window+
|
||||
+key-select+
|
||||
swconf:+key-foreground+))))
|
||||
|
||||
(defun emphasize-wrapped-asterisk-p ()
|
||||
(let ((value (access:accesses *client-configuration*
|
||||
+key-emphasize+
|
||||
+key-wrapped+
|
||||
+key-asterisk+)))
|
||||
(not (swconf:false-value-p value))))
|
||||
|
@ -497,6 +497,18 @@
|
||||
#'download-background-callback)
|
||||
(gui:popup popup-menu x y)))))
|
||||
|
||||
(defmethod maybe-re-emphatize-lines (gemtext-widget from to)
|
||||
(when (client-configuration:emphasize-wrapped-asterisk-p)
|
||||
(let ((matches (gui:search-all-text gemtext-widget
|
||||
"\\*[^*]+\\*"
|
||||
:start-index from
|
||||
:end-index to)))
|
||||
(loop for match in matches do
|
||||
(gui:tag-configure gemtext-widget
|
||||
(gui:match-tag-name match)
|
||||
:font (client-configuration:font-text-bold))
|
||||
(gui:tag-raise gemtext-widget (gui:match-tag-name match))))))
|
||||
|
||||
(defun collect-ir-lines (request-iri main-window lines)
|
||||
(with-accessors ((ir-lines ir-lines)
|
||||
(ir-rendered-lines ir-rendered-lines)
|
||||
@ -636,7 +648,10 @@
|
||||
(:text
|
||||
(vector-push-extend (ir-line line) ir-rendered-lines)
|
||||
(incf render-line-count)
|
||||
(render-line :text (a:last-elt ir-rendered-lines) render-line-count))
|
||||
(render-line :text (a:last-elt ir-rendered-lines) render-line-count)
|
||||
(maybe-re-emphatize-lines gemtext-widget
|
||||
`(:line ,render-line-count :char 0)
|
||||
`(:line ,render-line-count :char :end)))
|
||||
(:h1
|
||||
(push-prefixed (gui-conf:gemini-h1-prefix) line)
|
||||
(incf render-line-count)
|
||||
@ -652,7 +667,10 @@
|
||||
(:li
|
||||
(push-prefixed (gui-conf:gemini-bullet-prefix) line)
|
||||
(incf render-line-count)
|
||||
(render-line :li (a:last-elt ir-rendered-lines) render-line-count))
|
||||
(render-line :li (a:last-elt ir-rendered-lines) render-line-count)
|
||||
(maybe-re-emphatize-lines gemtext-widget
|
||||
`(:line ,render-line-count :char 0)
|
||||
`(:line ,render-line-count :char :end)))
|
||||
(:quote
|
||||
(push-prefixed (gui-conf:gemini-quote-prefix) line)
|
||||
(incf render-line-count)
|
||||
|
@ -3257,6 +3257,9 @@
|
||||
:gemini-default-favicon
|
||||
:gemini-fetch-favicon-p
|
||||
:gemini-text-font-configuration
|
||||
:font-text-underlined
|
||||
:font-text-bold
|
||||
:font-text-italic
|
||||
:gemini-link-font-configuration
|
||||
:gemini-quote-font-configuration
|
||||
:gemini-h1-font-configuration
|
||||
@ -3294,7 +3297,8 @@
|
||||
:config-gemtext-padding
|
||||
:config-keybinding-bookmark-toggle
|
||||
:config-keybinding-bookmark-show
|
||||
:main-window-select-colors))
|
||||
:main-window-select-colors
|
||||
:emphasize-wrapped-asterisk-p))
|
||||
|
||||
(defpackage :client-os-utils
|
||||
(:use
|
||||
|
Loading…
x
Reference in New Issue
Block a user