emacs-devel
[Top][All Lists]
Advanced

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

Re: Gtk+ stock tool bar icons


From: Reiner Steib
Subject: Re: Gtk+ stock tool bar icons
Date: Sat, 29 Sep 2007 21:55:08 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

On Sat, Sep 29 2007, Jan Djärv wrote:

> Reiner Steib skrev:
>> - Is (setq x-gtk-stock-map nil) the recommended way to disable themed
>>   icons?  Shouldn't we provide this as a custom option (also in Emacs
>>   trunk) and mention it in NEWS?  (BTW, the custom version should read
>>   22.2 if we keep it in EMACS_22_BASE, shouldn't it?)
>
> The custom version should indeed be 22.2, I've fixed that.  If you think we
> need another customize option to disable this, please feel free to add it.

On a second thought: Maybe `icon-map-list' seems more suitable to
disable it.  How about making it `icon-map-list' customizable and
improving the custom type of `x-gtk-stock-map' as follows?

--8<---------------cut here---------------start------------->8---
--- x-win.el    29 Sep 2007 16:23:59 -0000      1.211
+++ x-win.el    29 Sep 2007 19:48:04 -0000
@@ -2592,11 +2592,14 @@
 Emacs must be compiled with the Gtk+ toolkit for this to have any effect.
 A value that begins with n: denotes a named icon instead of a stock icon."
   :version "22.2"
-  :type 'alist
+  :type '(choice (repeat (choice symbol
+                                (cons (string :tag "Emacs icon")
+                                      (regexp :tag "Stock/named")))))
+
   :group 'x)
 
-(defvar icon-map-list '(x-gtk-stock-map)
-  "*A list of alists that maps icon file names to stock/named icons.
+(defcustom icon-map-list '(x-gtk-stock-map)
+  "A list of alists that maps icon file names to stock/named icons.
 The alists are searched in the order they appear.  The first match is used.
 The keys in the alists are file names without extension and with two directory
 components.  For example, to map /usr/share/emacs/22.1.1/etc/images/open.xpm
@@ -2608,7 +2611,14 @@
 
   (\"etc/images/diropen\" . \"n:system-file-manager\")
 
-The list elements are either the symbol name for the alist or the alist 
itself.")
+The list elements are either the symbol name for the alist or the
+alist itself."
+  :version "22.2"
+  :type '(choice (const :tag "Don't use stock icons" nil)
+                (repeat (choice symbol
+                                (cons (string :tag "Emacs icon")
+                                      (regexp :tag "Stock/named")))))
+  :group 'x)
 
 (defun x-gtk-map-stock (file)
   "Map icon with file name FILE to a Gtk+ stock name, using `x-gtk-stock-map'."
--8<---------------cut here---------------end--------------->8---


>> - Is my patch [3] correct?
>
> No, the files should be "images/mail/...".

Are you saying without "etc/"?  I did it exactly like the present
elements:

     ("etc/images/search" . "gtk-find")
-    ("etc/images/exit" . "gtk-quit"))
+    ("etc/images/exit" . "gtk-quit")
+    ;; Used in MH-E and/or Gnus:
+    ("etc/images/attach.xpm" . "gtk-attach")
+    ("etc/images/connect.xpm" . "gtk-connect")

BTW, wouldn't it be better to strip "etc/images/" in the icon names
for consistency with the specification of the icons e.g. in
`tool-bar-add-item-from-menu' (cf. `image-load-path')?

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/




reply via email to

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