Skip to content

Commit 34a74f7

Browse files
committed
Add paw-logo-icon
1 parent fab7576 commit 34a74f7

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

paw-svg.el

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@
141141
)))
142142

143143

144+
(defun paw-logo-icon ()
145+
(or
146+
(if (and (fboundp 'all-the-icons-faicon) paw-all-the-icons-icon-enable)
147+
(all-the-icons-material "paw"))
148+
(if (and (fboundp 'nerd-icons-mdicon) paw-nerd-icons-icon-enable)
149+
(nerd-icons-mdicon "nf-md-paw") "Annotation")))
144150

145151
(defun paw-star-face-icon ()
146152
(or
@@ -1238,6 +1244,7 @@ The final %s is the question."
12381244

12391245

12401246

1247+
(defvar paw-logo-icon (paw-logo-icon))
12411248
(defvar paw-star-face-icon (paw-star-face-icon))
12421249
(defvar paw-word-icon (paw-word-icon))
12431250
(defvar paw-question-icon (paw-question-icon))
@@ -1281,6 +1288,7 @@ The final %s is the question."
12811288
;;;###autoload
12821289
(defun paw-get-icons ()
12831290
(interactive)
1291+
(setq paw-logo-icon (paw-logo-icon))
12841292
(setq paw-star-face-icon (paw-star-face-icon))
12851293
(setq paw-word-icon (paw-word-icon))
12861294
(setq paw-question-icon (paw-question-icon))

paw.el

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,18 @@
7575
(defun paw-header ()
7676
"Header function for *paw* buffer."
7777
(format "%s%s"
78-
(format "%sTotal: %s Page: %s/%s %s %s %s"
79-
(if (string-equal system-type "android") ""
80-
(format "Annotations: %s " (propertize paw-db-file 'face 'font-lock-keyword-face) ))
78+
(format "%s Total: %s Page: %s/%s [%s %s %s %s]"
79+
paw-logo-icon
80+
;; (if (string-equal system-type "android") ""
81+
;; (format "Annotations: %s " (propertize paw-db-file 'face 'font-lock-keyword-face) ))
8182
(propertize (number-to-string paw-search-entries-length) 'face 'font-lock-type-face)
8283
(propertize (number-to-string paw-search-current-page) 'face 'font-lock-type-face)
8384
(propertize (number-to-string paw-search-pages) 'face 'font-lock-type-face)
8485
(paw-auto-audio-play-button)
8586
(paw-auto-translate-button)
86-
(paw-auto-ai-translate-button))
87-
(format "%s"
87+
(paw-auto-ai-translate-button)
88+
(paw-one-click-query-button))
89+
(format " %s"
8890
(if (equal paw-search-filter "")
8991
""
9092
(concat
@@ -634,7 +636,9 @@ It is fast but has drawbacks:
634636
(message "Disable auto play audio"))
635637
(setq paw-say-word-p t)
636638
(message "Enable auto play audio")) ))
637-
(paw-make-text-button-text (if paw-say-word-p "📢" "🔇")
639+
(paw-make-text-button-text (if paw-say-word-p
640+
(propertize "Voice" 'face 'bold)
641+
(propertize "Voice" 'face 'shadow))
638642
map 'highlight (format "Auto Play Audio? Now it is %s." (if paw-say-word-p "Enable" "Disable")))))
639643

640644
(defun paw-auto-translate-button ()
@@ -649,7 +653,9 @@ It is fast but has drawbacks:
649653
(setq paw-translate-p t)
650654
(setq paw-translate-context-p nil)
651655
(message "Enable auto translate")) ))
652-
(paw-make-text-button-text (if paw-translate-p "📖" "📚")
656+
(paw-make-text-button-text (if paw-translate-p
657+
(propertize "Translate" 'face 'bold)
658+
(propertize "Translate" 'face 'shadow))
653659
map 'highlight (format "Auto Translate? Now it is %s." (if paw-translate-p "Enable" "Disable")))))
654660

655661
(defun paw-auto-ai-translate-button ()
@@ -664,7 +670,18 @@ It is fast but has drawbacks:
664670
(setq paw-ai-translate-p t)
665671
(setq paw-ai-translate-context-p nil)
666672
(message "Enable auto ai translate")) ))
667-
(paw-make-text-button-text (if paw-ai-translate-p "🕮" "📘")
673+
(paw-make-text-button-text (if paw-ai-translate-p
674+
(propertize "AI" 'face 'bold)
675+
(propertize "AI" 'face 'shadow))
668676
map 'highlight (format "Auto AI Translate? Now it is %s." (if paw-ai-translate-p "Enable" "Disable")))))
669677

678+
679+
(defun paw-one-click-query-button ()
680+
(let ((map (make-sparse-keymap)))
681+
(define-key map (kbd "<header-line> <mouse-1>") 'paw-view-note-click-enable-toggle)
682+
(paw-make-text-button-text (if paw-view-note-click-enable
683+
(propertize "Click" 'face 'bold)
684+
(propertize "Click" 'face 'shadow))
685+
map 'highlight (format "One-Click? Now it is %s." (if paw-view-note-click-enable "Enable" "Disable")))))
686+
670687
(provide 'paw)

0 commit comments

Comments
 (0)