Commit f904c0f9 authored by Jan Djärv's avatar Jan Djärv

Gtk tool bars can be text, icons with text or just icons.

* xsettings.c: Qmonospace_font_name, Qtool_bar_style and
current_tool_bar_style are new.
(store_config_changed_event): Rename from store_font_changed_event.
(XSETTINGS_TOOL_BAR_STYLE): New define.
(SEEN_FONT, SEEN_TB_STYLE): New enum values.
(struct xsettings): Add font and tb_style, set xft stuff inside #ifdef
HAVE_XFT.
(something_changedCB): store_font_changed_event is now
store_config_changed_event
(parse_settings): Rename from parse_xft_settings.  Read
non-xft xsettings outside #ifdef HAVE_XFT.
(read_settings): Renamed from read_xft_settings.
(apply_xft_settings): Take current settings as parameter.  Do not
call read_(xft)_settings.
(read_and_apply_settings): New function.
(xft_settings_event): Do non-xft stuff out of HAVE_XFT.  Call
read_and_apply_settings if there are settings to be read.
(init_xsettings): Renamed from init_xfd_settings.
Call read_and_apply_settings unconditionally.
(xsettings_initialize): Call init_xsettings.
(Ftool_bar_get_system_style): New function.
(syms_of_xsettings): Define Qmonospace_font_name and
Qtool_bar_style.  Initialize current_tool_bar_style to nil.
defsubr Stool_bar_get_system_style. Fprovide on
dynamic-setting.

* xsettings.h (Ftool_bar_get_system_style): Declare.

* xdisp.c: Vtool_bar_style, tool_bar_max_label_size,
Qtext, Qboth, Qboth_horiz are new.
(syms_of_xdisp): Intern Qtext, Qboth, Qboth_horiz, DEFVAR
Vtool_bar_style, tool_bar_max_label_size.

* lisp.h: Extern declare Qtext, Qboth, Qboth_horiz.

* keyboard.c: QClabel is new.
(parse_tool_bar_item): Take out QClabel from tool bar items.
Try to construct a label if ther is no QClabel.
(syms_of_keyboard): Intern :label as QClabel.

* dispextern.h (tool_bar_item_idx): TOOL_BAR_ITEM_LABEL is new.
(Vtool_bar_style, tool_bar_max_label_size, DEFAULT_TOOL_BAR_LABEL_SIZE):
New.

* Makefile.in (SOME_MACHINE_LISP): font-setting.el renamed to
dynamic-setting.el.

* gtkutil.c (xg_tool_bar_menu_proxy): Handle label in tool bar item.
(xg_make_tool_item, xg_show_toolbar_item): New function.
(update_frame_tool_bar): Take label from TOOL_BAR_ITEM_LABEL.
Call xg_make_tool_item to make a tool bar item.
Call xg_show_toolbar_item.  Use wtoolbar instead of x->toolbar_widget.

* xterm.c (x_draw_image_relief): Take Vtool_bar_button_margin
into account for toolbars.

* vc-dir.el (vc-dir-tool-bar-map): Add :label on some tool bar items.

* tool-bar.el (tool-bar-setup): Add :label on some tool bar items.

* loadup.el: Load dynamic-setting.el if feature dynamic-setting
is present.

* info.el (info-tool-bar-map): Add labels.

* cus-start.el (all): Add tool-bar-style and tool-bar-max-label-size.

* cus-edit.el (custom-commands): Add labels for tool bar.
(custom-buffer-create-internal, Custom-mode): Adjust for
labels in custom-commands.

