diff --git a/oni-gui/icons/recycle.svg b/oni-gui/icons/recycle.svg new file mode 100644 index 0000000..21d1bd9 --- /dev/null +++ b/oni-gui/icons/recycle.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/oni-gui/icons/search.svg b/oni-gui/icons/search.svg new file mode 100644 index 0000000..3318054 --- /dev/null +++ b/oni-gui/icons/search.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/oni-gui.el b/oni-gui/oni-gui.el similarity index 87% rename from oni-gui.el rename to oni-gui/oni-gui.el index 5ba6a13..7c6aca4 100644 --- a/oni-gui.el +++ b/oni-gui/oni-gui.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2023.0805.233624 +;; Version: 2025.0115.141118 ;; Package-Requires: (oni-ui oni-hydra yoshi-theme diminish) ;; This program is free software; you can redistribute it and/or modify @@ -29,12 +29,19 @@ (require 'hydra) (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 '(internal-border-width . 15)) -(defconst oni-gui-isearch-icon #xf002) -(defconst oni-gui-arev-icon #xf1b8) - (defun oni-gui-setup-faces (frame) "Setup faces for FRAME." (set-face-attribute 'fixed-pitch frame :font "Fantasque Sans Mono-15") @@ -44,7 +51,6 @@ "Setup fontsets for FRAME. If FRAME is nil, they’re set for the current frame." (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 #xf027 font-awesome frame) (set-fontset-font t #xf028 font-awesome frame) @@ -56,8 +62,7 @@ If FRAME is nil, they’re set for the current frame." (set-fontset-font t #xf2c9 font-awesome frame) (set-fontset-font t #xf6a9 font-awesome frame) (set-fontset-font t #xf769 font-awesome frame) - (set-fontset-font t #xf76b font-awesome frame) - (set-fontset-font t oni-gui-arev-icon font-awesome frame)) + (set-fontset-font t #xf76b font-awesome frame)) (let ((font-awesome "Font Awesome 5 Free Regular-12")) (set-fontset-font t #xf0c8 font-awesome frame) (set-fontset-font t #xf14a font-awesome frame)) @@ -91,9 +96,9 @@ If FRAME is nil, they’re set for the current frame." `([,(cdr char-regexp) 0 font-shape-gstring]))))) (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 - (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) "