[gimp] Bug 760579 - Plug-in dialogs fail to use UI themes
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] Bug 760579 - Plug-in dialogs fail to use UI themes
- Date: Sat, 16 Jan 2016 18:39:26 +0000 (UTC)
commit 2334cb41a7c3673a95e81d610717b6ee9c67db49
Author: Michael Natterer <mitch gimp org>
Date: Sat Jan 16 19:36:13 2016 +0100
Bug 760579 - Plug-in dialogs fail to use UI themes
Something must have changed in GTK+, probably a long time ago, because
this code definitely used to work in the past.
Anyway, change gimp_ui_init() in libgimpui to use gtk_rc_parse()
instead of gtk_rc_add_default_file() which fixes the plug-in's initial
theme, and install a GFileMonitor on themerc which calls
gtk_rc_reparse_all() when themerc changes.
libgimp/gimpui.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
---
diff --git a/libgimp/gimpui.c b/libgimp/gimpui.c
index 870c6df..20ccc98 100644
--- a/libgimp/gimpui.c
+++ b/libgimp/gimpui.c
@@ -93,10 +93,11 @@ void
gimp_ui_init (const gchar *prog_name,
gboolean preview)
{
- GdkScreen *screen;
- const gchar *display_name;
- gchar *themerc;
- GFile *icon_theme;
+ GdkScreen *screen;
+ const gchar *display_name;
+ gchar *themerc;
+ GFileMonitor *rc_monitor;
+ GFile *file;
g_return_if_fail (prog_name != NULL);
@@ -130,17 +131,26 @@ gimp_ui_init (const gchar *prog_name,
gtk_init (NULL, NULL);
themerc = gimp_personal_rc_file ("themerc");
- gtk_rc_add_default_file (themerc);
+ gtk_rc_parse (themerc);
+
+ file = g_file_new_for_path (themerc);
g_free (themerc);
+ rc_monitor = g_file_monitor (file, G_FILE_MONITOR_NONE, NULL, NULL);
+ g_object_unref (file);
+
+ g_signal_connect (rc_monitor, "changed",
+ G_CALLBACK (gtk_rc_reparse_all),
+ NULL);
+
gdk_set_program_class (gimp_wm_class ());
screen = gdk_screen_get_default ();
gtk_widget_set_default_colormap (gdk_screen_get_rgb_colormap (screen));
- icon_theme = g_file_new_for_path (gimp_get_icon_theme_dir ());
- gimp_icons_set_icon_theme (icon_theme);
- g_object_unref (icon_theme);
+ file = g_file_new_for_path (gimp_get_icon_theme_dir ());
+ gimp_icons_set_icon_theme (file);
+ g_object_unref (file);
gimp_widgets_init (gimp_ui_help_func,
gimp_context_get_foreground,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]