GtkNamingSpecInvestigation

As of today Gtk is the only component that blocks us from GNOME having compatibility with freedesktop compliant icon themes without a huge workaround (read icon-naming-utilities). This is because Gtk doesn't look for the spec names first before falling back to its own names. It seems that Gtk can use a rethink of its icons as well.

This page is a result of a brief discussion with Mathias Clasen about potentially making this happen for Gtk3.

The freedesktop icon naming spec covers 82% of the icons found in gtk-2.20

Not yet covered

GTK_YES and GTK_NO

These should be deprecated for several reasons. The icons are red and green orbs and are hard to differentiate for people that are colourblind. Even more so because the have no distinct shapes. They are also often being abused as status icons. The most important reason to deprecate these is that they encourage developers to label buttons in the UI "Yes" and "No", which is very bad from a UI design perspective. Buttons should be named according to the actions they perform and the icons should match that description. Gtk should encourage good UI design by its own design.

GTK_OK

Should be deprecated. Same reasons as GTK_YES and NO.

GTK_INDEX

Should be deprecated because it represents a UI control. It's like having an icon for a button. It also has a hand in it which can make it problematic in some cultures.

GTK_SELECT_COLOR

Should be deprecated because it represents a UI control. See GTK_INDEX. Also, GTK_COLOR_PICKER seems almost the same.

GTK_APPLY

GTK_CANCEL

GTK_CONVERT

GTK_CONNECT

GTK_DISCONNECT

GTK_DND

GTK_DND_MULTIPLE

Shouldn't these be handled by the cursor theme? The icon doesn't necessarily represent the content that is being dragged.

GTK_EDIT

GTK_PRINT_PAUSED

GTK_PRINT_WARNING

GTK_UNDELETE

Things that can be picked up by the naming spec

Potentially GTK_ORIENTATION_* and GTK_CAPS_LOCK_WARNING. ...

Compatibility list

help-about

GTK_STOCK_ABOUT

list-add

GTK_STOCK_ADD

*deprecate*

GTK_STOCK_APPLY

format-text-bold

GTK_STOCK_BOLD

GTK_STOCK_CANCEL

GTK_CAPS_LOCK_WARNING

media-optical

GTK_STOCK_CDROM

edit-clear

GTK_STOCK_CLEAR

window-close

GTK_STOCK_CLOSE

GTK_STOCK_COLOR_PICKER

GTK_STOCK_CONVERT

GTK_STOCK_CONNECT

edit-copy

GTK_STOCK_COPY

edit-cut

GTK_STOCK_CUT

edit-delete

GTK_STOCK_DELETE

dialog-password

GTK_STOCK_DIALOG_AUTHENTICATION

dialog-error

GTK_STOCK_DIALOG_ERROR

dialog-info

GTK_STOCK_DIALOG_INFO

dialog-question

GTK_STOCK_DIALOG_QUESTION

dialog-warning

GTK_STOCK_DIALOG_WARNING

folder

GTK_STOCK_DIRECTORY

GTK_STOCK_DISCONNECT

GTK_STOCK_DND

GTK_STOCK_DND_MULTIPLE

GTK_STOCK_EDIT

system-run

GTK_STOCK_EXECUTE

document-x-generic

GTK_STOCK_FILE

edit-find

GTK_STOCK_FIND

edit-find-replace

GTK_STOCK_FIND_AND_REPLACE

media-floppy

GTK_STOCK_FLOPPY

view-fullscreen

GTK_STOCK_FULLSCREEN

go-bottom

GTK_STOCK_GOTO_BOTTOM

go-first

GTK_STOCK_GOTO_FIRST

go-last

GTK_STOCK_GOTO_LAST

go-top

GTK_STOCK_GOTO_TOP

go-previous

GTK_STOCK_GO_BACK

go-down

GTK_STOCK_GO_DOWN

go-next

GTK_STOCK_GO_FORWARD

go-up

GTK_STOCK_GO_UP

drive-harddisk

GTK_STOCK_HARDDISK

help-contents

GTK_STOCK_HELP

go-home

GTK_STOCK_HOME

format-indent-more

GTK_STOCK_INDENT

GTK_STOCK_INDEX

dialog-info

GTK_STOCK_INFO

format-text-italic

GTK_STOCK_ITALIC

go-jump

GTK_STOCK_JUMP_TO

format-justify-center

GTK_STOCK_JUSTIFY_CENTER

format-justify-fill

GTK_STOCK_JUSTIFY_FILL

format-justify-left

GTK_STOCK_JUSTIFY_LEFT

format-justify-right

GTK_STOCK_JUSTIFY_RIGHT

view-restore

GTK_STOCK_LEAVE_FULLSCREEN

media-seek-forward

GTK_STOCK_MEDIA_FORWARD

media-skip-forward

GTK_STOCK_MEDIA_NEXT

media-playback-pause

GTK_STOCK_MEDIA_PAUSE

media-playback-start

GTK_STOCK_MEDIA_PLAY

