Skip to content

Commit

Permalink
prompt-buffer: Improve next and previous source buttons.
Browse files Browse the repository at this point in the history
Change next and previous source glyphs, mute the color when there is no
next or previous source and show keybinding on hover.
  • Loading branch information
hgluka committed Oct 10, 2023
1 parent 8edcc49 commit 99a1719
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
3 changes: 3 additions & 0 deletions assets/glyphs/down.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions assets/glyphs/up.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 10 additions & 4 deletions source/prompt-buffer.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ See `nyxt::attribute-widths'.")
:opacity 0.6)
`((:and .button (:or :visited :active))
:color ,theme:background)
`(".button.inactive svg path"
:stroke ,theme:secondary-)
`("#input"
:height "28px"
:margin-top "0"
Expand Down Expand Up @@ -510,13 +512,17 @@ This does not redraw the whole prompt buffer, use `prompt-render' for that."
"display:none;"
"display:revert")
(:nbutton
:text ""
:title "Next source"
:class (unless (prompter:adjacent-source prompt-buffer :source source) "inactive")
:text (:raw (gethash "down.svg" *static-data*))
:title (format nil "Next source (~a)" (binding-keys (sym:resolve-symbol :next-source :command)
:modes (modes prompt-buffer)))
:buffer prompt-buffer
'(funcall (sym:resolve-symbol :next-source :command)))
(:nbutton
:text ""
:title "Previous source"
:class (unless (prompter:adjacent-source prompt-buffer :steps -1 :source source) "inactive")
:text (:raw (gethash "up.svg" *static-data*))
:title (format nil "Previous source (~a)" (binding-keys (sym:resolve-symbol :previous-source :command)
:modes (modes prompt-buffer)))
:buffer prompt-buffer
'(funcall (sym:resolve-symbol :previous-source :command)))
(:nbutton
Expand Down

0 comments on commit 99a1719

Please sign in to comment.