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)
(info-text info-text)
(gemtext-widget gemtext-widget)) object
(setf tool-bar (make-instance 'tool-bar :master object))
(set-bookmark-button-false object)
(setf toc-frame (make-instance 'toc-frame :master object))
(let* ((gemtext-font (gui-conf:gemini-text-font-configuration))
(padding (client-configuration:config-gemtext-padding))
(padding-pixel (* padding (gui:font-measure gemtext-font "0"))))
(multiple-value-bind (select-bg select-fg)
(gui-conf:main-window-select-colors)
(setf gemtext-widget (make-instance 'gui:scrolled-text
:background (gui-conf:gemini-window-colors)
:selectbackground select-bg
:selectforeground select-fg
:padx padding-pixel
:master object
:read-only t
:font gemtext-font))))
(gui:configure gemtext-widget :wrap :word)
(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))
(gui:configure info-text :font gui:+tk-small-caption-font+)
(setf search-frame (client-search-frame:init-window object))
(gui:grid info-text 0 0 :sticky :news)
(gui-goodies:gui-resize-grid-all info-frame)
(gui:grid tool-bar 0 0 :sticky :new :columnspan 2)
(gui:grid toc-frame 1 0 :sticky :nsw)
(gui:grid gemtext-widget 1 1 :sticky :news)
(gui:grid search-frame 3 0 :sticky :news :columnspan 2)
(gui:grid-forget search-frame)
(gui:grid info-frame 4 0 :sticky :news :columnspan 2)
(gui:grid-columnconfigure object 1 :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))
(let ((paned-frame (make-instance 'gui:paned-window
:orientation :horizontal
:master object)))
(setf tool-bar (make-instance 'tool-bar :master object))
(set-bookmark-button-false object)
(setf toc-frame (make-instance 'toc-frame :master paned-frame))
(let* ((gemtext-font (gui-conf:gemini-text-font-configuration))
(padding (client-configuration:config-gemtext-padding))
(padding-pixel (* padding (gui:font-measure gemtext-font "0"))))
(multiple-value-bind (select-bg select-fg)
(gui-conf:main-window-select-colors)
(setf gemtext-widget (make-instance 'gui:scrolled-text
:background (gui-conf:gemini-window-colors)
:selectbackground select-bg
:selectforeground select-fg
:padx padding-pixel
:master paned-frame
:read-only t
:font gemtext-font)))
(gui:configure gemtext-widget :wrap :word))
(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))
(gui:configure info-text :font gui:+tk-small-caption-font+)
(setf search-frame (client-search-frame:init-window object))
(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 paned-frame toc-frame)
(gui:add-pane paned-frame gemtext-widget)
(gui:grid paned-frame 1 0 :sticky :news)
(gui:grid search-frame 2 0 :sticky :news)
(gui:grid-forget search-frame)
(gui:grid info-frame 3 0 :sticky :ews)
(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))

View File

@ -68,7 +68,7 @@
(defun show-search-frame-clsr (main-window)
(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)))))
(defun show-tour ()