From 6762bf5b9be9eeb3a8f214647f1460152e227af1 Mon Sep 17 00:00:00 2001 From: Benoit Touchette Date: Tue, 8 Dec 2015 14:52:12 -0500 Subject: [PATCH] Bug 759105 - Patch to add icon theme selection Add support for custom icon themes much like custom theme support. There is still work to be done but this is the basic functionality. --- app/config/gimpguiconfig.c | 30 ++++ app/config/gimpguiconfig.h | 2 + app/config/gimprc-blurbs.h | 6 + app/core/gimp-gui.c | 12 ++ app/core/gimp-gui.h | 2 + app/core/gimp-user-install.c | 1 + app/dialogs/preferences-dialog.c | 112 ++++++++++++- app/gui/Makefile.am | 2 + app/gui/gui-vtable.c | 9 + app/gui/gui.c | 3 + app/gui/icon-themes.c | 261 +++++++++++++++++++++++++++++ app/gui/icon-themes.h | 34 ++++ app/widgets/gimphelp-ids.h | 2 + icons/16/gimp-prefs-icon-theme.png | Bin 0 -> 492 bytes icons/16/gimp-prefs-icon-theme.svg | 196 ++++++++++++++++++++++ icons/22/gimp-prefs-icon-theme.png | Bin 0 -> 653 bytes icons/22/gimp-prefs-icon-theme.svg | 202 ++++++++++++++++++++++ icons/Makefile.am | 30 ++-- libgimpwidgets/gimpstock.c | 7 +- 19 files changed, 895 insertions(+), 16 deletions(-) create mode 100644 app/gui/icon-themes.c create mode 100644 app/gui/icon-themes.h create mode 100644 icons/16/gimp-prefs-icon-theme.png create mode 100644 icons/16/gimp-prefs-icon-theme.svg create mode 100644 icons/22/gimp-prefs-icon-theme.png create mode 100644 icons/22/gimp-prefs-icon-theme.svg diff --git a/app/config/gimpguiconfig.c b/app/config/gimpguiconfig.c index 833cb0fd68..c11f6b434d 100644 --- a/app/config/gimpguiconfig.c +++ b/app/config/gimpguiconfig.c @@ -40,6 +40,7 @@ #endif #define DEFAULT_THEME "Default" +#define DEFAULT_ICON_THEME "Default" #define DEFAULT_USER_MANUAL_ONLINE_URI \ "http://docs.gimp.org/" GIMP_APP_VERSION_STRING @@ -69,6 +70,8 @@ enum PROP_TOOLBOX_WILBER, PROP_THEME_PATH, PROP_THEME, + PROP_ICON_THEME_PATH, + PROP_ICON_THEME, PROP_USE_HELP, PROP_SHOW_HELP_BUTTON, PROP_HELP_LOCALES, @@ -228,6 +231,17 @@ gimp_gui_config_class_init (GimpGuiConfigClass *klass) "theme", THEME_BLURB, DEFAULT_THEME, GIMP_PARAM_STATIC_STRINGS); + path = gimp_config_build_data_path ("icons"); + GIMP_CONFIG_INSTALL_PROP_PATH (object_class, PROP_ICON_THEME_PATH, + "icon-theme-path", ICON_THEME_PATH_BLURB, + GIMP_CONFIG_PATH_DIR_LIST, path, + GIMP_PARAM_STATIC_STRINGS | + GIMP_CONFIG_PARAM_RESTART); + g_free (path); + GIMP_CONFIG_INSTALL_PROP_STRING (object_class, PROP_ICON_THEME, + "icon-theme", ICON_THEME_BLURB, + DEFAULT_ICON_THEME, + GIMP_PARAM_STATIC_STRINGS); GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_USE_HELP, "use-help", USE_HELP_BLURB, TRUE, @@ -394,6 +408,8 @@ gimp_gui_config_finalize (GObject *object) g_free (gui_config->theme_path); g_free (gui_config->theme); + g_free (gui_config->icon_theme_path); + g_free (gui_config->icon_theme); g_free (gui_config->help_locales); g_free (gui_config->web_browser); g_free (gui_config->user_manual_online_uri); @@ -476,6 +492,14 @@ gimp_gui_config_set_property (GObject *object, g_free (gui_config->theme); gui_config->theme = g_value_dup_string (value); break; + case PROP_ICON_THEME_PATH: + g_free (gui_config->icon_theme_path); + gui_config->icon_theme_path = g_value_dup_string (value); + break; + case PROP_ICON_THEME: + g_free (gui_config->icon_theme); + gui_config->icon_theme = g_value_dup_string (value); + break; case PROP_USE_HELP: gui_config->use_help = g_value_get_boolean (value); break; @@ -625,6 +649,12 @@ gimp_gui_config_get_property (GObject *object, case PROP_THEME: g_value_set_string (value, gui_config->theme); break; + case PROP_ICON_THEME_PATH: + g_value_set_string (value, gui_config->icon_theme_path); + break; + case PROP_ICON_THEME: + g_value_set_string (value, gui_config->icon_theme); + break; case PROP_USE_HELP: g_value_set_boolean (value, gui_config->use_help); break; diff --git a/app/config/gimpguiconfig.h b/app/config/gimpguiconfig.h index 2452f3ed7e..642025db64 100644 --- a/app/config/gimpguiconfig.h +++ b/app/config/gimpguiconfig.h @@ -58,6 +58,8 @@ struct _GimpGuiConfig gboolean toolbox_wilber; gchar *theme_path; gchar *theme; + gchar *icon_theme_path; + gchar *icon_theme; gboolean use_help; gboolean show_help_button; gchar *help_locales; diff --git a/app/config/gimprc-blurbs.h b/app/config/gimprc-blurbs.h index 70e216a09f..76a4ab5fd2 100644 --- a/app/config/gimprc-blurbs.h +++ b/app/config/gimprc-blurbs.h @@ -431,6 +431,12 @@ _("Sets the folder for temporary storage. Files will appear here " \ #define THEME_PATH_BLURB \ "Sets the theme search path." +#define ICON_THEME_BLURB \ +"The name of the icon theme to use." + +#define ICON_THEME_PATH_BLURB \ +"Sets the icon theme search path." + #define THUMBNAIL_SIZE_BLURB \ _("Sets the size of the thumbnail shown in the Open dialog.") diff --git a/app/core/gimp-gui.c b/app/core/gimp-gui.c index 7ef7b5e706..2988ce612e 100644 --- a/app/core/gimp-gui.c +++ b/app/core/gimp-gui.c @@ -52,6 +52,7 @@ gimp_gui_init (Gimp *gimp) gimp->gui.get_display_name = NULL; gimp->gui.get_user_time = NULL; gimp->gui.get_theme_dir = NULL; + gimp->gui.get_icon_theme_dir = NULL; gimp->gui.display_get_by_id = NULL; gimp->gui.display_get_id = NULL; gimp->gui.display_get_window_id = NULL; @@ -266,6 +267,17 @@ gimp_get_theme_dir (Gimp *gimp) return NULL; } +GFile * +gimp_get_icon_theme_dir (Gimp *gimp) +{ + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (gimp->gui.get_icon_theme_dir) + return gimp->gui.get_icon_theme_dir (gimp); + + return NULL; +} + GimpObject * gimp_get_window_strategy (Gimp *gimp) { diff --git a/app/core/gimp-gui.h b/app/core/gimp-gui.h index 0f056a0eab..a485093037 100644 --- a/app/core/gimp-gui.h +++ b/app/core/gimp-gui.h @@ -49,6 +49,7 @@ struct _GimpGui guint32 (* get_user_time) (Gimp *gimp); GFile * (* get_theme_dir) (Gimp *gimp); + GFile * (* get_icon_theme_dir) (Gimp *gimp); GimpObject * (* get_window_strategy) (Gimp *gimp); GimpObject * (* get_empty_display) (Gimp *gimp); @@ -159,6 +160,7 @@ gchar * gimp_get_display_name (Gimp *gimp, gint *monitor); guint32 gimp_get_user_time (Gimp *gimp); GFile * gimp_get_theme_dir (Gimp *gimp); +GFile * gimp_get_icon_theme_dir (Gimp *gimp); gboolean gimp_pdb_dialog_new (Gimp *gimp, GimpContext *context, diff --git a/app/core/gimp-user-install.c b/app/core/gimp-user-install.c index a752cd66d8..c87484c0f2 100644 --- a/app/core/gimp-user-install.c +++ b/app/core/gimp-user-install.c @@ -102,6 +102,7 @@ gimp_user_install_items[] = { "scripts", USER_INSTALL_MKDIR }, { "templates", USER_INSTALL_MKDIR }, { "themes", USER_INSTALL_MKDIR }, + { "icons", USER_INSTALL_MKDIR }, { "tmp", USER_INSTALL_MKDIR }, { "curves", USER_INSTALL_MKDIR }, { "levels", USER_INSTALL_MKDIR }, diff --git a/app/dialogs/preferences-dialog.c b/app/dialogs/preferences-dialog.c index 5a2f278b41..49d6616233 100644 --- a/app/dialogs/preferences-dialog.c +++ b/app/dialogs/preferences-dialog.c @@ -60,6 +60,7 @@ #include "tools/gimp-tools.h" #include "gui/session.h" +#include "gui/icon-themes.h" #include "gui/themes.h" #include "preferences-dialog.h" @@ -723,7 +724,7 @@ prefs_theme_select_callback (GtkTreeSelection *sel, GValue val = { 0, }; gtk_tree_model_get_value (model, &iter, 0, &val); - g_object_set (gimp->config, "theme", g_value_get_string (&val), NULL); + g_object_set_property (G_OBJECT (gimp->config), "theme", &val); g_value_unset (&val); } } @@ -735,6 +736,24 @@ prefs_theme_reload_callback (GtkWidget *button, g_object_notify (G_OBJECT (gimp->config), "theme"); } +static void +prefs_icon_theme_select_callback (GtkTreeSelection *sel, + Gimp *gimp) +{ + GtkTreeModel *model; + GtkTreeIter iter; + + if (gtk_tree_selection_get_selected (sel, &model, &iter)) + { + GtkWidget *dialog; + GValue val = { 0, }; + + gtk_tree_model_get_value (model, &iter, 0, &val); + g_object_set_property (G_OBJECT (gimp->config), "icon-theme", &val); + g_value_unset (&val); + } +} + static GtkWidget * prefs_frame_new (const gchar *label, GtkContainer *parent, @@ -1661,6 +1680,97 @@ prefs_dialog_new (Gimp *gimp, gimp); + /****************/ + /* Icon Theme */ + /****************/ + pixbuf = prefs_get_pixbufs (dialog, "icon-theme", &small_pixbuf); + vbox = gimp_prefs_box_add_page (GIMP_PREFS_BOX (prefs_box), + _("Icon Theme"), + pixbuf, + NULL, + small_pixbuf, + GIMP_HELP_PREFS_ICON_THEME, + NULL, + &top_iter); + + vbox2 = prefs_frame_new (_("Select an Icon Theme"), GTK_CONTAINER (vbox), TRUE); + + { + GtkWidget *scrolled_win; + GtkListStore *list_store; + GtkWidget *view; + GtkTreeSelection *sel; + gchar **icon_themes; + gint n_icon_themes; + gint i; + + scrolled_win = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_set_size_request (scrolled_win, -1, 80); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win), + GTK_SHADOW_IN); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win), + GTK_POLICY_NEVER, + GTK_POLICY_AUTOMATIC); + gtk_box_pack_start (GTK_BOX (vbox2), scrolled_win, TRUE, TRUE, 0); + gtk_widget_show (scrolled_win); + + list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING); + + view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store)); + gtk_container_add (GTK_CONTAINER (scrolled_win), view); + gtk_widget_show (view); + + g_object_unref (list_store); + + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), 0, + _("Icon Theme"), + gtk_cell_renderer_text_new (), + "text", 0, + NULL); + gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (view), 1, + _("Folder"), + gtk_cell_renderer_text_new (), + "text", 1, + NULL); + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (view)); + + icon_themes = icon_themes_list_themes (gimp, &n_icon_themes); + + for (i = 0; i < n_icon_themes; i++) + { + GtkTreeIter iter; + GFile *icon_theme_dir = icon_themes_get_theme_dir (gimp, icon_themes[i]); + + gtk_list_store_append (list_store, &iter); + gtk_list_store_set (list_store, &iter, + 0, icon_themes[i], + 1, gimp_file_get_utf8_name (icon_theme_dir), + -1); + + if (GIMP_GUI_CONFIG (object)->icon_theme && + ! strcmp (GIMP_GUI_CONFIG (object)->icon_theme, icon_themes[i])) + { + GtkTreePath *path; + + path = gtk_tree_model_get_path (GTK_TREE_MODEL (list_store), &iter); + + gtk_tree_view_set_cursor (GTK_TREE_VIEW (view), path, NULL, FALSE); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (view), path, + NULL, FALSE, 0.0, 0.0); + + gtk_tree_path_free (path); + } + } + + g_strfreev (icon_themes); + + g_signal_connect (sel, "changed", + G_CALLBACK (prefs_icon_theme_select_callback), + gimp); + } + + /*****************/ /* Help System */ /*****************/ diff --git a/app/gui/Makefile.am b/app/gui/Makefile.am index a97a3cf5fd..0ea4d0d771 100644 --- a/app/gui/Makefile.am +++ b/app/gui/Makefile.am @@ -35,6 +35,8 @@ libappgui_a_sources = \ gui-vtable.c \ gui-vtable.h \ gui-types.h \ + icon-themes.c \ + icon-themes.h \ session.c \ session.h \ splash.c \ diff --git a/app/gui/gui-vtable.c b/app/gui/gui-vtable.c index 9a16bdc971..6a2d292a4e 100644 --- a/app/gui/gui-vtable.c +++ b/app/gui/gui-vtable.c @@ -81,6 +81,7 @@ #include "gui.h" #include "gui-message.h" #include "gui-vtable.h" +#include "icon-themes.h" #include "themes.h" @@ -105,6 +106,7 @@ static gchar * gui_get_display_name (Gimp *gimp, gint *monitor); static guint32 gui_get_user_time (Gimp *gimp); static GFile * gui_get_theme_dir (Gimp *gimp); +static GFile * gui_get_icon_theme_dir (Gimp *gimp); static GimpObject * gui_get_window_strategy (Gimp *gimp); static GimpObject * gui_get_empty_display (Gimp *gimp); static GimpObject * gui_display_get_by_ID (Gimp *gimp, @@ -176,6 +178,7 @@ gui_vtable_init (Gimp *gimp) gimp->gui.get_display_name = gui_get_display_name; gimp->gui.get_user_time = gui_get_user_time; gimp->gui.get_theme_dir = gui_get_theme_dir; + gimp->gui.get_icon_theme_dir = gui_get_icon_theme_dir; gimp->gui.get_window_strategy = gui_get_window_strategy; gimp->gui.get_empty_display = gui_get_empty_display; gimp->gui.display_get_by_id = gui_display_get_by_ID; @@ -306,6 +309,12 @@ gui_get_theme_dir (Gimp *gimp) return themes_get_theme_dir (gimp, GIMP_GUI_CONFIG (gimp->config)->theme); } +static GFile * +gui_get_icon_theme_dir (Gimp *gimp) +{ + return icon_themes_get_theme_dir (gimp, GIMP_GUI_CONFIG (gimp->config)->icon_theme); +} + static GimpObject * gui_get_window_strategy (Gimp *gimp) { diff --git a/app/gui/gui.c b/app/gui/gui.c index f3d7af5fe8..e2f44412b7 100644 --- a/app/gui/gui.c +++ b/app/gui/gui.c @@ -74,6 +74,7 @@ #include "gui.h" #include "gui-unique.h" #include "gui-vtable.h" +#include "icon-themes.h" #include "session.h" #include "splash.h" #include "themes.h" @@ -234,6 +235,8 @@ gui_init (Gimp *gimp, themes_init (gimp); + icon_themes_init (gimp); + initial_monitor = gimp_get_monitor_at_pointer (&initial_screen); gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (initial_screen)); diff --git a/app/gui/icon-themes.c b/app/gui/icon-themes.c new file mode 100644 index 0000000000..c148b529bf --- /dev/null +++ b/app/gui/icon-themes.c @@ -0,0 +1,261 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * icon-themes.c + * Copyright (C) 2015 Benoit Touchette + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include "config.h" + +#include + +#include +#include + +#include "libgimpbase/gimpbase.h" +#include "libgimpconfig/gimpconfig.h" +#include "libgimpwidgets/gimpwidgets.h" + +#include "gui-types.h" + +#include "config/gimpguiconfig.h" + +#include "core/gimp.h" + +#include "icon-themes.h" + +#include "gimp-intl.h" + + +static void icons_list_icons_foreach (gpointer key, + gpointer value, + gpointer data); +static gint icons_name_compare (const void *p1, + const void *p2); +static void icons_theme_change_notify (GimpGuiConfig *config, + GParamSpec *pspec, + Gimp *gimp); +void icons_set_icon_theme (GtkIconTheme *new_icon_theme); +static void icons_apply_theme (Gimp *gimp, + const gchar *icon_theme_name); + + +static GHashTable *icon_themes_hash = NULL; + + +void +icon_themes_init (Gimp *gimp) +{ + GimpGuiConfig *config; + + g_return_if_fail (GIMP_IS_GIMP (gimp)); + + config = GIMP_GUI_CONFIG (gimp->config); + + icon_themes_hash = g_hash_table_new_full (g_str_hash, + g_str_equal, + g_free, + g_object_unref); + + if (config->icon_theme_path) + { + GList *path; + GList *list; + + path = gimp_config_path_expand_to_files (config->icon_theme_path, NULL); + + for (list = path; list; list = g_list_next (list)) + { + GFile *dir = list->data; + GFileEnumerator *enumerator; + + enumerator = + g_file_enumerate_children (dir, + G_FILE_ATTRIBUTE_STANDARD_NAME "," + G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN "," + G_FILE_ATTRIBUTE_STANDARD_TYPE, + G_FILE_QUERY_INFO_NONE, + NULL, NULL); + + if (enumerator) + { + GFileInfo *info; + + while ((info = g_file_enumerator_next_file (enumerator, + NULL, NULL))) + { + if (! g_file_info_get_is_hidden (info) && + g_file_info_get_file_type (info) == G_FILE_TYPE_DIRECTORY) + { + GFile *file; + GFile *index_theme; + + file = g_file_enumerator_get_child (enumerator, info); + + /* make sure there is a index.theme file */ + index_theme = g_file_get_child (file, "index.theme"); + + if (index_theme) + { + const gchar *name; + gchar *basename; + + g_object_unref (index_theme); + + name = gimp_file_get_utf8_name (file); + basename = g_path_get_basename (name); + + if (gimp->be_verbose) + g_print ("Adding icon theme '%s' (%s)\n", + basename, name); + + g_hash_table_insert (icon_themes_hash, basename, file); + } + } + + g_object_unref (info); + } + + g_object_unref (enumerator); + } + } + + g_list_free_full (path, (GDestroyNotify) g_object_unref); + } + + g_signal_connect (config, "notify::icon-theme", + G_CALLBACK (icons_theme_change_notify), + gimp); + + icons_theme_change_notify (config, NULL, gimp); +} + +void +icon_themes_exit (Gimp *gimp) +{ + g_return_if_fail (GIMP_IS_GIMP (gimp)); + + if (icon_themes_hash) + { + g_signal_handlers_disconnect_by_func (gimp->config, + icons_theme_change_notify, + gimp); + + g_hash_table_destroy (icon_themes_hash); + icon_themes_hash = NULL; + } +} + +gchar ** +icon_themes_list_themes (Gimp *gimp, + gint *n_icon_themes) +{ + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + g_return_val_if_fail (n_icon_themes != NULL, NULL); + + *n_icon_themes = g_hash_table_size (icon_themes_hash); + + if (*n_icon_themes > 0) + { + gchar **icon_themes; + gchar **index; + + icon_themes = g_new0 (gchar *, *n_icon_themes + 1); + + index = icon_themes; + + g_hash_table_foreach (icon_themes_hash, icons_list_icons_foreach, &index); + + qsort (icon_themes, *n_icon_themes, sizeof (gchar *), icons_name_compare); + + return icon_themes; + } + + return NULL; +} + +GFile * +icon_themes_get_theme_dir (Gimp *gimp, + const gchar *icon_theme_name) +{ + g_return_val_if_fail (GIMP_IS_GIMP (gimp), NULL); + + if (! icon_theme_name) + icon_theme_name = "Default"; + + return g_hash_table_lookup (icon_themes_hash, icon_theme_name); +} + +static void +icons_apply_theme (Gimp *gimp, + const gchar *icon_theme_name) +{ + GtkIconTheme *icon_theme; + gchar **paths; + gint n_paths; + + g_return_if_fail (GIMP_IS_GIMP (gimp)); + + if (! icon_theme_name) + icon_theme_name = "Default"; + + if (gimp->be_verbose) + g_print ("Loading icon theme '%s'\n", icon_theme_name); + + icon_theme = gtk_icon_theme_get_default (); + + gtk_icon_theme_get_search_path (icon_theme, &paths, &n_paths); + + if (paths) + { + GFile *icon_theme_dir = icon_themes_get_theme_dir (gimp, icon_theme_name); + + g_free (paths[0]); + paths[0] = g_file_get_path (icon_theme_dir); + + gtk_icon_theme_set_search_path (icon_theme, + (const gchar **) paths, n_paths); + + g_strfreev (paths); + } +} + +static void +icons_list_icons_foreach (gpointer key, + gpointer value, + gpointer data) +{ + gchar ***index = data; + + **index = g_strdup ((gchar *) key); + + (*index)++; +} + +static gint +icons_name_compare (const void *p1, + const void *p2) +{ + return strcmp (* (char **) p1, * (char **) p2); +} + +static void +icons_theme_change_notify (GimpGuiConfig *config, + GParamSpec *pspec, + Gimp *gimp) +{ + icons_apply_theme (gimp, config->icon_theme); +} diff --git a/app/gui/icon-themes.h b/app/gui/icon-themes.h new file mode 100644 index 0000000000..9192cb2863 --- /dev/null +++ b/app/gui/icon-themes.h @@ -0,0 +1,34 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * icon-themes.h + * Copyright (C) 2015 Benoit Touchette + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __ICONS_THEMES_H__ +#define __ICONS_THEMES_H__ + + +void icon_themes_init (Gimp *gimp); +void icon_themes_exit (Gimp *gimp); + +gchar ** icon_themes_list_themes (Gimp *gimp, + gint *n_themes); +GFile * icon_themes_get_theme_dir (Gimp *gimp, + const gchar *theme_name); + + +#endif /* __ICONS_THEMES_H__ */ diff --git a/app/widgets/gimphelp-ids.h b/app/widgets/gimphelp-ids.h index 9c55061993..9ea7fcf297 100644 --- a/app/widgets/gimphelp-ids.h +++ b/app/widgets/gimphelp-ids.h @@ -473,6 +473,7 @@ #define GIMP_HELP_PREFS_INTERFACE "gimp-prefs-interface" #define GIMP_HELP_PREFS_HELP "gimp-prefs-help" #define GIMP_HELP_PREFS_THEME "gimp-prefs-theme" +#define GIMP_HELP_PREFS_ICON_THEME "gimp-prefs-icon-theme" #define GIMP_HELP_PREFS_TOOL_OPTIONS "gimp-prefs-tool-options" #define GIMP_HELP_PREFS_TOOLBOX "gimp-prefs-toolbox" #define GIMP_HELP_PREFS_INPUT_DEVICES "gimp-prefs-input-devices" @@ -501,6 +502,7 @@ #define GIMP_HELP_PREFS_FOLDERS_INTERPRETERS "gimp-prefs-folders-interpreters" #define GIMP_HELP_PREFS_FOLDERS_ENVIRONMENT "gimp-prefs-folders-environment" #define GIMP_HELP_PREFS_FOLDERS_THEMES "gimp-prefs-folders-themes" +#define GIMP_HELP_PREFS_FOLDERS_ICON_THEMES "gimp-prefs-folders-icon-themes" #define GIMP_HELP_INPUT_DEVICES "gimp-help-input-devices" #define GIMP_HELP_KEYBOARD_SHORTCUTS "gimp-help-keyboard-shortcuts" diff --git a/icons/16/gimp-prefs-icon-theme.png b/icons/16/gimp-prefs-icon-theme.png new file mode 100644 index 0000000000000000000000000000000000000000..9411c622c957af727b0d3fc1c353b40bca715823 GIT binary patch literal 492 zcmV-s4cYZhio33Ry{n*aHO!pz%zNG=k2bbnipn!dG;*O%$}N>zC)6h%@Gy&nU?56LsoX0<%5(np`uyqkIQ`w>@VJeeDGQIM zIcopp{6~jgKj$_DS0=N_()>&T0B|?Dy$eK@7!`o_-p3muPuE+x8$batQ$p}kk(#ow z)~Ymr|N4Ot95cNFxEt{rU}@vk*xyZs7`*JjU5U{+`SSio+l|cvs9Myzk2)|V2FFZT zTz^5RWu@k$&+mo~%?1ueM=&!&a8#9SVzTnP>QzR?*)X$f8AKo0^Ra*!orB%C#krEf z4y) ibC&Xa>R!#Nzy1TJ2TvQtCe4%p0000 + + + + + + + image/svg+xml + + + + + Jakub Steiner + + + 2005-02-01 + + http://jimmac.musichall.cz/ + + + folder + directory + storage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/22/gimp-prefs-icon-theme.png b/icons/22/gimp-prefs-icon-theme.png new file mode 100644 index 0000000000000000000000000000000000000000..c55a04f5aa0a52f559d7980434dc7e7fce4ed321 GIT binary patch literal 653 zcmV;80&@L{P)fL{ zMJmBcg%A)S5(pNG5YeC<2r)hEtn%K98l6QD- zM9v{v3{8?i+-y}Ejb^1DwHDUmly-Tv&0YOB` z@}2nn=IM^W$IjnCkc^dqO$2Aw*{#2qqe4~i&M;F{r3)4l%mnAOa1p?Xi#H3QD=(j< zAg7o~9;~96DXu{Asmr%Vs!hR$ndMudDwrA08Otvo@2ICUmu{u*P(dXXW!l#Y)xnAf zx*(gYnbBRl$Ffav3U2Rs=IWh7;Jf)pd2p^3irN6h(lfE}VD#0cADmMxU}|_XOwx(o ziow10#pe%mV^hU+pkf`NxLa?(_bQe=xa(sT>G-nHUOn{-*Y4)O#x!p?DfoGV6c4L! zKY8s(1kyaOo;?_Ft#$6=!eTqC{HJjJiMi|d#tYsZ8AlJ6{|Od(&4X9JR*9Rfu_*oW nt(t*V)?P2JOpUd{Dr + + + + + + + image/svg+xml + + + + + Jakub Steiner + + + 2005-02-01 + + http://jimmac.musichall.cz/ + + + folder + directory + storage + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icons/Makefile.am b/icons/Makefile.am index 7b6593226f..aaa6d40d1b 100644 --- a/icons/Makefile.am +++ b/icons/Makefile.am @@ -1,19 +1,19 @@ ## Process this file with automake to produce Makefile.in -iconsdir = $(gimpdatadir)/icons/hicolor -icons12dir = $(gimpdatadir)/icons/hicolor/12x12/apps -icons16dir = $(gimpdatadir)/icons/hicolor/16x16/apps -icons18dir = $(gimpdatadir)/icons/hicolor/18x18/apps -icons20dir = $(gimpdatadir)/icons/hicolor/20x20/apps -icons22dir = $(gimpdatadir)/icons/hicolor/22x22/apps -icons24dir = $(gimpdatadir)/icons/hicolor/24x24/apps -icons32dir = $(gimpdatadir)/icons/hicolor/32x32/apps -icons48dir = $(gimpdatadir)/icons/hicolor/48x48/apps -icons64dir = $(gimpdatadir)/icons/hicolor/64x64/apps -icons96dir = $(gimpdatadir)/icons/hicolor/96x96/apps -icons128dir = $(gimpdatadir)/icons/hicolor/128x128/apps -icons192dir = $(gimpdatadir)/icons/hicolor/192x192/apps -icons256dir = $(gimpdatadir)/icons/hicolor/256x256/apps +iconsdir = $(gimpdatadir)/icons/Default/hicolor +icons12dir = $(gimpdatadir)/icons/Default/hicolor/12x12/apps +icons16dir = $(gimpdatadir)/icons/Default/hicolor/16x16/apps +icons18dir = $(gimpdatadir)/icons/Default/hicolor/18x18/apps +icons20dir = $(gimpdatadir)/icons/Default/hicolor/20x20/apps +icons22dir = $(gimpdatadir)/icons/Default/hicolor/22x22/apps +icons24dir = $(gimpdatadir)/icons/Default/hicolor/24x24/apps +icons32dir = $(gimpdatadir)/icons/Default/hicolor/32x32/apps +icons48dir = $(gimpdatadir)/icons/Default/hicolor/48x48/apps +icons64dir = $(gimpdatadir)/icons/Default/hicolor/64x64/apps +icons96dir = $(gimpdatadir)/icons/Default/hicolor/96x96/apps +icons128dir = $(gimpdatadir)/icons/Default/hicolor/128x128/apps +icons192dir = $(gimpdatadir)/icons/Default/hicolor/192x192/apps +icons256dir = $(gimpdatadir)/icons/Default/hicolor/256x256/apps ## The icon theme images @@ -132,6 +132,7 @@ icons16_DATA = \ 16/gimp-prefs-image-windows.png \ 16/gimp-prefs-interface.png \ 16/gimp-prefs-theme.png \ + 16/gimp-prefs-icon-theme.png \ 16/gimp-prefs-toolbox.png \ 16/gimp-prefs-window-management.png \ 16/gimp-print-resolution.png \ @@ -271,6 +272,7 @@ icons22_DATA = \ 22/gimp-prefs-playground.png \ 22/gimp-prefs-session.png \ 22/gimp-prefs-theme.png \ + 22/gimp-prefs-icon-theme.png \ 22/gimp-prefs-tool-options.png \ 22/gimp-prefs-toolbox.png \ 22/gimp-prefs-window-management.png \ diff --git a/libgimpwidgets/gimpstock.c b/libgimpwidgets/gimpstock.c index 02ca890eb3..1eec15ab4d 100644 --- a/libgimpwidgets/gimpstock.c +++ b/libgimpwidgets/gimpstock.c @@ -361,6 +361,7 @@ gimp_stock_init (void) GdkPixbuf *pixbuf; GError *error = NULL; + gchar *icon_theme; gchar *icons_dir; gint i; @@ -397,7 +398,11 @@ gimp_stock_init (void) gtk_stock_add_static (gimp_compat_stock_items, G_N_ELEMENTS (gimp_compat_stock_items)); - icons_dir = g_build_filename (gimp_data_directory (), "icons", NULL); + icon_theme = g_strdup ("Default"); /* FIXME */ + icons_dir = g_build_filename (gimp_data_directory (), "icons", icon_theme, + NULL); + g_free (icon_theme); + gtk_icon_theme_prepend_search_path (gtk_icon_theme_get_default (), icons_dir); g_free (icons_dir);