From 215e4700ecb8d31ae3135c4e2ae4580ae9331ae2 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Tue, 23 Jan 2024 23:00:33 +0200 Subject: [PATCH 1/8] Move panel-buffer class. --- nyxt.asd | 2 +- source/buffer.lisp | 145 --------------------------------------------- source/panel.lisp | 145 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 146 insertions(+), 146 deletions(-) diff --git a/nyxt.asd b/nyxt.asd index adb89fbb149..3bb3d2b4713 100644 --- a/nyxt.asd +++ b/nyxt.asd @@ -122,8 +122,8 @@ (:file "inspector") (:file "dom") (:file "buffer") - (:file "window") (:file "panel") + (:file "window") (:file "mode") (:file "history") (:file "auto-rules") diff --git a/source/buffer.lisp b/source/buffer.lisp index 551c8c49a05..73bff7fa022 100644 --- a/source/buffer.lisp +++ b/source/buffer.lisp @@ -796,151 +796,6 @@ store them somewhere and `ffi-buffer-delete' them once done.")) (:metaclass user-class) (:documentation "Like `web-buffer', but don't persist data to disk.")) -(define-class panel-buffer (input-buffer modable-buffer document-buffer network-buffer) - ((width 256 :documentation "The width in pixels.") - (style (theme:themed-css (theme *browser*) - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Regular.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Italic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Thin.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ThinItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLight.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLightItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Light.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-LightItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Medium.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-MediumItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Bold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Black.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BlackItalic.woff") "format('woff')") - `(:font-face :font-family "dejavu sans mono" :src ,(format nil "url('nyxt-resource:~a')" "DejaVuSansMono.ttf") "format('ttf')") - `(body - :background-color ,theme:background-alt - :color ,theme:on-background-alt - :font-family ,theme:font-family - :margin "0" - :padding "10px" - :padding-top "24px" - :border-style "solid" - :border-width "0px 1px" - :border-color ,theme:secondary) - `("h1,h2,h3,h4,h5,h6" - :font-family ,theme:font-family - :font-weight 500) - `(a - :color ,theme:primary) - `("details summary" - :margin-left "inherit" - :margin-bottom "8px" - :cursor "pointer") - `("summary::-webkit-details-marker" - :padding-bottom "4px") - '("details > summary" - :list-style-type "none") - '("details > summary::-webkit-details-marker" - :display "none") - '("details > summary::before" - :font-weight "bold" - :content "+" - :margin-right "5px" - :display "inline-block") - '("details[open] > summary::before" - :content "−") - `(pre - :font-family ,theme:monospace-font-family - :font-size "0.9rem") - `(code - :font-family ,theme:monospace-font-family - :font-size "0.9rem") - `(dt - :font-weight bold) - `(dd - :margin-inline-start 1em - :font-size xx-small) - `((:and a :hover) - :cursor "pointer" - :text-decoration "underline") - `((:and a :active) - :opacity 0.6) - `("#close" - :position "fixed" - :top "4px" - :right "4px" - :line-height "12px") - `(button - :background "transparent" - :max-width "100%" - :color "inherit" - :border "none" - :padding 0 - :font "inherit" - :outline "inherit") - `(.button - :background-color ,theme:primary - :color ,theme:on-primary - :display "inline-block" - :text-decoration "none" - :border-radius "2px" - :padding "6px" - :margin "2px") - `(.action - :color ,theme:action) - `(.button.action - :background-color ,theme:action - :color ,theme:on-action - :border-color ,theme:action+) - `(.warning - :color ,theme:warning) - `(.button.warning - :background-color ,theme:warning - :color ,theme:on-warning - :border-color ,theme:warning+) - `(.success - :color ,theme:success) - `(.button.success - :background-color ,theme:success - :color ,theme:on-success - :border-color ,theme:success+) - `(.highlight - :color ,theme:highlight) - `(.button.highlight - :background-color ,theme:highlight - :color ,theme:on-highlight - :border-color ,theme:highlight+) - `((:and .button :hover) - :cursor "pointer" - :opacity 0.8) - `((:and .button (:or :visited :active)) - :color ,theme:background) - `("a:visited" - :color ,theme:secondary) - `(".progress-bar-container" - :border-radius "3px" - :height "20px" - :width "100%") - `(".progress-bar-base" - :border-radius "3px" - :background-color ,theme:secondary - :height "100%") - `(".progress-bar-fill" - :border-radius "3px" - :background-color ,theme:primary - :height "100%")))) - (:export-class-name-p t) - (:export-accessor-names-p t) - (:export-predicate-name-p t) - (:metaclass user-class) - (:documentation "Panel buffer (also known as sidebar): small view on the side of the screen. - -Panels (pages openable in panel buffer with respective commands) are defined -with `define-panel-command' and `define-panel-command-global'. - -Also see `panel-page'.")) - (define-class status-buffer (input-buffer) ((window nil diff --git a/source/panel.lisp b/source/panel.lisp index 8ea666eb961..b6c8772e82e 100644 --- a/source/panel.lisp +++ b/source/panel.lisp @@ -3,6 +3,151 @@ (in-package :nyxt) +(define-class panel-buffer (input-buffer modable-buffer document-buffer network-buffer) + ((width 256 :documentation "The width in pixels.") + (style (theme:themed-css (theme *browser*) + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Regular.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Italic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Thin.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ThinItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLight.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLightItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Light.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-LightItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Medium.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-MediumItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Bold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Black.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BlackItalic.woff") "format('woff')") + `(:font-face :font-family "dejavu sans mono" :src ,(format nil "url('nyxt-resource:~a')" "DejaVuSansMono.ttf") "format('ttf')") + `(body + :background-color ,theme:background-alt + :color ,theme:on-background-alt + :font-family ,theme:font-family + :margin "0" + :padding "10px" + :padding-top "24px" + :border-style "solid" + :border-width "0px 1px" + :border-color ,theme:secondary) + `("h1,h2,h3,h4,h5,h6" + :font-family ,theme:font-family + :font-weight 500) + `(a + :color ,theme:primary) + `("details summary" + :margin-left "inherit" + :margin-bottom "8px" + :cursor "pointer") + `("summary::-webkit-details-marker" + :padding-bottom "4px") + '("details > summary" + :list-style-type "none") + '("details > summary::-webkit-details-marker" + :display "none") + '("details > summary::before" + :font-weight "bold" + :content "+" + :margin-right "5px" + :display "inline-block") + '("details[open] > summary::before" + :content "−") + `(pre + :font-family ,theme:monospace-font-family + :font-size "0.9rem") + `(code + :font-family ,theme:monospace-font-family + :font-size "0.9rem") + `(dt + :font-weight bold) + `(dd + :margin-inline-start 1em + :font-size xx-small) + `((:and a :hover) + :cursor "pointer" + :text-decoration "underline") + `((:and a :active) + :opacity 0.6) + `("#close" + :position "fixed" + :top "4px" + :right "4px" + :line-height "12px") + `(button + :background "transparent" + :max-width "100%" + :color "inherit" + :border "none" + :padding 0 + :font "inherit" + :outline "inherit") + `(.button + :background-color ,theme:primary + :color ,theme:on-primary + :display "inline-block" + :text-decoration "none" + :border-radius "2px" + :padding "6px" + :margin "2px") + `(.action + :color ,theme:action) + `(.button.action + :background-color ,theme:action + :color ,theme:on-action + :border-color ,theme:action+) + `(.warning + :color ,theme:warning) + `(.button.warning + :background-color ,theme:warning + :color ,theme:on-warning + :border-color ,theme:warning+) + `(.success + :color ,theme:success) + `(.button.success + :background-color ,theme:success + :color ,theme:on-success + :border-color ,theme:success+) + `(.highlight + :color ,theme:highlight) + `(.button.highlight + :background-color ,theme:highlight + :color ,theme:on-highlight + :border-color ,theme:highlight+) + `((:and .button :hover) + :cursor "pointer" + :opacity 0.8) + `((:and .button (:or :visited :active)) + :color ,theme:background) + `("a:visited" + :color ,theme:secondary) + `(".progress-bar-container" + :border-radius "3px" + :height "20px" + :width "100%") + `(".progress-bar-base" + :border-radius "3px" + :background-color ,theme:secondary + :height "100%") + `(".progress-bar-fill" + :border-radius "3px" + :background-color ,theme:primary + :height "100%")))) + (:export-class-name-p t) + (:export-accessor-names-p t) + (:export-predicate-name-p t) + (:metaclass user-class) + (:documentation "Panel buffer (also known as sidebar): small view on the side of the screen. + +Panels (pages openable in panel buffer with respective commands) are defined +with `define-panel-command' and `define-panel-command-global'. + +Also see `panel-page'.")) + ;; TODO: Quite some code could be factored with `internal-page'. (define-class panel-buffer-source (prompter:source) From ece6eefdff553644490d3aacdd9b3b2c75b887e4 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Wed, 24 Jan 2024 09:40:29 +0200 Subject: [PATCH 2/8] panel: Minor fixes. --- source/panel.lisp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/source/panel.lisp b/source/panel.lisp index b6c8772e82e..335683d61dc 100644 --- a/source/panel.lisp +++ b/source/panel.lisp @@ -4,7 +4,9 @@ (in-package :nyxt) (define-class panel-buffer (input-buffer modable-buffer document-buffer network-buffer) - ((width 256 :documentation "The width in pixels.") + ((width + 256 + :documentation "The width in pixels.") (style (theme:themed-css (theme *browser*) `(:font-face :font-family "public sans" :font-style "normal" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Regular.woff") "format('woff')") `(:font-face :font-family "public sans" :font-style "italic" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Italic.woff") "format('woff')") @@ -148,15 +150,12 @@ with `define-panel-command' and `define-panel-command-global'. Also see `panel-page'.")) -;; TODO: Quite some code could be factored with `internal-page'. - (define-class panel-buffer-source (prompter:source) ((prompter:name "Panel buffers") - (window :accessor window :initarg :window) + (window nil) (prompter:filter-preprocessor #'prompter:filter-exact-matches) (prompter:enable-marks-p t) - (prompter:constructor (lambda (source) - (panel-buffers (window source)))))) + (prompter:constructor (lambda (source) (panel-buffers (window source)))))) (define-command-global delete-panel-buffer (&key (window (current-window)) (panels (prompt @@ -207,7 +206,6 @@ panel.")) :buffer (make-instance 'panel-buffer)) (side ,page)))))))) -;; FIXME: Better way to compose HTML wrappers? (defmethod (setf form) :after (lambda-expression (page panel-page)) (declare (ignore lambda-expression)) (let ((original-form (slot-value page 'form))) @@ -232,8 +230,6 @@ panel.")) "×"))))) (values contents type status headers reason)))))) -;; TODO: Add define-panel? - (export-always 'define-panel-command) (defmacro define-panel-command (name (&rest arglist) (buffer-var title &optional (side :left)) From faf01306f541b1191425c5e139fc8751e67ed257 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Tue, 23 Jan 2024 23:01:21 +0200 Subject: [PATCH 3/8] Move status-buffer. --- source/buffer.lisp | 174 --------------------------------------------- source/status.lisp | 174 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+), 174 deletions(-) diff --git a/source/buffer.lisp b/source/buffer.lisp index 73bff7fa022..ccf1b2aa6ed 100644 --- a/source/buffer.lisp +++ b/source/buffer.lisp @@ -796,180 +796,6 @@ store them somewhere and `ffi-buffer-delete' them once done.")) (:metaclass user-class) (:documentation "Like `web-buffer', but don't persist data to disk.")) -(define-class status-buffer (input-buffer) - ((window - nil - :type (maybe window) - :documentation "The `window' to which the status buffer is attached.") - (height - 24 - :type integer - :writer nil - :reader height - :export t - :documentation "The height of the status buffer in pixels.") - (glyph-mode-presentation-p - nil - :documentation "Display the modes as a list of glyphs.") - (display-tabs-by-last-access-p - nil - :documentation "Whether tabs are dynamically ordered by last access time.") - (glyph-left (gethash "left.svg" *static-data*)) - (glyph-right (gethash "right.svg" *static-data*)) - (glyph-reload (gethash "reload.svg" *static-data*)) - (glyph-lambda (gethash "lambda.svg" *static-data*)) - (style (theme:themed-css (theme *browser*) - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Regular.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Italic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Thin.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ThinItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLight.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLightItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Light.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-LightItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Medium.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-MediumItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Bold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Black.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BlackItalic.woff") "format('woff')") - `(:font-face :font-family "dejavu sans mono" :src ,(format nil "url('nyxt-resource:~a')" "DejaVuSansMono.ttf") "format('ttf')") - `(body - :font-family ,theme:font-family - :line-height "100vh" - :font-size "14px" - :padding 0 - :margin 0) - `(.loader - :border-width "2px" - :border-style "solid" - :border-color "transparent" - :border-top-color ,theme:action - :border-left-color ,theme:action - :border-radius "50%" - :display "inline-block" - :width "7px" - :height "7px" - :animation "spin 1s linear infinite") - `("@keyframes spin" - ("0%" :transform "rotate(0deg)") - ("100%" :transform "rotate(360deg)")) - `(".arrow-right" - :clip-path "polygon(0 0, calc(100% - 7px) 0, 100% calc(50% - 1px), 100% 50%, 100% calc(50% + 1px), calc(100% - 7px) 100%, 0 100%)" - :margin-right "-7px") - `(".arrow-left" - :clip-path "polygon(7px 0, 100% 0, 100% 100%, 7px 100%, 0px calc(50% + 1px), 0% 50%, 0px calc(50% - 1px))" - :margin-left "-7px") - `("#container" - :display "flex" - :justify-content "space-between" - :overflow-y "hidden") - `("#controls" - :background-color ,theme:secondary - :color ,theme:on-secondary - :overflow "hidden" - :white-space "nowrap" - :z-index "3" - :flex-basis "78px" - :display "flex") - `("#controls > button" - :margin-right "-3px" - :max-width "20px" - :height "100%" - :aspect-ratio "1/1") - `("#url" - :background-color ,theme:primary - :color ,theme:on-primary - :font-size "60vh" - :min-width "100px" - :text-overflow "ellipsis" - :overflow-x "hidden" - :white-space "nowrap" - :padding-right "7px" - :padding-left "15px" - :z-index "2" - :flex-grow "3" - :flex-shrink "2" - :flex-basis "144px") - `("#url button" - :text-align "left" - :width "100%") - `("#tabs" - :background-color ,theme:secondary - :color ,theme:on-secondary - :line-height "95vh" - :font-size "60vh" - :min-width "100px" - :white-space "nowrap" - :overflow-x "scroll" - :text-align "left" - :padding-left "3px" - :padding-right "20px" - :z-index "1" - :flex-grow "10" - :flex-shrink "4" - :flex-basis "144px") - `("#tabs::-webkit-scrollbar" - :display "none") - `(".tab" - :background-color ,theme:background- - :color ,theme:on-background - :display "inline-block" - :margin-top "1px" - :padding-left "18px" - :padding-right "18px" - :margin-right "-1px" - :margin-left "-4px" - :text-decoration "transparent" - :border "transparent" - :border-radius "1px" - :font "inherit" - :outline "inherit" - :clip-path "polygon(calc(100% - 7px) 0, 100% calc(50% - 1px), 100% 50%, 100% calc(50% + 1px), calc(100% - 7px) 100%, 0% 100%, 7px calc(50% + 1px), 7px 50%, 7px calc(50% - 1px), 0% 0%)") - `("#modes" - :background-color ,theme:primary - :color ,theme:on-primary - :font-size "60vh" - :text-align "right" - :padding-left "7px" - :padding-right "5px" - :overflow-x "scroll" - :white-space "nowrap" - :z-index "2") - `("#modes::-webkit-scrollbar" - :display "none") - `(button - :background "transparent" - :color "inherit" - :text-decoration "transparent" - :border "transparent" - :border-radius "0.2em" - :padding 0 - :font "inherit" - :outline "inherit") - `((:and (:or .button .tab "#url") :hover) - :cursor "pointer" - :background-color ,theme:action - :color ,theme:on-action) - `((:and (:or .button .tab) :active) - :background-color ,theme:action- - :color ,theme:on-action) - `(.selected-tab - :background-color ,theme:background+ - :color ,theme:on-background)))) - (:export-class-name-p t) - (:export-accessor-names-p t) - (:export-predicate-name-p t) - (:metaclass user-class)) - -(defmethod (setf height) (value (status-buffer status-buffer)) - (setf (ffi-height status-buffer) value) - (setf (slot-value status-buffer 'height) value)) - (define-class message-buffer (input-buffer) ((window nil diff --git a/source/status.lisp b/source/status.lisp index 0844ac07f2f..1e7f064c54b 100644 --- a/source/status.lisp +++ b/source/status.lisp @@ -3,6 +3,180 @@ (in-package :nyxt) +(define-class status-buffer (input-buffer) + ((window + nil + :type (maybe window) + :documentation "The `window' to which the status buffer is attached.") + (height + 24 + :type integer + :writer nil + :reader height + :export t + :documentation "The height of the status buffer in pixels.") + (glyph-mode-presentation-p + nil + :documentation "Display the modes as a list of glyphs.") + (display-tabs-by-last-access-p + nil + :documentation "Whether tabs are dynamically ordered by last access time.") + (glyph-left (gethash "left.svg" *static-data*)) + (glyph-right (gethash "right.svg" *static-data*)) + (glyph-reload (gethash "reload.svg" *static-data*)) + (glyph-lambda (gethash "lambda.svg" *static-data*)) + (style (theme:themed-css (theme *browser*) + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Regular.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Italic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Thin.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ThinItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLight.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLightItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Light.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-LightItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Medium.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-MediumItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Bold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Black.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BlackItalic.woff") "format('woff')") + `(:font-face :font-family "dejavu sans mono" :src ,(format nil "url('nyxt-resource:~a')" "DejaVuSansMono.ttf") "format('ttf')") + `(body + :font-family ,theme:font-family + :line-height "100vh" + :font-size "14px" + :padding 0 + :margin 0) + `(.loader + :border-width "2px" + :border-style "solid" + :border-color "transparent" + :border-top-color ,theme:action + :border-left-color ,theme:action + :border-radius "50%" + :display "inline-block" + :width "7px" + :height "7px" + :animation "spin 1s linear infinite") + `("@keyframes spin" + ("0%" :transform "rotate(0deg)") + ("100%" :transform "rotate(360deg)")) + `(".arrow-right" + :clip-path "polygon(0 0, calc(100% - 7px) 0, 100% calc(50% - 1px), 100% 50%, 100% calc(50% + 1px), calc(100% - 7px) 100%, 0 100%)" + :margin-right "-7px") + `(".arrow-left" + :clip-path "polygon(7px 0, 100% 0, 100% 100%, 7px 100%, 0px calc(50% + 1px), 0% 50%, 0px calc(50% - 1px))" + :margin-left "-7px") + `("#container" + :display "flex" + :justify-content "space-between" + :overflow-y "hidden") + `("#controls" + :background-color ,theme:secondary + :color ,theme:on-secondary + :overflow "hidden" + :white-space "nowrap" + :z-index "3" + :flex-basis "78px" + :display "flex") + `("#controls > button" + :margin-right "-3px" + :max-width "20px" + :height "100%" + :aspect-ratio "1/1") + `("#url" + :background-color ,theme:primary + :color ,theme:on-primary + :font-size "60vh" + :min-width "100px" + :text-overflow "ellipsis" + :overflow-x "hidden" + :white-space "nowrap" + :padding-right "7px" + :padding-left "15px" + :z-index "2" + :flex-grow "3" + :flex-shrink "2" + :flex-basis "144px") + `("#url button" + :text-align "left" + :width "100%") + `("#tabs" + :background-color ,theme:secondary + :color ,theme:on-secondary + :line-height "95vh" + :font-size "60vh" + :min-width "100px" + :white-space "nowrap" + :overflow-x "scroll" + :text-align "left" + :padding-left "3px" + :padding-right "20px" + :z-index "1" + :flex-grow "10" + :flex-shrink "4" + :flex-basis "144px") + `("#tabs::-webkit-scrollbar" + :display "none") + `(".tab" + :background-color ,theme:background- + :color ,theme:on-background + :display "inline-block" + :margin-top "1px" + :padding-left "18px" + :padding-right "18px" + :margin-right "-1px" + :margin-left "-4px" + :text-decoration "transparent" + :border "transparent" + :border-radius "1px" + :font "inherit" + :outline "inherit" + :clip-path "polygon(calc(100% - 7px) 0, 100% calc(50% - 1px), 100% 50%, 100% calc(50% + 1px), calc(100% - 7px) 100%, 0% 100%, 7px calc(50% + 1px), 7px 50%, 7px calc(50% - 1px), 0% 0%)") + `("#modes" + :background-color ,theme:primary + :color ,theme:on-primary + :font-size "60vh" + :text-align "right" + :padding-left "7px" + :padding-right "5px" + :overflow-x "scroll" + :white-space "nowrap" + :z-index "2") + `("#modes::-webkit-scrollbar" + :display "none") + `(button + :background "transparent" + :color "inherit" + :text-decoration "transparent" + :border "transparent" + :border-radius "0.2em" + :padding 0 + :font "inherit" + :outline "inherit") + `((:and (:or .button .tab "#url") :hover) + :cursor "pointer" + :background-color ,theme:action + :color ,theme:on-action) + `((:and (:or .button .tab) :active) + :background-color ,theme:action- + :color ,theme:on-action) + `(.selected-tab + :background-color ,theme:background+ + :color ,theme:on-background)))) + (:export-class-name-p t) + (:export-accessor-names-p t) + (:export-predicate-name-p t) + (:metaclass user-class)) + +(defmethod (setf height) (value (status-buffer status-buffer)) + (setf (ffi-height status-buffer) value) + (setf (slot-value status-buffer 'height) value)) + (export-always 'mode-status) (defgeneric mode-status (status mode) (:method ((status status-buffer) (mode mode)) From cbd5a8b03de1331b870126cd36fbafdefc7a90d8 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Tue, 23 Jan 2024 23:01:44 +0200 Subject: [PATCH 4/8] Move message-buffer. --- source/buffer.lisp | 50 --------------------------------------------- source/message.lisp | 50 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/source/buffer.lisp b/source/buffer.lisp index ccf1b2aa6ed..1af4a97362a 100644 --- a/source/buffer.lisp +++ b/source/buffer.lisp @@ -796,56 +796,6 @@ store them somewhere and `ffi-buffer-delete' them once done.")) (:metaclass user-class) (:documentation "Like `web-buffer', but don't persist data to disk.")) -(define-class message-buffer (input-buffer) - ((window - nil - :type (maybe window) - :documentation "The `window' to which the message buffer is attached.") - (height - 16 - :type integer - :writer nil - :reader height - :export t - :documentation "The height of the message buffer in pixels.") - (style (theme:themed-css (theme *browser*) - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Regular.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Italic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Thin.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ThinItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLight.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLightItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Light.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-LightItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Medium.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-MediumItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Bold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBold.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBoldItalic.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "normal" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Black.woff") "format('woff')") - `(:font-face :font-family "public sans" :font-style "italic" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BlackItalic.woff") "format('woff')") - `(:font-face :font-family "dejavu sans mono" :src ,(format nil "url('nyxt-resource:~a')" "DejaVuSansMono.ttf") "format('ttf')") - `(body - :background-color ,theme:background-alt - :color ,theme:on-background-alt - :font-family ,theme:font-family - :font-size "75vh" - :line-height "100vh" - :padding 0 - :padding-left "4px" - :margin 0)))) - (:export-class-name-p t) - (:export-accessor-names-p t) - (:export-predicate-name-p t) - (:metaclass user-class)) - -(defmethod (setf height) (value (message-buffer message-buffer)) - (setf (ffi-height message-buffer) value) - (setf (slot-value message-buffer 'height) value)) - (defmethod customize-instance :after ((buffer buffer) &key (browser *browser*) no-hook-p diff --git a/source/message.lisp b/source/message.lisp index 2cd55121fd5..ead146aa409 100644 --- a/source/message.lisp +++ b/source/message.lisp @@ -3,6 +3,56 @@ (in-package :nyxt) +(define-class message-buffer (input-buffer) + ((window + nil + :type (maybe window) + :documentation "The `window' to which the message buffer is attached.") + (height + 16 + :type integer + :writer nil + :reader height + :export t + :documentation "The height of the message buffer in pixels.") + (style (theme:themed-css (theme *browser*) + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Regular.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "400" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Italic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Thin.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "100" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ThinItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLight.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "200" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraLightItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Light.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "300" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-LightItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Medium.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "500" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-MediumItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "600" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-SemiBoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Bold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "700" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBold.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "800" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-ExtraBoldItalic.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "normal" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-Black.woff") "format('woff')") + `(:font-face :font-family "public sans" :font-style "italic" :font-weight "900" :src ,(format nil "url('nyxt-resource:~a')" "PublicSans-BlackItalic.woff") "format('woff')") + `(:font-face :font-family "dejavu sans mono" :src ,(format nil "url('nyxt-resource:~a')" "DejaVuSansMono.ttf") "format('ttf')") + `(body + :background-color ,theme:background-alt + :color ,theme:on-background-alt + :font-family ,theme:font-family + :font-size "75vh" + :line-height "100vh" + :padding 0 + :padding-left "4px" + :margin 0)))) + (:export-class-name-p t) + (:export-accessor-names-p t) + (:export-predicate-name-p t) + (:metaclass user-class)) + +(defmethod (setf height) (value (message-buffer message-buffer)) + (setf (ffi-height message-buffer) value) + (setf (slot-value message-buffer 'height) value)) + (defclass messages-appender (log4cl-impl:appender) ()) (defmethod log4cl-impl:appender-do-append ((appender messages-appender) logger level log-func) From 33d655c2bb42b61089184fefae69ca9fb6adab80 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Tue, 23 Jan 2024 23:11:15 +0200 Subject: [PATCH 5/8] Refactor logic behind status buffer placement. --- source/renderer/gtk.lisp | 4 ++-- source/status.lisp | 4 ++++ source/window.lisp | 4 ---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/renderer/gtk.lisp b/source/renderer/gtk.lisp index a5e50600a7c..d77a3165a75 100644 --- a/source/renderer/gtk.lisp +++ b/source/renderer/gtk.lisp @@ -480,7 +480,7 @@ response. The BODY is wrapped with `with-protect'." ;; receive input, for instance to create a new buffer. (setf nyxt::active-buffer (make-instance 'input-buffer)) - (when (eq (status-buffer-position window) :top) + (when (eq (placement status-buffer) :top) (gtk:gtk-box-pack-start root-box-layout status-container :expand nil)) ;; Add the views to the box layout and to the window @@ -496,7 +496,7 @@ response. The BODY is wrapped with `with-protect'." (setf (gtk:gtk-widget-size-request message-container) (list -1 (height message-buffer))) - (when (eq (status-buffer-position window) :bottom) + (when (eq (placement status-buffer) :bottom) (gtk:gtk-box-pack-end root-box-layout status-container :expand nil)) (gtk:gtk-box-pack-start status-container (gtk-object status-buffer) :expand t) diff --git a/source/status.lisp b/source/status.lisp index 1e7f064c54b..8fb257613d1 100644 --- a/source/status.lisp +++ b/source/status.lisp @@ -15,6 +15,10 @@ :reader height :export t :documentation "The height of the status buffer in pixels.") + (placement + :bottom + :type (member :top :bottom) + :documentation "The position of the status buffer in the corresponding `window'.") (glyph-mode-presentation-p nil :documentation "Display the modes as a list of glyphs.") diff --git a/source/window.lisp b/source/window.lisp index d880f8a0077..891c7fc0d14 100644 --- a/source/window.lisp +++ b/source/window.lisp @@ -66,10 +66,6 @@ The channel is popped when a prompt buffer is hidden.") To modify the status buffer appearance and behavior, subclass it and specialize the generic functions on `status-buffer'. Finally set the `window' `status-buffer' slot to an instance of this subclass.") - (status-buffer-position - :bottom - :type (member :top :bottom) - :documentation "The position where to place the status buffer in the GTK window.") (message-buffer (make-instance 'message-buffer) :type message-buffer From 75100a24528346bf7f5c5269f6bbda70b7ccf2d9 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Wed, 24 Jan 2024 10:04:03 +0200 Subject: [PATCH 6/8] Deprecate prompt-buffer-open-height. --- source/prompt-buffer.lisp | 5 +++-- source/window.lisp | 14 -------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/source/prompt-buffer.lisp b/source/prompt-buffer.lisp index 52bf969eca9..c87bbef75c6 100644 --- a/source/prompt-buffer.lisp +++ b/source/prompt-buffer.lisp @@ -18,7 +18,7 @@ :export t :documentation "The height occupied by the prompt buffer. The options are: -- `:default', which sets it to the value of `prompt-buffer-open-height'; +- `:default', which sets it to a third of the window's height; - `:fit-to-prompt', which shrinks the height to fit the input area; - an integer, which corresponds to the height in pixels.") (prompter:history (prompt-buffer-generic-history *browser*) @@ -279,7 +279,8 @@ See `prompt' for how to invoke prompts.") (setf (ffi-height prompt-buffer) (case value (:default - (prompt-buffer-open-height (window prompt-buffer))) + (round (/ (ffi-height (window prompt-buffer)) + 3))) (:fit-to-prompt (ps-eval :buffer prompt-buffer (+ (ps:chain (nyxt/ps:qs document "#prompt-area") offset-height) diff --git a/source/window.lisp b/source/window.lisp index 891c7fc0d14..1c276817cd3 100644 --- a/source/window.lisp +++ b/source/window.lisp @@ -70,14 +70,6 @@ the generic functions on `status-buffer'. Finally set the `window' (make-instance 'message-buffer) :type message-buffer :documentation "The `message-buffer' instance for this window.") - (prompt-buffer-open-height - ;; Ensures that 10 suggestions are vertically shown, while the last entry - ;; appears truncated thus making it clear that more follow. It's also set - ;; exactly to a third of Nyxt window height. - :unbound - :reader nil - :writer t - :documentation "The height of the prompt buffer when open.") (input-dispatcher 'dispatch-input-event :type (or sym:function-symbol function) @@ -119,12 +111,6 @@ The handlers take the window as argument.")) (setf (slot-value browser 'last-active-window) window)) window) -(defmethod prompt-buffer-open-height ((window window)) - (if (slot-boundp window 'prompt-buffer-open-height) - (slot-value window 'prompt-buffer-open-height) - (setf (slot-value window 'prompt-buffer-open-height) - (round (/ (ffi-height window) 3))))) - (defmethod print-object ((window window) stream) (print-unreadable-object (window stream :type t :identity t) (format stream "~a" (id window)))) From 7a4d6b891cb62f897faa3206fb0ff0b98931bd90 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Wed, 24 Jan 2024 10:53:55 +0200 Subject: [PATCH 7/8] changelog: Mention deprecated slots. --- source/changelog.lisp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/changelog.lisp b/source/changelog.lisp index 74b6adce4e8..d7993651128 100644 --- a/source/changelog.lisp +++ b/source/changelog.lisp @@ -345,8 +345,8 @@ auto-configuration (which probably wouldn't work anyways).") (:li "Prompt buffer updated for intuitive matching with new algorithms and settings.") (:li "Revamp status buffer design for increased readability and aesthetics. Make it fully customizable with " (:nxref :function 'format-status) " framework.") - (:li "Status buffer placement can be changed with " - (:nxref :slot 'status-buffer-position :class-name 'window) " (thanks to @mianmoreno)") + (:li "Status buffer placement can be changed with " (:code "status-buffer-position") + " (thanks to @mianmoreno)") (:li "Most help pages, including " (:a :href (nyxt-url 'manual) "the manual") " are more readable and interactive.") (:li "Add support for the Gopher and Gemini protocols.") @@ -995,6 +995,10 @@ allows access to common functions that are defined within the mode.")))) (define-version "4.0.0" (:ul + (:li "Deprecate slot " (:code "status-buffer-position") "in favour of" + (:nxref :slot 'placement :class-name 'status-buffer) ".") + (:li "Deprecate slot " (:code "prompt-buffer-open-height") " since " + (:nxref :slot 'height :class-name 'prompt-buffer) "suffices.") (:li "Add slot " (:nxref :slot 'nyxt/mode/hint:x-placement :class-name 'nyxt/mode/hint:hint-mode) " to draw hints on the right of the hinted element. By default, they From 204b3c4a02b3e2378494d4a22b4523b233c83126 Mon Sep 17 00:00:00 2001 From: "Andre A. Gomes" Date: Wed, 24 Jan 2024 10:54:14 +0200 Subject: [PATCH 8/8] migration: Mention deprecated slots. --- source/migration.lisp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/migration.lisp b/source/migration.lisp index a0f77c9cdae..66abfc658f2 100644 --- a/source/migration.lisp +++ b/source/migration.lisp @@ -117,6 +117,12 @@ major versions." result))))) (define-migration "4" + (prompt-buffer-open-height) + (:p "Deprecated since " (:nxref :slot 'height :class-name 'prompt-buffer) " suffices.") + + (status-buffer-position) + (:p "Deprecated in favor of " (:nxref :slot 'placement :class-name 'status-buffer) ".") + (hints-offset-x) (:p "Deprecated in favor of " (:nxref :slot 'nyxt/mode/hint:x-translation :class-name 'nyxt/mode/hint:hint-mode) ".")