summaryrefslogtreecommitdiff
path: root/lisp/tool-bar.el
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-12-17 12:04:06 +0800
committerChong Yidong <cyd@stupidchicken.com>2010-12-17 12:04:06 +0800
commit4039c78625bb20cf57b434a7d395bf2473e45133 (patch)
tree729b8ce725973a7e31d769e4ab1217b517738a21 /lisp/tool-bar.el
parent8b358e9038806836c599da8233781b14c6bb53e7 (diff)
downloademacs-4039c78625bb20cf57b434a7d395bf2473e45133.tar.gz
Support for menu separators in the GTK tool-bar.
* src/gtkutil.c (XG_BIN_CHILD): New macro. (xg_get_menu_item_label, xg_update_menubar) (xg_update_menu_item, xg_tool_bar_menu_proxy) (xg_show_toolbar_item, update_frame_tool_bar): Use it. (separator_names, xg_separator_p): Move to keyboard.c. (create_menus, xg_update_submenu, update_frame_tool_bar): Use menu_separator_name_p. * src/keyboard.c (parse_tool_bar_item): Allow menu separators in tool-bar maps. (menu_separator_name_p): New function, from gtkutil.c. (separator_names): Move from gtkutil.c. * src/keyboard.h (menu_separator_name_p): Add prototype. * src/nsmenu.m (name_is_separator): Function deleted. (addItemWithWidgetValue): Use menu_separator_name_p. * src/w32menu.c (name_is_separator): Function deleted. (add_menu_item): Use menu_separator_name_p.
Diffstat (limited to 'lisp/tool-bar.el')
-rw-r--r--lisp/tool-bar.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/lisp/tool-bar.el b/lisp/tool-bar.el
index a3292c42046..7c7216ed7d3 100644
--- a/lisp/tool-bar.el
+++ b/lisp/tool-bar.el
@@ -257,23 +257,23 @@ holds a keymap."
;;; Set up some global items. Additions/deletions up for grabs.
(defun tool-bar-setup ()
- ;; People say it's bad to have EXIT on the tool bar, since users
- ;; might inadvertently click that button.
- ;;(tool-bar-add-item-from-menu 'save-buffers-kill-emacs "exit")
(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
- :vert-only t)
+ :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 :vert-only t
+ :label "Save"
:visible '(or buffer-file-name
(not (eq 'special
(get major-mode
'mode-class)))))
+ (define-key-after (default-value 'tool-bar-map) [separator-1] menu-bar-separator)
(tool-bar-add-item-from-menu 'undo "undo" nil :vert-only t
:visible '(not (eq 'special (get major-mode
'mode-class))))
+ (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
:visible '(not (eq 'special (get major-mode
@@ -284,6 +284,7 @@ holds a keymap."
"paste" nil :vert-only t
:visible '(not (eq 'special (get major-mode
'mode-class))))
+ (define-key-after (default-value 'tool-bar-map) [separator-3] menu-bar-separator)
(tool-bar-add-item-from-menu 'nonincremental-search-forward "search"
nil :label "Search")
;;(tool-bar-add-item-from-menu 'ispell-buffer "spell")