[Top][All Lists]

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

Re: Using GNOME stock icons

From: Reiner Steib
Subject: Re: Using GNOME stock icons
Date: Wed, 28 Sep 2005 23:24:50 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

On Wed, Sep 28 2005, Richard M. Stallman wrote:

>     is it possible to use GNOME icons in Emacs or do we need a copyright
>     assignment?  I ask because I'd like to replace[1] the current Gnus
>     tool bar icons with some nicer icons from the default GNOME icon
>     theme.
>     [1] Or at least make it customizable.  
> We could use the icons, on the same basis that we use some free
> libraries that are not copyright FSF.  However, that is not the
> only possibility.  Another is to use them if GNOME is installed.

The GMOME icons are in PNG format.  Is it possible to use PNG in
Emacs' tool bar?  My tests didn't display the PNG images; I had to
convert them to XPM.

> Could you say more specifically what "customizable" means?  

Currently, the icons and corresponding functions are hard-coded (see
e.g. `gnus-summary-make-tool-bar').  With my code, the user can choose
between a few pre-defined set of icons and functions.  Or he can add
or remove icons/functions.

One pre-defined set could be the "GNOME style":

--8<---------------cut here---------------start------------->8---
(defcustom rs-gnus-summary-tool-bar-gnome
  '((gnus-summary-post-news "stock_mail-compose" t)
    (gnus-summary-reply-with-original "stock_mail-reply" t)
    (gnus-summary-mail-forward "stock_mail-forward" t)
    (gnus-info-find-node "help" t))
  "List of functions for the summary tool bar (GNOME style).

See `rs-gnus-summary-tool-bar' for details on the format of the list."
  :type '(repeat (list (function :tag "Menu Command")
                       (string   :tag "Icon file")
                       (choice :tag "Visibility"
                               (const :tag "Always" t)
                               (const :tag "Never" nil)
                               (function :tag "Test function"))))
  :group 'gnus-summary)
--8<---------------cut here---------------end--------------->8---

The variable `rs-gnus-summary-tool-bar' controls which set of
icons/functions is used.  In the following example, it defaults to the
GNOME style, but the user can easily switch between pre-defined sets
or define his own:

--8<---------------cut here---------------start------------->8---
(defcustom rs-gnus-summary-tool-bar 'rs-gnus-summary-tool-bar-gnome
  "Specifies the Gnus summary tool bar.

It can be either a list or a symbol refering to a list.

If it is a list, each element must be a list.  The first element
is a menu command, the second element is an icon file name and
the third element is a test function.

You can use \\[describe-key] <menu-entry> to find out the name of
a menu command.

Pre-defined symbols include `rs-gnus-summary-tool-bar-gnome' and
  :type '(choice (const :tag "Gnome style" rs-gnus-summary-tool-bar-gnome)
                 (const :tag "Retro look"  rs-gnus-summary-tool-bar-retro)
                 (repeat :tag "User defined list"
                         (list (function :tag "Menu Command")
                               (string   :tag "Icon file")
                               (choice :tag "Visibility"
                                       (const :tag "Always" t)
                                       (const :tag "Never" nil)
                                       (function :tag "Test function")))))
  :group 'gnus-summary)
--8<---------------cut here---------------end--------------->8---

(The doc string should probably be improved.  Of course I'll remove
the "rs-" prefix when I install it in Gnus.)

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]