mirror of https://codeberg.org/cage/tinmop/
- [GUI] started with configurable keybindings.
This commit is contained in:
parent
bc73e29efd
commit
211176ad8a
|
@ -171,3 +171,9 @@ toc.weight = bold
|
|||
toc.slant = roman
|
||||
|
||||
toc.underline = yes
|
||||
|
||||
# Keybinding
|
||||
|
||||
keybinding.quit = "Control-q"
|
||||
|
||||
keybinding.search = "Control-f"
|
|
@ -1,5 +1,5 @@
|
|||
;; tinmop: an humble gemini and pleroma client
|
||||
;; Copyright (C) 2022 cage
|
||||
;; Copyright © cage
|
||||
|
||||
;; This program is free software: you can redistribute it and/or modify
|
||||
;; it under the terms of the GNU General Public License as published by
|
||||
|
@ -30,7 +30,9 @@
|
|||
slant
|
||||
underline
|
||||
preformatted-text
|
||||
justification)
|
||||
justification
|
||||
keybinding
|
||||
quit)
|
||||
|
||||
(defun load-config-file (&optional (virtual-filepath +client-conf-filename+)
|
||||
(perform-missing-value-check nil))
|
||||
|
@ -244,3 +246,9 @@
|
|||
(not (swconf:false-value-p (access:accesses *client-configuration*
|
||||
swconf:+key-toc+
|
||||
+key-underline+)))))
|
||||
(defun get-keybinding (key)
|
||||
(strcat "<"
|
||||
(access:accesses *client-configuration*
|
||||
+key-keybinding+
|
||||
key)
|
||||
">"))
|
||||
|
|
|
@ -212,9 +212,14 @@
|
|||
(help (gui:make-menu bar (_ "Help") :underline 0)))
|
||||
(gui:make-menubutton tools (_ "Certificates") #'menu:show-certificates :underline 0)
|
||||
(gui:make-menubutton tools (_ "Streams") #'menu:show-streams :underline 0)
|
||||
(gui:make-menubutton tools (_ "Search") (menu:show-search-frame-clsr main-window)
|
||||
:underline 1)
|
||||
(gui:make-menubutton file (_ "Quit") #'menu:quit :underline 0)
|
||||
(gui:make-menubutton tools
|
||||
(_ "Search")
|
||||
(menu:show-search-frame-clsr main-window)
|
||||
:accelerator (client-configuration:get-keybinding :search))
|
||||
(gui:make-menubutton file
|
||||
(_ "Quit")
|
||||
#'menu:quit
|
||||
:accelerator (client-configuration:get-keybinding :quit))
|
||||
(gui:make-menubutton help (_ "About") #'menu:help-about :underline 0)
|
||||
(gui:make-menubutton bookmarks
|
||||
(_ "Show")
|
||||
|
@ -1216,6 +1221,19 @@
|
|||
(defun get-address-bar-text (main-window)
|
||||
(trim-blanks (gui:text (iri-entry (tool-bar main-window)))))
|
||||
|
||||
(defun initialize-keybindings (main-window)
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :quit)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(menu:quit)))
|
||||
(gui:bind (gui:root-toplevel)
|
||||
(client-configuration:get-keybinding :search)
|
||||
(lambda (e)
|
||||
(declare (ignore e))
|
||||
(funcall (menu:show-search-frame-clsr main-window)))
|
||||
:append t))
|
||||
|
||||
(defun init-main-window ()
|
||||
(let ((gui:*debug-tk* nil))
|
||||
(gui:with-nodgui (:title +program-name+)
|
||||
|
@ -1227,4 +1245,5 @@
|
|||
(setf gui-goodies:*main-frame* main-frame)
|
||||
(initialize-menu gui:*tk* main-frame)
|
||||
(gui:grid main-frame 0 0 :sticky :nswe)
|
||||
(initialize-keybindings main-frame)
|
||||
(gui-goodies:gui-resize-grid-all gui-goodies:*toplevel*)))))
|
||||
|
|
|
@ -3286,7 +3286,8 @@
|
|||
:gemini-preformatted-text-justification
|
||||
:config-toc-maximum-width
|
||||
:config-toc-minimum-width
|
||||
:toc-font-configuration))
|
||||
:toc-font-configuration
|
||||
:get-keybinding))
|
||||
|
||||
(defpackage :client-os-utils
|
||||
(:use
|
||||
|
|
Loading…
Reference in New Issue