1
0
Fork 0

Replace isearch and auto-revert icons with SVG images

The font awesome fonts don't always work quite right, but SVG images are pretty
good to work with.
This commit is contained in:
Tom Willemsen 2025-01-15 14:14:19 -08:00
parent 835ece1ca9
commit de46dda0bc
3 changed files with 20 additions and 9 deletions

View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-recycle" viewBox="0 0 16 16">
<path d="M9.302 1.256a1.5 1.5 0 0 0-2.604 0l-1.704 2.98a.5.5 0 0 0 .869.497l1.703-2.981a.5.5 0 0 1 .868 0l2.54 4.444-1.256-.337a.5.5 0 1 0-.26.966l2.415.647a.5.5 0 0 0 .613-.353l.647-2.415a.5.5 0 1 0-.966-.259l-.333 1.242zM2.973 7.773l-1.255.337a.5.5 0 1 1-.26-.966l2.416-.647a.5.5 0 0 1 .612.353l.647 2.415a.5.5 0 0 1-.966.259l-.333-1.242-2.545 4.454a.5.5 0 0 0 .434.748H5a.5.5 0 0 1 0 1H1.723A1.5 1.5 0 0 1 .421 12.24zm10.89 1.463a.5.5 0 1 0-.868.496l1.716 3.004a.5.5 0 0 1-.434.748h-5.57l.647-.646a.5.5 0 1 0-.708-.707l-1.5 1.5a.5.5 0 0 0 0 .707l1.5 1.5a.5.5 0 1 0 .708-.707l-.647-.647h5.57a1.5 1.5 0 0 0 1.302-2.244z"/>
</svg>

After

Width:  |  Height:  |  Size: 758 B

3
oni-gui/icons/search.svg Normal file
View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001q.044.06.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1 1 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0"/>
</svg>

After

Width:  |  Height:  |  Size: 315 B

View file

@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org> ;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local ;; Keywords: local
;; Version: 2023.0805.233624 ;; Version: 2025.0115.141118
;; Package-Requires: (oni-ui oni-hydra yoshi-theme diminish) ;; Package-Requires: (oni-ui oni-hydra yoshi-theme diminish)
;; This program is free software; you can redistribute it and/or modify ;; This program is free software; you can redistribute it and/or modify
@ -29,12 +29,19 @@
(require 'hydra) (require 'hydra)
(require 'oni-ui) (require 'oni-ui)
(defconst oni-gui-root
(file-name-directory
(or load-file-name
(buffer-file-name)))
"The directory where oni-gui was loaded from.")
(defconst oni-gui-icons-dir
(expand-file-name "oni-gui/icons" oni-gui-root)
"The directory where oni-gui stores its icons.")
(add-to-list 'default-frame-alist '(font . "Fantasque Sans Mono-15")) (add-to-list 'default-frame-alist '(font . "Fantasque Sans Mono-15"))
(add-to-list 'default-frame-alist '(internal-border-width . 15)) (add-to-list 'default-frame-alist '(internal-border-width . 15))
(defconst oni-gui-isearch-icon #xf002)
(defconst oni-gui-arev-icon #xf1b8)
(defun oni-gui-setup-faces (frame) (defun oni-gui-setup-faces (frame)
"Setup faces for FRAME." "Setup faces for FRAME."
(set-face-attribute 'fixed-pitch frame :font "Fantasque Sans Mono-15") (set-face-attribute 'fixed-pitch frame :font "Fantasque Sans Mono-15")
@ -44,7 +51,6 @@
"Setup fontsets for FRAME. "Setup fontsets for FRAME.
If FRAME is nil, theyre set for the current frame." If FRAME is nil, theyre set for the current frame."
(let ((font-awesome "Font Awesome 5 Free Solid-12")) (let ((font-awesome "Font Awesome 5 Free Solid-12"))
(set-fontset-font t oni-gui-isearch-icon font-awesome frame)
(set-fontset-font t #xf026 font-awesome frame) (set-fontset-font t #xf026 font-awesome frame)
(set-fontset-font t #xf027 font-awesome frame) (set-fontset-font t #xf027 font-awesome frame)
(set-fontset-font t #xf028 font-awesome frame) (set-fontset-font t #xf028 font-awesome frame)
@ -56,8 +62,7 @@ If FRAME is nil, theyre set for the current frame."
(set-fontset-font t #xf2c9 font-awesome frame) (set-fontset-font t #xf2c9 font-awesome frame)
(set-fontset-font t #xf6a9 font-awesome frame) (set-fontset-font t #xf6a9 font-awesome frame)
(set-fontset-font t #xf769 font-awesome frame) (set-fontset-font t #xf769 font-awesome frame)
(set-fontset-font t #xf76b font-awesome frame) (set-fontset-font t #xf76b font-awesome frame))
(set-fontset-font t oni-gui-arev-icon font-awesome frame))
(let ((font-awesome "Font Awesome 5 Free Regular-12")) (let ((font-awesome "Font Awesome 5 Free Regular-12"))
(set-fontset-font t #xf0c8 font-awesome frame) (set-fontset-font t #xf0c8 font-awesome frame)
(set-fontset-font t #xf14a font-awesome frame)) (set-fontset-font t #xf14a font-awesome frame))
@ -91,9 +96,9 @@ If FRAME is nil, theyre set for the current frame."
`([,(cdr char-regexp) 0 font-shape-gstring]))))) `([,(cdr char-regexp) 0 font-shape-gstring])))))
(with-eval-after-load 'isearch (with-eval-after-load 'isearch
(diminish 'isearch-mode (string ?\s oni-gui-isearch-icon))) (diminish 'isearch-mode (propertize " " 'display `(image :type svg :file ,(expand-file-name "search.svg" oni-gui-icons-dir) :ascent center :margin (5 . 0)))))
(with-eval-after-load 'autorevert (with-eval-after-load 'autorevert
(diminish 'auto-revert-mode (string ?\s oni-gui-arev-icon))) (diminish 'auto-revert-mode (propertize " " 'display `(image :type svg :file ,(expand-file-name "recycle.svg" oni-gui-icons-dir) :ascent center :margin (5 . 0)))))
(defhydra oni-gui-hydra (:color teal :hint nil) (defhydra oni-gui-hydra (:color teal :hint nil)
" "