* dynamic-setting.el: Renamed from font-setting.el.
parent c632dfda
2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
* vc-dir.el (vc-dir-tool-bar-map): Add :label on some tool bar items.
* tool-bar.el (tool-bar-setup): Add :label on some tool bar items.
* loadup.el: Load dynamic-setting.el if feature dynamic-setting
is present.
* info.el (info-tool-bar-map): Add labels.
* cus-start.el (all): Add tool-bar-style and tool-bar-max-label-size.
* cus-edit.el (custom-commands): Add labels for tool bar.
(custom-buffer-create-internal, Custom-mode): Adjust for
labels in custom-commands.
* dynamic-setting.el: Renamed from font-setting.el.
2010-04-21 John Wiegley <jwiegley@gmail.com>
* ido.el (ido-init-completion-maps): For ido-switch-buffer, C-o
......
......@@ -739,25 +739,31 @@ groups after non-groups, if nil do not order groups at all."
(defvar custom-commands
'(("Set for current session" Custom-set t
"Apply all settings in this buffer to the current session"
"index")
"index"
"Apply")
("Save for future sessions" Custom-save
(or custom-file user-init-file)
"Apply all settings in this buffer and save them for future Emacs sessions."
"save")
"save"
"Save")
("Undo edits" Custom-reset-current t
"Restore all settings in this buffer to reflect their current values."
"refresh")
"refresh"
"Undo")
("Reset to saved" Custom-reset-saved t
"Restore all settings in this buffer to their saved values (if any)."
"undo")
"undo"
"Reset")
("Erase customizations" Custom-reset-standard
(or custom-file user-init-file)
"Un-customize all settings in this buffer and save them with standard values."
"delete")
"delete"
"Uncustomize")
("Help for Customize" Custom-help t
"Get help for using Customize."
"help")
("Exit" Custom-buffer-done t "Exit Customize." "exit")))
"help"
"Help")
("Exit" Custom-buffer-done t "Exit Customize." "exit" "Exit")))
(defun Custom-help ()
"Read the node on Easy Customization in the Emacs manual."
......@@ -1616,7 +1622,7 @@ Otherwise use brackets."
(if custom-buffer-verbose-help
(widget-insert "
Operate on all settings in this buffer:\n"))
(let ((button (lambda (tag action active help icon)
(let ((button (lambda (tag action active help icon label)
(widget-insert " ")
(if (eval active)
(widget-create 'push-button :tag tag
......@@ -4680,7 +4686,8 @@ if that value is non-nil."
(mapc
(lambda (arg)
(tool-bar-local-item-from-menu
(nth 1 arg) (nth 4 arg) map custom-mode-map))
(nth 1 arg) (nth 4 arg) map custom-mode-map
:label (nth 5 arg)))
custom-commands)
(setq custom-tool-bar-map map))))
(make-local-variable 'custom-options)
......
......@@ -339,6 +339,15 @@ since it could result in memory overflow and make Emacs crash."
(const :tag "Off (nil)" :value nil)
(const :tag "Immediate" :value t)
(number :tag "Delay by secs" :value 0.5)) "22.1")
(tool-bar-style
frames (choice
(const :tag "Images" :value image)
(const :tag "Text" :value text)
(const :tag "Both" :value both)
(const :tag "Both-horiz" :value both-horiz)
(const :tag "System default" :value nil)) "23.3")
(tool-bar-max-label-size frames integer "23.3")
;; xfaces.c
(scalable-fonts-allowed display boolean "22.1")
;; xfns.c
......
;;; font-setting.el --- Support dynamic font changes
;;; dynamic-setting.el --- Support dynamic changes
;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
;; Author: Jan Djärv <jan.h.d@swipnet.se>
;; Maintainer: FSF
;; Keywords: font, system-font
;; Keywords: font, system-font, tool-bar-style
;; This file is part of GNU Emacs.
......@@ -81,21 +81,25 @@ current form for the frame (i.e. hinting or somesuch changed)."
(custom-push-theme 'theme-face 'default 'user 'set spec)
(put 'default 'face-modified nil))))))
(defun font-setting-handle-config-changed-event (event)
"Handle config-changed-event to change fonts on the display in EVENT.
If `font-use-system-font' is nil, the font is not changed."
(defun dynamic-setting-handle-config-changed-event (event)
"Handle config-changed-event on the display in EVENT.
Changes can be
The monospace font. If `font-use-system-font' is nil, the font
is not changed.
Xft parameters, like DPI and hinting.
The tool bar style."
(interactive "e")
(let ((type (nth 1 event)) ;; font-name or font-render
(let ((type (nth 1 event))
(display-name (nth 2 event)))
(if (or (not (eq type 'font-name))
font-use-system-font)
(font-setting-change-default-font display-name
(eq type 'font-name)))))
(cond ((and (eq type 'monospace-font-name) font-use-system-font)
(font-setting-change-default-font display-name t))
(if (or (featurep 'system-font-setting) (featurep 'font-render-setting))
(define-key special-event-map [config-changed-event]
'font-setting-handle-config-changed-event))
((eq type 'font-render)
(font-setting-change-default-font display-name nil))
(provide 'font-setting)
((eq type 'tool-bar-style) (force-mode-line-update t)))))
(define-key special-event-map [config-changed-event]
'dynamic-setting-handle-config-changed-event)
;; arch-tag: 3a57e78f-1cd6-48b6-ab75-98f160dcc017
......@@ -3736,9 +3736,11 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
(defvar info-tool-bar-map
(let ((map (make-sparse-keymap)))
(tool-bar-local-item-from-menu 'Info-history-back "left-arrow" map Info-mode-map
:rtl "right-arrow")
:rtl "right-arrow"
:label "Back")
(tool-bar-local-item-from-menu 'Info-history-forward "right-arrow" map Info-mode-map
:rtl "left-arrow")
:rtl "left-arrow"
:label "Forward")
(tool-bar-local-item-from-menu 'Info-prev "prev-node" map Info-mode-map
:rtl "next-node")
(tool-bar-local-item-from-menu 'Info-next "next-node" map Info-mode-map
......@@ -3746,7 +3748,8 @@ If FORK is non-nil, it is passed to `Info-goto-node'."
(tool-bar-local-item-from-menu 'Info-up "up-node" map Info-mode-map)
(tool-bar-local-item-from-menu 'Info-top-node "home" map Info-mode-map)
(tool-bar-local-item-from-menu 'Info-goto-node "jump-to" map Info-mode-map)
(tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map)
(tool-bar-local-item-from-menu 'Info-index "index" map Info-mode-map
:label "Index Search")
(tool-bar-local-item-from-menu 'Info-search "search" map Info-mode-map)
(tool-bar-local-item-from-menu 'Info-exit "exit" map Info-mode-map)
map))
......
......@@ -203,8 +203,8 @@
(load "dnd")
(load "tool-bar")))
(if (or (featurep 'system-font-setting) (featurep 'font-render-setting))
(load "font-setting"))
(if (featurep 'dynamic-setting)
(load "dynamic-setting"))
(if (featurep 'x)
(progn
......
......@@ -267,7 +267,7 @@ holds a keymap."
;; 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")
(tool-bar-add-item-from-menu 'find-file "new" nil :label "New File")
(tool-bar-add-item-from-menu 'menu-find-file-existing "open")
(tool-bar-add-item-from-menu 'dired "diropen")
(tool-bar-add-item-from-menu 'kill-this-buffer "close")
......@@ -294,14 +294,15 @@ holds a keymap."
"paste" nil
:visible '(not (eq 'special (get major-mode
'mode-class))))
(tool-bar-add-item-from-menu 'nonincremental-search-forward "search")
(tool-bar-add-item-from-menu 'nonincremental-search-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
;; than a lambda for Read Mail.
;;(tool-bar-add-item-from-menu 'compose-mail "mail/compose")
(tool-bar-add-item-from-menu 'print-buffer "print")
(tool-bar-add-item-from-menu 'print-buffer "print" nil :label "Print")
;; tool-bar-add-item-from-menu itself operates on
;; (default-value 'tool-bar-map), but when we don't use that function,
......
......@@ -301,7 +301,8 @@ If BODY uses EVENT, it should be a variable,
map vc-dir-mode-map)
(tool-bar-local-item "bookmark_add"
'vc-dir-toggle-mark 'vc-dir-toggle-mark map
:help "Toggle mark on current item")
:help "Toggle mark on current item"
:label "Toggle Mark")
(tool-bar-local-item-from-menu 'vc-dir-previous-line "left-arrow"
map vc-dir-mode-map
:rtl "right-arrow")
......@@ -313,11 +314,14 @@ If BODY uses EVENT, it should be a variable,
(tool-bar-local-item-from-menu 'revert-buffer "refresh"
map vc-dir-mode-map)
(tool-bar-local-item-from-menu 'nonincremental-search-forward
"search" map)
"search" map nil
:label "Search")
(tool-bar-local-item-from-menu 'vc-dir-query-replace-regexp
"search-replace" map vc-dir-mode-map)
"search-replace" map vc-dir-mode-map
:label "Replace")
(tool-bar-local-item-from-menu 'vc-dir-kill-dir-status-process "cancel"
map vc-dir-mode-map)
map vc-dir-mode-map
:label "Cancel")
(tool-bar-local-item-from-menu 'quit-window "exit"
map vc-dir-mode-map)
map))
......
2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
* xsettings.c: Qmonospace_font_name, Qtool_bar_style and
current_tool_bar_style are new.
(store_config_changed_event): Rename from store_font_changed_event.
(XSETTINGS_TOOL_BAR_STYLE): New define.
(SEEN_FONT, SEEN_TB_STYLE): New enum values.
(struct xsettings): Add font and tb_style, set xft stuff inside #ifdef
HAVE_XFT.
(something_changedCB): store_font_changed_event is now
store_config_changed_event
(parse_settings): Rename from parse_xft_settings. Read
non-xft xsettings outside #ifdef HAVE_XFT.
(read_settings): Renamed from read_xft_settings.
(apply_xft_settings): Take current settings as parameter. Do not
call read_(xft)_settings.
(read_and_apply_settings): New function.
(xft_settings_event): Do non-xft stuff out of HAVE_XFT. Call
read_and_apply_settings if there are settings to be read.
(init_xsettings): Renamed from init_xfd_settings.
Call read_and_apply_settings unconditionally.
(xsettings_initialize): Call init_xsettings.
(Ftool_bar_get_system_style): New function.
(syms_of_xsettings): Define Qmonospace_font_name and
Qtool_bar_style. Initialize current_tool_bar_style to nil.
defsubr Stool_bar_get_system_style. Fprovide on
dynamic-setting.
* xsettings.h (Ftool_bar_get_system_style): Declare.
* xdisp.c: Vtool_bar_style, tool_bar_max_label_size,
Qtext, Qboth, Qboth_horiz are new.
(syms_of_xdisp): Intern Qtext, Qboth, Qboth_horiz, DEFVAR
Vtool_bar_style, tool_bar_max_label_size.
* lisp.h: Extern declare Qtext, Qboth, Qboth_horiz.
* keyboard.c: QClabel is new.
(parse_tool_bar_item): Take out QClabel from tool bar items.
Try to construct a label if ther is no QClabel.
(syms_of_keyboard): Intern :label as QClabel.
* dispextern.h (tool_bar_item_idx): TOOL_BAR_ITEM_LABEL is new.
(Vtool_bar_style, tool_bar_max_label_size, DEFAULT_TOOL_BAR_LABEL_SIZE):
New.
* Makefile.in (SOME_MACHINE_LISP): font-setting.el renamed to
dynamic-setting.el.
* gtkutil.c (xg_tool_bar_menu_proxy): Handle label in tool bar item.
(xg_make_tool_item, xg_show_toolbar_item): New function.
(update_frame_tool_bar): Take label from TOOL_BAR_ITEM_LABEL.
Call xg_make_tool_item to make a tool bar item.
Call xg_show_toolbar_item. Use wtoolbar instead of x->toolbar_widget.
* xterm.c (x_draw_image_relief): Take Vtool_bar_button_margin
into account for toolbars.
2010-04-21 Jan Djärv <jan.h.d@swipnet.se>
* data.c (make_blv): Declarations before code (Bug#5993).
......
......@@ -566,7 +566,7 @@ otherobj= $(termcapobj) lastfile.o $(mallocobj) $(widgetobj) $(LIBOBJS)
${lispsource}international/fontset.elc ${lispsource}dnd.elc \
${lispsource}tool-bar.elc ${lispsource}mwheel.elc ${lispsource}x-dnd.elc \
${lispsource}term/common-win.elc ${lispsource}term/x-win.elc \
${lispsource}font-setting.elc
${lispsource}dynamic-setting.elc
#else
#define WINDOW_SUPPORT ${lispsource}fringe.elc ${lispsource}image.elc \
${lispsource}international/fontset.elc ${lispsource}dnd.elc \
......@@ -801,7 +801,7 @@ SOME_MACHINE_LISP = ../lisp/mouse.elc \
../lisp/tooltip.elc ../lisp/image.elc \
../lisp/fringe.elc ../lisp/dnd.elc \
../lisp/mwheel.elc ../lisp/tool-bar.elc \
../lisp/x-dnd.elc ../lisp/font-setting.elc \
../lisp/x-dnd.elc ../lisp/dynamic-setting.elc \
../lisp/international/ccl.elc \
../lisp/international/fontset.elc \
../lisp/mouse.elc \
......
......@@ -2793,6 +2793,9 @@ enum tool_bar_item_idx
/* Icon file name of right to left image when an RTL locale is used. */
TOOL_BAR_ITEM_RTL_IMAGE,
/* Label to show when text labels are enabled. */
TOOL_BAR_ITEM_LABEL,
/* Sentinel = number of slots in tool_bar_items occupied by one
tool-bar item. */
TOOL_BAR_ITEM_NSLOTS
......@@ -2814,6 +2817,15 @@ enum tool_bar_item_image
extern Lisp_Object Vtool_bar_button_margin;
/* Tool bar style */
extern Lisp_Object Vtool_bar_style;
/* Maximum number of characters a label can have to be shown. */
extern EMACS_INT tool_bar_max_label_size;
#define DEFAULT_TOOL_BAR_LABEL_SIZE 14
/* Thickness of relief to draw around tool-bar buttons. */
extern EMACS_INT tool_bar_button_relief;
......
This diff is collapsed.
......@@ -496,7 +496,7 @@ Lisp_Object Qevent_symbol_elements;
/* menu item parts */
Lisp_Object Qmenu_enable;
Lisp_Object QCenable, QCvisible, QChelp, QCfilter, QCkeys, QCkey_sequence;
Lisp_Object QCbutton, QCtoggle, QCradio;
Lisp_Object QCbutton, QCtoggle, QCradio, QClabel;
extern Lisp_Object Qmenu_item;
/* An event header symbol HEAD may have a property named
......@@ -8248,7 +8248,11 @@ process_tool_bar_item (key, def, data, args)
- `:help HELP-STRING'.
Gives a help string to display for the tool bar item. */
Gives a help string to display for the tool bar item.
- `:label LABEL-STRING'.
A text label to show with the tool bar button if labels are enabled. */
static int
parse_tool_bar_item (key, item)
......@@ -8259,7 +8263,7 @@ parse_tool_bar_item (key, item)
Lisp_Object filter = Qnil;
Lisp_Object caption;
int i;
int i, have_label = 0;
/* Defininition looks like `(menu-item CAPTION BINDING PROPS...)'.
Rule out items that aren't lists, don't start with
......@@ -8337,6 +8341,12 @@ parse_tool_bar_item (key, item)
else if (EQ (key, QChelp))
/* `:help HELP-STRING'. */
PROP (TOOL_BAR_ITEM_HELP) = value;
else if (EQ (key, QClabel))
{
/* `:label LABEL-STRING'. */
PROP (TOOL_BAR_ITEM_LABEL) = value;
have_label = 1;
}
else if (EQ (key, QCfilter))
/* ':filter FORM'. */
filter = value;
......@@ -8364,6 +8374,49 @@ parse_tool_bar_item (key, item)
PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value;
}
if (!have_label)
{
/* Try to make one from caption and key. */
Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY);
Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION);
char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : "";
char *caption = STRINGP (capt) ? (char *) SDATA (capt) : "";
char buf[64];
EMACS_INT max_lbl = 2*tool_bar_max_label_size;
Lisp_Object new_lbl;
if (strlen (caption) < max_lbl && caption[0] != '\0')
{
strcpy (buf, caption);
while (buf[0] != '\0' && buf[strlen (buf) -1] == '.')
buf[strlen (buf)-1] = '\0';
if (strlen (buf) <= max_lbl)
caption = buf;
}
if (strlen (caption) <= max_lbl)
label = caption;
if (strlen (label) <= max_lbl && label[0] != '\0')
{
int i;
if (label != buf) strcpy (buf, label);
for (i = 0; i < strlen (buf); ++i)
{
if (buf[i] == '-') buf[i] = ' ';
}
label = buf;
}
else label = "";
new_lbl = Fupcase_initials (make_string (label, strlen (label)));
if (SCHARS (new_lbl) <= tool_bar_max_label_size)
PROP (TOOL_BAR_ITEM_LABEL) = new_lbl;
}
/* If got a filter apply it on binding. */
if (!NILP (filter))
PROP (TOOL_BAR_ITEM_BINDING)
......@@ -11699,6 +11752,8 @@ syms_of_keyboard ()
staticpro (&QCtoggle);
QCradio = intern_c_string (":radio");
staticpro (&QCradio);
QClabel = intern_c_string (":label");
staticpro (&QClabel);
Qmode_line = intern_c_string ("mode-line");
staticpro (&Qmode_line);
......
......@@ -2635,7 +2635,7 @@ extern Lisp_Object Qinhibit_point_motion_hooks;
extern Lisp_Object Qinhibit_redisplay, Qdisplay;
extern Lisp_Object Qinhibit_eval_during_redisplay;
extern Lisp_Object Qmessage_truncate_lines;
extern Lisp_Object Qimage;
extern Lisp_Object Qimage, Qtext, Qboth, Qboth_horiz;
extern Lisp_Object Vmessage_log_max;
extern int message_enable_multibyte;
extern Lisp_Object echo_area_buffer[2];
......
......@@ -357,6 +357,14 @@ EMACS_INT tool_bar_button_relief;
Lisp_Object Vauto_resize_tool_bars;
/* Type of tool bar. Can be symbols image, text, both or both-hroiz. */
Lisp_Object Vtool_bar_style;
/* Maximum number of characters a label can have to be shown. */
EMACS_INT tool_bar_max_label_size;
/* Non-zero means draw block and hollow cursor as wide as the glyph
under it. For example, if a block cursor is over a tab, it will be
drawn as wide as that tab on the display. */
......@@ -442,7 +450,7 @@ Lisp_Object Qescape_glyph;
Lisp_Object Qnobreak_space;
/* The symbol `image' which is the car of the lists used to represent
images in Lisp. */
images in Lisp. Also a tool bar style. */
Lisp_Object Qimage;
......@@ -450,6 +458,9 @@ Lisp_Object Qimage;
Lisp_Object QCmap, QCpointer;
Lisp_Object Qrect, Qcircle, Qpoly;
/* Tool bar styles */
Lisp_Object Qtext, Qboth, Qboth_horiz;
/* Non-zero means print newline to stdout before next mini-buffer
message. */
......@@ -25781,6 +25792,12 @@ syms_of_xdisp ()
staticpro (&Qnobreak_space);
Qimage = intern_c_string ("image");
staticpro (&Qimage);
Qtext = intern_c_string ("text");
staticpro (&Qtext);
Qboth = intern_c_string ("both");
staticpro (&Qboth);
Qboth_horiz = intern_c_string ("both-horiz");
staticpro (&Qboth_horiz);
QCmap = intern_c_string (":map");
staticpro (&QCmap);
QCpointer = intern_c_string (":pointer");
......@@ -26121,6 +26138,22 @@ vertical margin. */);
doc: /* *Relief thickness of tool-bar buttons. */);
tool_bar_button_relief = DEFAULT_TOOL_BAR_BUTTON_RELIEF;
DEFVAR_LISP ("tool-bar-style", &Vtool_bar_style,
doc: /* *Tool bar style to use.
It can be one of
image - show images only
text - show text only
both - show both, text under image
both-horiz - show text to the right of the image
any other - use system default or image if no system default. */);
Vtool_bar_style = Qnil;
DEFVAR_INT ("tool-bar-max-label-size", &tool_bar_max_label_size,
doc: /* *Maximum number of characters a label can have to be shown.
The tool bar style must also show labels for this to have any effect, see
`tool-bar-style'. */);
tool_bar_max_label_size = DEFAULT_TOOL_BAR_LABEL_SIZE;
DEFVAR_LISP ("fontification-functions", &Vfontification_functions,
doc: /* List of functions to call to fontify regions of text.
Each function is called with one argument POS. Functions must
......
This diff is collapsed.
......@@ -22,6 +22,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
EXFUN (Ffont_get_system_font, 0);
EXFUN (Ffont_get_system_normal_font, 0);
EXFUN (Ftool_bar_get_system_style, 0);
extern void xsettings_initialize P_ ((struct x_display_info *dpyinfo));
extern void xft_settings_event P_ ((struct x_display_info *dpyinfo,
......
......@@ -2322,10 +2322,13 @@ x_draw_image_relief (s)
raised_p = s->img->relief > 0;
}
x0 = x - thick;
y0 = y - thick;
x1 = x + s->slice.width + thick - 1;
y1 = y + s->slice.height + thick - 1;
int extra = s->face->id == TOOL_BAR_FACE_ID
? XINT (Vtool_bar_button_margin) : 0;
x0 = x - thick - extra;
y0 = y - thick - extra;
x1 = x + s->slice.width + thick - 1 + extra;
y1 = y + s->slice.height + thick - 1 + extra;
x_setup_relief_colors (s);
get_glyph_string_clip_rect (s, &r);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment