unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Kangas <stefan@marxist.se>
To: Dmitry Gutov <dgutov@yandex.ru>, emacs-devel@gnu.org
Subject: Using more and/or better icons in Emacs
Date: Thu, 8 Apr 2021 21:09:56 -0500	[thread overview]
Message-ID: <CADwFkmn0f9LUiRqeFXpzATtUQ3ZAFZ73xxpBON6NN8z5m-WtHQ@mail.gmail.com> (raw)
In-Reply-To: <2f0b4786-d569-27e6-fa8a-fb47bf08b166@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

Dmitry Gutov <dgutov@yandex.ru> writes:

> It would be nice to have a set of general purpose icons available in
> ELPA, or ever in the core. For this and other purposes.

Yup.  Have a look at the attached quick mock-up of how things could look
if we would use Material icons for the tool-bar as an example.

> For now I'm using vscode's ones (under CC BY 4.0), but I'm guessing it
> won't be good for Emacs's image to migrate to that wholesale.

True.  all-the-icons.el has some links to other freely licensed sets.
Could one of them be a suitable replacement?

[-- Attachment #2: 0001-Use-Material-icons-for-tool-bar.patch --]
[-- Type: text/x-diff, Size: 11201 bytes --]

From e4a10177fadbfbe0a7743b4d7e4c09c45209dc2a Mon Sep 17 00:00:00 2001
From: Stefan Kangas <stefan@marxist.se>
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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M9.64 7.64c.23-.5.36-1.05.36-1.64 0-2.21-1.79-4-4-4S2 3.79 2 6s1.79 4 4 4c.59 0 1.14-.13 1.64-.36L10 12l-2.36 2.36C7.14 14.13 6.59 14 6 14c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4c0-.59-.13-1.14-.36-1.64L12 14l7 7h3v-1L9.64 7.64zM6 8c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm0 12c-1.1 0-2-.89-2-2s.9-2 2-2 2 .89 2 2-.9 2-2 2zm6-7.5c-.28 0-.5-.22-.5-.5s.22-.5.5-.5.5.22.5.5-.22.5-.5.5zM19 3l-6 6 2 2 7-7V3z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 2h-4.18C14.4.84 13.3 0 12 0c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm7 18H5V4h2v3h10V4h2v16z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 8.99 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16c1.05-3.19 4.05-5.5 7.6-5.5 1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05.99-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" enable-background="new 0 0 24 24" height="24px" viewBox="0 0 24 24" width="24px" fill="#000000"><g><rect fill="none" height="24" width="24"/></g><g><path d="M20,2H4C3,2,2,2.9,2,4v3.01C2,7.73,2.43,8.35,3,8.7V20c0,1.1,1.1,2,2,2h14c0.9,0,2-0.9,2-2V8.7c0.57-0.35,1-0.97,1-1.69V4 C22,2.9,21,2,20,2z M15,14H9v-2h6V14z M20,7H4V4h16V7z"/></g></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M10 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2h-8l-2-2z"/></svg>
\ 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 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>
\ 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


[-- Attachment #3: material-toolbar.png --]
[-- Type: image/png, Size: 37190 bytes --]

  reply	other threads:[~2021-04-09  2:09 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07 11:16 Improvement proposals for `completing-read' Daniel Mendler
2021-04-07 17:11 ` Stefan Monnier
2021-04-07 17:20   ` Stefan Monnier
2021-04-07 19:46     ` Daniel Mendler
2021-04-07 21:26       ` Stefan Monnier
2021-04-08  9:01         ` Daniel Mendler
2021-04-08 14:44           ` Stefan Monnier
2021-04-08 15:26             ` Stefan Kangas
2021-04-08 15:47               ` Daniel Mendler
2021-04-08 17:31               ` Stefan Monnier
2021-04-08 15:37             ` Daniel Mendler
2021-04-08 17:22               ` [External] : " Drew Adams
2021-04-08 18:22                 ` Dmitry Gutov
2021-04-08 18:48                   ` Drew Adams
2021-04-08 19:03                     ` Dmitry Gutov
2021-04-08 19:32                       ` Drew Adams
2021-04-08 17:30               ` Stefan Monnier
2021-04-08 17:57                 ` Daniel Mendler
2021-04-08 18:13                   ` Stefan Monnier
2021-04-08 19:15                     ` Daniel Mendler
2021-04-08 19:20               ` Dmitry Gutov
2021-04-08 19:46                 ` [External] : " Drew Adams
2021-04-08 20:12                   ` Dmitry Gutov
2021-04-08 21:12                     ` Drew Adams
2021-04-08 22:37                     ` Stefan Kangas
2021-04-09  0:03                       ` Dmitry Gutov
2021-04-09  2:09                         ` Stefan Kangas [this message]
2021-04-09  3:09                           ` Using more and/or better icons in Emacs Lars Ingebrigtsen
2021-04-09  3:35                           ` chad
2021-04-09 12:06                             ` Stefan Kangas
2021-04-09  7:41                           ` Yuri Khan
2021-04-09  9:59                             ` tomas
2021-04-09 11:15                               ` Dmitry Gutov
2021-04-09 11:19                           ` Dmitry Gutov
2021-04-09 12:22                             ` Stefan Kangas
2021-04-09 12:29                               ` Dmitry Gutov
2021-04-09 17:46                                 ` Stefan Kangas
2021-04-09 18:45                                   ` Eli Zaretskii
2021-04-09 19:30                                   ` Alan Third
2021-04-09 19:40                                     ` Alan Third
2021-04-09 22:38                                       ` Dmitry Gutov
2021-04-10  0:56                                       ` Stefan Kangas
2021-04-10  1:43                                         ` Stefan Kangas
2021-04-10  9:12                                           ` Alan Third
2021-04-10 10:56                                             ` Stefan Kangas
2021-04-10 13:48                                               ` Alan Third
2021-04-12 19:39                                                 ` Alan Third
2021-04-13  1:25                                                   ` Stefan Kangas
2021-04-13  7:35                                                     ` Alan Third
2021-04-13 10:39                                                       ` Stefan Kangas
2021-04-13 19:50                                                         ` Alan Third
2021-04-13 22:44                                                           ` Stefan Kangas
2021-04-14  6:46                                                           ` Eli Zaretskii
2021-04-15 15:37                                                             ` Alan Third
2021-04-15 15:50                                                               ` Eli Zaretskii
2021-04-15 17:10                                                                 ` Alan Third
2021-04-11 21:57                                       ` Dmitry Gutov
2021-04-09 23:16                                   ` Alan Third
2021-04-10  0:55                                     ` Stefan Kangas
2021-04-10  7:23                                       ` Eli Zaretskii
2021-04-10  9:17                                         ` Alan Third
2021-04-10  9:25                                           ` Eli Zaretskii
2021-04-08 17:22             ` [External] : Re: Improvement proposals for `completing-read' Drew Adams
2021-04-08 18:33               ` Drew Adams
2021-04-07 23:11       ` Drew Adams
2021-04-08  7:56       ` Eli Zaretskii
2021-04-07 18:39 ` Jean Louis
2021-04-07 19:49   ` Daniel Mendler
2021-04-07 22:16 ` Dmitry Gutov
2021-04-08  8:37   ` Daniel Mendler
2021-04-08 20:44     ` Dmitry Gutov
2021-04-08 21:30       ` Daniel Mendler
2021-04-10  2:21         ` Dmitry Gutov
2021-04-10  9:18           ` Daniel Mendler
2021-04-11  0:51             ` Dmitry Gutov
2021-04-11 13:08               ` Daniel Mendler
2021-04-12  0:32                 ` Dmitry Gutov
2021-04-12  0:40                   ` Daniel Mendler
2021-04-12 10:47                     ` Dmitry Gutov
2021-04-12 11:04                       ` Daniel Mendler
2021-04-14  0:00                         ` Dmitry Gutov
2021-04-14 10:44                           ` Daniel Mendler
2021-04-07 23:49 ` [External] : " Drew Adams
2021-04-08  9:29   ` Daniel Mendler
2021-04-08 17:19     ` Drew Adams
2021-04-09 11:19       ` Jean Louis
2021-04-09 11:47         ` Daniel Mendler
2021-04-09 17:22         ` Drew Adams
2021-04-09 17:41           ` Daniel Mendler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADwFkmn0f9LUiRqeFXpzATtUQ3ZAFZ73xxpBON6NN8z5m-WtHQ@mail.gmail.com \
    --to=stefan@marxist.se \
    --cc=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).