media-skip-backward

GTK_STOCK_MEDIA_PREVIOUS

media-record

GTK_STOCK_MEDIA_RECORD

media-seek-backward

GTK_STOCK_MEDIA_REWIND

media-playback-stop

GTK_STOCK_MEDIA_STOP

image-missing

GTK_STOCK_MISSING_IMAGE

network-idle

GTK_STOCK_NETWORK

document-new

GTK_STOCK_NEW

*deprecate*

GTK_STOCK_NO

*deprecate*

GTK_STOCK_OK

document-open

GTK_STOCK_OPEN

GTK_STOCK_ORIENTATION_LANDSCAPE

GTK_STOCK_ORIENTATION_PORTRAIT

GTK_STOCK_ORIENTATION_REVERSE_LANDSCAPE

GTK_STOCK_ORIENTATION_REVERSE_PORTRAIT

document-properties

GTK_STOCK_PAGE_SETUP

edit-paste

GTK_STOCK_PASTE

edit-preferences

GTK_STOCK_PREFERENCES

document-print

GTK_STOCK_PRINT

printer-error

GTK_STOCK_PRINT_ERROR

GTK_STOCK_PRINT_PAUSED

document-print-preview

GTK_STOCK_PRINT_PREVIEW

GTK_STOCK_PRINT_REPORT

GTK_STOCK_PRINT_WARNING

document-properties

GTK_STOCK_PROPERTIES

application-exit

GTK_STOCK_QUIT

edit-redo

GTK_STOCK_REDO

view-refresh

GTK_STOCK_REFRESH

list-remove

GTK_STOCK_REMOVE

document-revert

GTK_STOCK_REVERT_TO_SAVED

document-save

GTK_STOCK_SAVE

document-save-as

GTK_STOCK_SAVE_AS

edit-select-all

GTK_STOCK_SELECT_ALL

GTK_STOCK_SELECT_COLOR

preferences-desktop-font

GTK_STOCK_SELECT_FONT

view-sort-ascending

GTK_STOCK_SORT_ASCENDING

view-sort-descending

GTK_STOCK_SORT_DESCENDING

tools-check-spelling

GTK_STOCK_SPELL_CHECK

process-stop

GTK_STOCK_STOP

format-text-strikethrough

GTK_STOCK_STRIKETHROUGH

GTK_STOCK_UNDELETE

format-text-underline

GTK_STOCK_UNDERLINE

edit-undo

GTK_STOCK_UNDO

formar-indent-less

GTK_STOCK_UNINDENT

*deprecate*

GTK_STOCK_YES

zoom-original

GTK_STOCK_ZOOM_100

zoom-fit-best

GTK_STOCK_ZOOM_FIT

zoom-in

GTK_STOCK_ZOOM_IN

zoom-out

GTK_STOCK_ZOOM_OUT

Comments

The GTK_STOCK names are defines in the GTK+ headers, which means that the actual strings are compiled into millions of binaries out in the wild. Therefore, any solution will have to keep the old names working. This could be done in different ways, but any solution will likely involve some form of name mapping table inside GTK+.

The "gtk-stock-..." strings are also used in theme rc files to override stock icons. See e.g. /usr/share/themes/HighContrast/gtk/gtkrc.

Another point to consider is that currently, apps can look up the GTK_STOCK names in the icon theme (e.g. via gtk_icon_theme api) and expect that to work. If the symlinks are removed, that might no longer work (depending on where the mapping table is applied).

Yet another complication is that GTK+'s stock system has a concept of RTL variants (i.e. stock icons may change depending on the text direction). The icon theme spec has nothing comparable. Currently, GTK+ looks for foobar-rtl and foobar-ltr icon names in the theme when dealing with stock icons that have directional variants.

  • I'm all for supporting these in gnome-icon-theme and the spec.

Some comments on the uncovered icons:

  • GTK_INDEX: I don't think it represents a UI control. It represents a document part (the index). I agree the body part is problematic.
    • * Ok, but I've only seen it being used to refer to list widgets or sidebars. Which is of course a fault by the app but they think the stock icon is to be ised for this it's worth reconsidering shipping it. -hbons
  • GTK_SELECT_COLOR: This goes together with GTK_SELECT_FONT. Both are meant for toolbar buttons that bring up the corresponding dialog. Again agreed that the body part should go.
  • GTK_COLOR_PICKER: Not really similar to GTK_SELECT_COLOR. This is used for the 'color picker' button in the color selection dialog, and should be similar to the color-picker cursor in the cursor theme
  • GTK_DISCARD: This is just a stock item without an icon (GTK+ has a few of these)
  • GTK_DND, GTK_DND_MULTIPLE: These are the default drag icons used if an app does not provide its own. The drag icons represent the dragged content, and are not the same as the drag cursors. These should be generic 'document' or 'multiple documents' icons, and imo there should be standard icon names for this.

Attic/GtkNamingSpecInvestigation (last edited 2013-11-23 00:06:12 by WilliamJonMcCann)