From e4a10177fadbfbe0a7743b4d7e4c09c45209dc2a Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Fri, 9 Apr 2021 03:42:14 +0200 Subject: [PATCH] Use Material icons for tool-bar --- etc/images/material/action/ic_search_24px.svg | 1 + .../material/content/ic_content_copy_24px.svg | 1 + .../material/content/ic_content_cut_24px.svg | 1 + .../content/ic_content_paste_24px.svg | 1 + .../material/content/ic_create_24px.svg | 1 + etc/images/material/content/ic_redo_24px.svg | 1 + etc/images/material/content/ic_save_24px.svg | 1 + etc/images/material/content/ic_undo_24px.svg | 1 + .../content/inventory_2_black_24dp.svg | 1 + etc/images/material/file/ic_folder_24px.svg | 1 + .../material/navigation/ic_close_24px.svg | 1 + lisp/tool-bar.el | 31 ++++++++++--------- 12 files changed, 27 insertions(+), 15 deletions(-) create mode 100644 etc/images/material/action/ic_search_24px.svg create mode 100644 etc/images/material/content/ic_content_copy_24px.svg create mode 100644 etc/images/material/content/ic_content_cut_24px.svg create mode 100644 etc/images/material/content/ic_content_paste_24px.svg create mode 100644 etc/images/material/content/ic_create_24px.svg create mode 100644 etc/images/material/content/ic_redo_24px.svg create mode 100644 etc/images/material/content/ic_save_24px.svg create mode 100644 etc/images/material/content/ic_undo_24px.svg create mode 100644 etc/images/material/content/inventory_2_black_24dp.svg create mode 100644 etc/images/material/file/ic_folder_24px.svg create mode 100644 etc/images/material/navigation/ic_close_24px.svg diff --git a/etc/images/material/action/ic_search_24px.svg b/etc/images/material/action/ic_search_24px.svg new file mode 100644 index 0000000000..12440059b6 --- /dev/null +++ b/etc/images/material/action/ic_search_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/content/ic_content_copy_24px.svg b/etc/images/material/content/ic_content_copy_24px.svg new file mode 100644 index 0000000000..7c6b60aeec --- /dev/null +++ b/etc/images/material/content/ic_content_copy_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/content/ic_content_cut_24px.svg b/etc/images/material/content/ic_content_cut_24px.svg new file mode 100644 index 0000000000..b89a0d03c0 --- /dev/null +++ b/etc/images/material/content/ic_content_cut_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/content/ic_content_paste_24px.svg b/etc/images/material/content/ic_content_paste_24px.svg new file mode 100644 index 0000000000..af63a642cc --- /dev/null +++ b/etc/images/material/content/ic_content_paste_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/content/ic_create_24px.svg b/etc/images/material/content/ic_create_24px.svg new file mode 100644 index 0000000000..f5ddfe1942 --- /dev/null +++ b/etc/images/material/content/ic_create_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/content/ic_redo_24px.svg b/etc/images/material/content/ic_redo_24px.svg new file mode 100644 index 0000000000..764ab7789b --- /dev/null +++ b/etc/images/material/content/ic_redo_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/content/ic_save_24px.svg b/etc/images/material/content/ic_save_24px.svg new file mode 100644 index 0000000000..1d3c3005a2 --- /dev/null +++ b/etc/images/material/content/ic_save_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/content/ic_undo_24px.svg b/etc/images/material/content/ic_undo_24px.svg new file mode 100644 index 0000000000..c37cf40136 --- /dev/null +++ b/etc/images/material/content/ic_undo_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/content/inventory_2_black_24dp.svg b/etc/images/material/content/inventory_2_black_24dp.svg new file mode 100644 index 0000000000..c35ba104ee --- /dev/null +++ b/etc/images/material/content/inventory_2_black_24dp.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/file/ic_folder_24px.svg b/etc/images/material/file/ic_folder_24px.svg new file mode 100644 index 0000000000..e70b01ce41 --- /dev/null +++ b/etc/images/material/file/ic_folder_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/etc/images/material/navigation/ic_close_24px.svg b/etc/images/material/navigation/ic_close_24px.svg new file mode 100644 index 0000000000..865788b755 --- /dev/null +++ b/etc/images/material/navigation/ic_close_24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el index 6da401187b..2c29aae4af 100644 --- a/lisp/tool-bar.el +++ b/lisp/tool-bar.el @@ -153,13 +153,15 @@ tool-bar--image-expression (pbm-spec (append (list :type 'pbm :file (concat icon ".pbm")) colors)) (xbm-spec (append (list :type 'xbm :file - (concat icon ".xbm")) colors))) + (concat icon ".xbm")) colors)) + (svg-spec (append (list :type 'svg :file + (concat icon ".svg")) colors))) `(find-image (cond ((not (display-color-p)) ',(list pbm-spec xbm-spec xpm-lo-spec xpm-spec)) ((< (display-color-cells) 256) - ',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec)) - (t - ',(list xpm-spec pbm-spec xbm-spec))) + ',(list xpm-lo-spec xpm-spec pbm-spec xbm-spec)) + (t + ',(list svg-spec xpm-spec pbm-spec xbm-spec))) t))) ;;;###autoload @@ -250,25 +252,24 @@ tool-bar-local-item-from-menu (defun tool-bar-setup () (setq tool-bar-separator-image-expression (tool-bar--image-expression "separator")) - (tool-bar-add-item-from-menu 'find-file "new" nil :label "New File" + (tool-bar-add-item-from-menu 'find-file "material/content/ic_create_24px" nil :label "New File" :vert-only t) - (tool-bar-add-item-from-menu 'menu-find-file-existing "open" nil + (tool-bar-add-item-from-menu 'menu-find-file-existing "material/file/ic_folder_24px" nil :label "Open" :vert-only t) - (tool-bar-add-item-from-menu 'dired "diropen" nil :vert-only t) - (tool-bar-add-item-from-menu 'kill-this-buffer "close" nil :vert-only t) - (tool-bar-add-item-from-menu 'save-buffer "save" nil - :label "Save") + (tool-bar-add-item-from-menu 'dired "material/content/inventory_2_black_24dp" nil :vert-only t) + (tool-bar-add-item-from-menu 'kill-this-buffer "material/navigation/ic_close_24px" nil :vert-only t) + (tool-bar-add-item-from-menu 'save-buffer "material/content/ic_save_24px" nil :vert-only t) (define-key-after (default-value 'tool-bar-map) [separator-1] menu-bar-separator) - (tool-bar-add-item-from-menu 'undo "undo" nil) + (tool-bar-add-item-from-menu 'undo "material/content/ic_undo_24px" nil :vert-only t) (define-key-after (default-value 'tool-bar-map) [separator-2] menu-bar-separator) (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut]) - "cut" nil :vert-only t) + "material/content/ic_content_cut_24px" nil :vert-only t) (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [copy]) - "copy" nil :vert-only t) + "material/content/ic_content_copy_24px" nil :vert-only t) (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste]) - "paste" nil :vert-only t) + "material/content/ic_content_paste_24px" nil :vert-only t) (define-key-after (default-value 'tool-bar-map) [separator-3] menu-bar-separator) - (tool-bar-add-item-from-menu 'isearch-forward "search" + (tool-bar-add-item-from-menu 'isearch-forward "material/action/ic_search_24px" nil :label "Search" :vert-only t) ;;(tool-bar-add-item-from-menu 'ispell-buffer "spell") -- 2.30.2