gimp r26710 - in trunk: . app/actions app/dialogs app/widgets
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26710 - in trunk: . app/actions app/dialogs app/widgets
- Date: Fri, 22 Aug 2008 08:57:11 +0000 (UTC)
Author: neo
Date: Fri Aug 22 08:57:11 2008
New Revision: 26710
URL: http://svn.gnome.org/viewvc/gimp?rev=26710&view=rev
Log:
2008-08-22 Sven Neumann <sven gimp org>
* app/widgets/gimpaction.c
* app/widgets/gimpdockable.c
* app/widgets/gimpradioaction.c
* app/widgets/gimpstringaction.c
* app/widgets/gimptoggleaction.c: added basic support for icon
names for actions and dockables. Uses the stock-id as icon name
if the icon theme provides an icon under this name.
* app/dialogs/dialogs.c
* app/actions/documents-actions.c
* app/actions/dialogs-actions.c: use the "document-open-recent"
icon for the document history.
Modified:
trunk/ChangeLog
trunk/app/actions/dialogs-actions.c
trunk/app/actions/documents-actions.c
trunk/app/dialogs/dialogs.c
trunk/app/widgets/gimpaction.c
trunk/app/widgets/gimpdockable.c
trunk/app/widgets/gimpradioaction.c
trunk/app/widgets/gimpstringaction.c
trunk/app/widgets/gimptoggleaction.c
Modified: trunk/app/actions/dialogs-actions.c
==============================================================================
--- trunk/app/actions/dialogs-actions.c (original)
+++ trunk/app/actions/dialogs-actions.c Fri Aug 22 08:57:11 2008
@@ -173,7 +173,7 @@
"gimp-image-list|gimp-image-grid",
GIMP_HELP_IMAGE_DIALOG },
- { "dialogs-document-history", GTK_STOCK_OPEN,
+ { "dialogs-document-history", "document-open-recent",
N_("Document Histor_y"), "",
N_("Open the document history dialog"),
"gimp-document-list|gimp-document-grid",
Modified: trunk/app/actions/documents-actions.c
==============================================================================
--- trunk/app/actions/documents-actions.c (original)
+++ trunk/app/actions/documents-actions.c Fri Aug 22 08:57:11 2008
@@ -38,7 +38,7 @@
static const GimpActionEntry documents_actions[] =
{
- { "documents-popup", GTK_STOCK_OPEN,
+ { "documents-popup", "document-open-recent",
N_("Documents Menu"), NULL, NULL, NULL,
GIMP_HELP_DOCUMENT_DIALOG },
@@ -48,13 +48,13 @@
G_CALLBACK (documents_open_cmd_callback),
GIMP_HELP_DOCUMENT_OPEN },
- { "documents-raise-or-open", GTK_STOCK_OPEN,
+ { "documents-raise-or-open", NULL,
N_("_Raise or Open Image"), "",
N_("Raise window if already open"),
G_CALLBACK (documents_raise_or_open_cmd_callback),
GIMP_HELP_DOCUMENT_OPEN },
- { "documents-file-open-dialog", GTK_STOCK_OPEN,
+ { "documents-file-open-dialog", NULL,
N_("File Open _Dialog"), "",
N_("Open image dialog"),
G_CALLBACK (documents_file_open_dialog_cmd_callback),
@@ -84,13 +84,13 @@
G_CALLBACK (documents_recreate_preview_cmd_callback),
GIMP_HELP_DOCUMENT_REFRESH },
- { "documents-reload-previews", GTK_STOCK_REFRESH,
+ { "documents-reload-previews", NULL,
N_("Reload _all Previews"), "",
N_("Reload all previews"),
G_CALLBACK (documents_reload_previews_cmd_callback),
GIMP_HELP_DOCUMENT_REFRESH },
- { "documents-remove-dangling", GTK_STOCK_REFRESH,
+ { "documents-remove-dangling", NULL,
N_("Remove Dangling E_ntries"), "",
N_("Remove dangling entries"),
G_CALLBACK (documents_remove_dangling_cmd_callback),
Modified: trunk/app/dialogs/dialogs.c
==============================================================================
--- trunk/app/dialogs/dialogs.c (original)
+++ trunk/app/dialogs/dialogs.c Fri Aug 22 08:57:11 2008
@@ -168,7 +168,7 @@
GIMP_HELP_TOOLS_DIALOG, GIMP_VIEW_SIZE_SMALL),
LISTGRID (buffer, N_("Buffers"), NULL, GIMP_STOCK_BUFFER,
GIMP_HELP_BUFFER_DIALOG, GIMP_VIEW_SIZE_MEDIUM),
- LISTGRID (document, N_("History"), N_("Document History"), GTK_STOCK_OPEN,
+ LISTGRID (document, N_("History"), N_("Document History"), "document-open-recent",
GIMP_HELP_DOCUMENT_DIALOG, GIMP_VIEW_SIZE_LARGE),
LISTGRID (template, N_("Templates"), N_("Image Templates"), GIMP_STOCK_TEMPLATE,
GIMP_HELP_TEMPLATE_DIALOG, GIMP_VIEW_SIZE_SMALL),
Modified: trunk/app/widgets/gimpaction.c
==============================================================================
--- trunk/app/widgets/gimpaction.c (original)
+++ trunk/app/widgets/gimpaction.c Fri Aug 22 08:57:11 2008
@@ -278,12 +278,22 @@
const gchar *tooltip,
const gchar *stock_id)
{
- return g_object_new (GIMP_TYPE_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
- NULL);
+ GimpAction *action;
+
+ action = g_object_new (GIMP_TYPE_ACTION,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "stock-id", stock_id,
+ NULL);
+
+ if (stock_id)
+ {
+ if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
+ g_object_set (action, "icon-name", stock_id, NULL);
+ }
+
+ return action;
}
gint
Modified: trunk/app/widgets/gimpdockable.c
==============================================================================
--- trunk/app/widgets/gimpdockable.c (original)
+++ trunk/app/widgets/gimpdockable.c Fri Aug 22 08:57:11 2008
@@ -692,6 +692,21 @@
}
static GtkWidget *
+gimp_dockable_get_icon (GimpDockable *dockable,
+ GtkIconSize size)
+{
+ GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (dockable));
+ GtkIconTheme *theme = gtk_icon_theme_get_for_screen (screen);
+
+ if (gtk_icon_theme_has_icon (theme, dockable->stock_id))
+ {
+ return gtk_image_new_from_icon_name (dockable->stock_id, size);
+ }
+
+ return gtk_image_new_from_stock (dockable->stock_id, size);
+}
+
+static GtkWidget *
gimp_dockable_get_tab_widget_internal (GimpDockable *dockable,
GimpContext *context,
GimpTabStyle tab_style,
@@ -725,7 +740,7 @@
case GIMP_TAB_STYLE_ICON:
case GIMP_TAB_STYLE_ICON_NAME:
case GIMP_TAB_STYLE_ICON_BLURB:
- icon = gtk_image_new_from_stock (dockable->stock_id, size);
+ icon = gimp_dockable_get_icon (dockable, size);
break;
case GIMP_TAB_STYLE_PREVIEW:
@@ -739,7 +754,7 @@
context, size);
if (! icon)
- icon = gtk_image_new_from_stock (dockable->stock_id, size);
+ icon = gimp_dockable_get_icon (dockable, size);
}
break;
@@ -1213,6 +1228,17 @@
"visible", TRUE,
NULL);
+ if (dockable->stock_id)
+ {
+ if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (),
+ dockable->stock_id))
+ {
+ g_object_set (parent_menu_action,
+ "icon-name", dockable->stock_id,
+ NULL);
+ }
+ }
+
if (! GTK_IS_MENU (child_menu_widget))
{
g_warning ("%s: child_menu_widget (%p) is not a GtkMenu",
@@ -1222,8 +1248,8 @@
/* FIXME */
{
- GtkWidget *image = gtk_image_new_from_stock (dockable->stock_id,
- GTK_ICON_SIZE_MENU);
+ GtkWidget *image = gimp_dockable_get_icon (dockable,
+ GTK_ICON_SIZE_MENU);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (parent_menu_widget),
image);
Modified: trunk/app/widgets/gimpradioaction.c
==============================================================================
--- trunk/app/widgets/gimpradioaction.c (original)
+++ trunk/app/widgets/gimpradioaction.c Fri Aug 22 08:57:11 2008
@@ -80,13 +80,24 @@
const gchar *stock_id,
gint value)
{
- return g_object_new (GIMP_TYPE_RADIO_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
- "value", value,
- NULL);
+ GtkRadioAction *action;
+
+ action = g_object_new (GIMP_TYPE_RADIO_ACTION,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "value", value,
+ NULL);
+
+ if (stock_id)
+ {
+ if (gtk_icon_factory_lookup_default (stock_id))
+ g_object_set (action, "stock-id", stock_id, NULL);
+ else
+ g_object_set (action, "icon-name", stock_id, NULL);
+ }
+
+ return action;
}
Modified: trunk/app/widgets/gimpstringaction.c
==============================================================================
--- trunk/app/widgets/gimpstringaction.c (original)
+++ trunk/app/widgets/gimpstringaction.c Fri Aug 22 08:57:11 2008
@@ -158,13 +158,23 @@
const gchar *stock_id,
const gchar *value)
{
- return g_object_new (GIMP_TYPE_STRING_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
- "value", value,
- NULL);
+ GimpStringAction *action;
+
+ action = g_object_new (GIMP_TYPE_STRING_ACTION,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "stock-id", stock_id,
+ "value", value,
+ NULL);
+
+ if (stock_id)
+ {
+ if (gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), stock_id))
+ g_object_set (action, "icon-name", stock_id, NULL);
+ }
+
+ return action;
}
static void
Modified: trunk/app/widgets/gimptoggleaction.c
==============================================================================
--- trunk/app/widgets/gimptoggleaction.c (original)
+++ trunk/app/widgets/gimptoggleaction.c Fri Aug 22 08:57:11 2008
@@ -79,12 +79,24 @@
const gchar *tooltip,
const gchar *stock_id)
{
- return g_object_new (GIMP_TYPE_TOGGLE_ACTION,
- "name", name,
- "label", label,
- "tooltip", tooltip,
- "stock-id", stock_id,
- NULL);
+ GtkToggleAction *action;
+
+ action = g_object_new (GIMP_TYPE_TOGGLE_ACTION,
+ "name", name,
+ "label", label,
+ "tooltip", tooltip,
+ "stock-id", stock_id,
+ NULL);
+
+ if (stock_id)
+ {
+ if (gtk_icon_factory_lookup_default (stock_id))
+ g_object_set (action, "stock-id", stock_id, NULL);
+ else
+ g_object_set (action, "icon-name", stock_id, NULL);
+ }
+
+ return action;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]