emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] remove save and undo text on tool-bar for gtk version


From: Caio Henrique
Subject: [PATCH] remove save and undo text on tool-bar for gtk version
Date: Wed, 30 Sep 2020 13:48:53 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi, these suggestions to improve the tool-bar consistency and also save
horizontal space got lost in the "Changes for emacs 28" discussion, so
I'm changing the subject. This only affects the gtk version, AFAIK windows
only shows the icons.

There were two proposals:
1 - remove :vertonly from all tool-bar items and change the default
value of tool-bar-style to image
2 - simply add :vertonly to save and undo

IMO option 1 is better, since option 2 makes the value text-image-horiz
useless.

Attachment: tool-bar-gtk.png
Description: tool bar gtk

Here is the 2nd proposal patch:
____________
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 7df1e28e06..bec45c1ea4 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -256,9 +256,9 @@ tool-bar-setup
   (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")
+                              :label "Save" :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 "undo" 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)
____________


Here is the 1st proposal patch:
____________
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index 7df1e28e06..c45c7ae8ed 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -249,26 +249,19 @@ 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"
-                              :vert-only t)
-  (tool-bar-add-item-from-menu 'menu-find-file-existing "open" 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 'find-file "new" nil :label "New File")
+  (tool-bar-add-item-from-menu 'menu-find-file-existing "open" nil :label 
"Open")
+  (tool-bar-add-item-from-menu 'dired "diropen" nil)
+  (tool-bar-add-item-from-menu 'kill-this-buffer "close" nil)
+  (tool-bar-add-item-from-menu 'save-buffer "save" nil :label "Save")
   (define-key-after (default-value 'tool-bar-map) [separator-1] 
menu-bar-separator)
   (tool-bar-add-item-from-menu 'undo "undo" nil)
   (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)
-  (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [copy])
-                              "copy" nil :vert-only t)
-  (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste])
-                              "paste" nil :vert-only t)
+  (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [cut]) "cut" nil)
+  (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [copy]) "copy" 
nil)
+  (tool-bar-add-item-from-menu (lookup-key menu-bar-edit-menu [paste]) "paste" 
nil)
   (define-key-after (default-value 'tool-bar-map) [separator-3] 
menu-bar-separator)
-  (tool-bar-add-item-from-menu 'isearch-forward "search"
-                              nil :label "Search" :vert-only t)
+  (tool-bar-add-item-from-menu 'isearch-forward "search" nil :label "Search")
   ;;(tool-bar-add-item-from-menu 'ispell-buffer "spell")
 
   ;; There's no icon appropriate for News and we need a command rather
diff --git a/src/xdisp.c b/src/xdisp.c
index 152946363e..673be19b51 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -34993,7 +34993,7 @@ syms_of_xdisp (void)
  any other        - use system default or image if no system default.
 
 This variable only affects the GTK+ toolkit version of Emacs.  */);
-  Vtool_bar_style = Qnil;
+  Vtool_bar_style = Qimage;
 
   DEFVAR_INT ("tool-bar-max-label-size", tool_bar_max_label_size,
     doc: /* Maximum number of characters a label can have to be shown.
____________

reply via email to

[Prev in Thread] Current Thread [Next in Thread]