From eb53afcbe142b9d7f153fbeddbf1e0280eb59a61 Mon Sep 17 00:00:00 2001 From: cage Date: Sat, 5 Mar 2022 10:32:13 +0100 Subject: [PATCH] - added slot 'modalp' to class wrapper-window. --- etc/init.lisp | 2 ++ src/open-message-link-window.lisp | 12 ++++-------- src/package.lisp | 3 +++ src/ui-goodies.lisp | 7 +++++++ src/windows.lisp | 7 ++++++- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/etc/init.lisp b/etc/init.lisp index 587960d..30cd5a6 100644 --- a/etc/init.lisp +++ b/etc/init.lisp @@ -142,6 +142,8 @@ (define-key "C-q" #'quit) ; here we are calling the custom ; function defined above +(define-key "C-I" #'pass-focus-clockwise) + (define-key "C-a" #'show-about-window) (define-key "C d" #'clear-cache) diff --git a/src/open-message-link-window.lisp b/src/open-message-link-window.lisp index 0296d7c..066816b 100644 --- a/src/open-message-link-window.lisp +++ b/src/open-message-link-window.lisp @@ -16,17 +16,13 @@ (in-package :open-message-link-window) -(defclass open-message-link-window (open-attach-window:open-attach-window) - ((center-position - :initform nil - :initarg :center-position - :reader center-position-p - :writer (setf center-position)))) + +(defclass open-message-link-window (open-attach-window:open-attach-window) ()) (defmethod refresh-config :after ((object open-message-link-window)) (open-attach-window:refresh-view-links-window-config object swconf:+key-open-message-link-window+ - :center-position (center-position-p object))) + :center-position (modalp object))) (defmethod resync-rows-db ((object open-message-link-window) &key (redraw t) @@ -114,7 +110,7 @@ (defmethod refresh-config :after ((object open-gemini-document-link-window)) (open-attach-window:refresh-view-links-window-config object swconf:+key-open-message-link-window+ - :center-position (center-position-p object))) + :center-position (modalp object))) (defmethod resync-rows-db ((object open-gemini-document-link-window) &key diff --git a/src/package.lisp b/src/package.lisp index 1283c24..9860dc5 100644 --- a/src/package.lisp +++ b/src/package.lisp @@ -1746,6 +1746,8 @@ :refresh-config-color-map :wrapper-window :croatoan-window + :modalp + :modal :with-croatoan-window :+min-shown-win-height+ :+min-shown-win-width+ @@ -2819,6 +2821,7 @@ :pass-focus-on-right :pass-focus-on-bottom :pass-focus-on-top + :pass-focus-clockwise :ask-input-on-tofu-error :import-gemini-certificate :bookmark-gemini-page diff --git a/src/ui-goodies.lisp b/src/ui-goodies.lisp index 61dff73..1ce48aa 100644 --- a/src/ui-goodies.lisp +++ b/src/ui-goodies.lisp @@ -547,6 +547,13 @@ current has focus" (> (win-x a) (win-x b)))) (pass-focus #'all-adjacent-fn #'intersect-fn #'sort-predicate))))) +(defun pass-focus-clockwise () + "Move focus to next window in clockwise order" + (or (pass-focus-on-right) + (pass-focus-on-bottom) + (pass-focus-on-left) + (pass-focus-on-top))) + (defmacro gen-focus-to-window (function-suffix window-get-focus &key (info-change-focus-message (_ "Focus changed")) diff --git a/src/windows.lisp b/src/windows.lisp index 59c0f02..8b8589d 100644 --- a/src/windows.lisp +++ b/src/windows.lisp @@ -86,7 +86,12 @@ :initform nil :initarg :keybindings :accessor keybindings - :documentation "The keymap associated to this window")) + :documentation "The keymap associated to this window") + (modal + :initform nil + :initarg :modal + :reader modalp + :writer (setf modalp))) (:documentation "This is the parent of all the windows in this program")) (defmethod initialize-instance :after ((object wrapper-window) &key &allow-other-keys)