1
0
Fork 0

- [GUI] allowed resizing the TOC using the mouse (thanks op for the suggestion!).

This commit is contained in:
cage 2023-05-19 21:34:01 +02:00
parent b5418082ba
commit d3defee0ed
2 changed files with 39 additions and 35 deletions

View File

@ -1217,40 +1217,44 @@
(search-frame search-frame) (search-frame search-frame)
(info-text info-text) (info-text info-text)
(gemtext-widget gemtext-widget)) object (gemtext-widget gemtext-widget)) object
(setf tool-bar (make-instance 'tool-bar :master object)) (let ((paned-frame (make-instance 'gui:paned-window
(set-bookmark-button-false object) :orientation :horizontal
(setf toc-frame (make-instance 'toc-frame :master object)) :master object)))
(let* ((gemtext-font (gui-conf:gemini-text-font-configuration)) (setf tool-bar (make-instance 'tool-bar :master object))
(padding (client-configuration:config-gemtext-padding)) (set-bookmark-button-false object)
(padding-pixel (* padding (gui:font-measure gemtext-font "0")))) (setf toc-frame (make-instance 'toc-frame :master paned-frame))
(multiple-value-bind (select-bg select-fg) (let* ((gemtext-font (gui-conf:gemini-text-font-configuration))
(gui-conf:main-window-select-colors) (padding (client-configuration:config-gemtext-padding))
(setf gemtext-widget (make-instance 'gui:scrolled-text (padding-pixel (* padding (gui:font-measure gemtext-font "0"))))
:background (gui-conf:gemini-window-colors) (multiple-value-bind (select-bg select-fg)
:selectbackground select-bg (gui-conf:main-window-select-colors)
:selectforeground select-fg (setf gemtext-widget (make-instance 'gui:scrolled-text
:padx padding-pixel :background (gui-conf:gemini-window-colors)
:master object :selectbackground select-bg
:read-only t :selectforeground select-fg
:font gemtext-font)))) :padx padding-pixel
(gui:configure gemtext-widget :wrap :word) :master paned-frame
(setf info-frame (make-instance 'gui:frame :master object :relief :sunken :borderwidth 1)) :read-only t
(setf info-text (make-instance 'gui:text :height 2 :wrap :none :master info-frame)) :font gemtext-font)))
(gui:configure info-text :font gui:+tk-small-caption-font+) (gui:configure gemtext-widget :wrap :word))
(setf search-frame (client-search-frame:init-window object)) (setf info-frame (make-instance 'gui:frame :master object :relief :sunken :borderwidth 1))
(gui:grid info-text 0 0 :sticky :news) (setf info-text (make-instance 'gui:text :height 2 :wrap :none :master info-frame))
(gui-goodies:gui-resize-grid-all info-frame) (gui:configure info-text :font gui:+tk-small-caption-font+)
(gui:grid tool-bar 0 0 :sticky :new :columnspan 2) (setf search-frame (client-search-frame:init-window object))
(gui:grid toc-frame 1 0 :sticky :nsw) (gui:grid info-text 0 0 :sticky :news)
(gui:grid gemtext-widget 1 1 :sticky :news) (gui-goodies:gui-resize-grid-all info-frame)
(gui:grid search-frame 3 0 :sticky :news :columnspan 2) (gui:grid tool-bar 0 0 :sticky :news)
(gui:grid-forget search-frame) (gui:add-pane paned-frame toc-frame)
(gui:grid info-frame 4 0 :sticky :news :columnspan 2) (gui:add-pane paned-frame gemtext-widget)
(gui:grid-columnconfigure object 1 :weight 1) (gui:grid paned-frame 1 0 :sticky :news)
(gui:grid-rowconfigure object 1 :weight 1) (gui:grid search-frame 2 0 :sticky :news)
(setup-main-window-events object) (gui:grid-forget search-frame)
(gui:focus (nodgui.mw:autocomplete-entry-widget (iri-entry (tool-bar object)))) (gui:grid info-frame 3 0 :sticky :ews)
object)) (gui:grid-columnconfigure object 0 :weight 1)
(gui:grid-rowconfigure object 1 :weight 1)
(setup-main-window-events object)
(gui:focus (nodgui.mw:autocomplete-entry-widget (iri-entry (tool-bar object))))
object)))
(defgeneric toc-char-width (object)) (defgeneric toc-char-width (object))

View File

@ -68,7 +68,7 @@
(defun show-search-frame-clsr (main-window) (defun show-search-frame-clsr (main-window)
(lambda () (lambda ()
(gui:grid (client-main-window::search-frame main-window) 3 0 :sticky :news :columnspan 2) (gui:grid (client-main-window::search-frame main-window) 2 0 :sticky :news)
(gui:focus (client-search-frame::entry (client-main-window::search-frame main-window))))) (gui:focus (client-search-frame::entry (client-main-window::search-frame main-window)))))
(defun show-tour () (defun show-tour ()