mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
Make the gtk-color-scheme setting work.
2005-12-12 Matthias Clasen <mclasen@redhat.com> Make the gtk-color-scheme setting work. * gtk/gtksettings.h: * gtk/gtksettings.c (_gtk_settings_get_color_hash): Add a getter that takes care of initializing the color hash if it is not already there. * gtk/gtkrc.c (gtk_rc_color_scheme_changed, gtk_rc_context_get): And use it here.
This commit is contained in:
parent
34291ddf05
commit
128bc9f3ea
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
||||
2005-12-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Make the gtk-color-scheme setting work.
|
||||
|
||||
* gtk/gtksettings.h:
|
||||
* gtk/gtksettings.c (_gtk_settings_get_color_hash): Add a getter
|
||||
that takes care of initializing the color hash if it is not
|
||||
already there.
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_color_scheme_changed, gtk_rc_context_get):
|
||||
And use it here.
|
||||
|
||||
2005-12-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/gdk.c (gdk_parse_args): Warn if parsing fails,
|
||||
|
@ -1,3 +1,15 @@
|
||||
2005-12-12 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
Make the gtk-color-scheme setting work.
|
||||
|
||||
* gtk/gtksettings.h:
|
||||
* gtk/gtksettings.c (_gtk_settings_get_color_hash): Add a getter
|
||||
that takes care of initializing the color hash if it is not
|
||||
already there.
|
||||
|
||||
* gtk/gtkrc.c (gtk_rc_color_scheme_changed, gtk_rc_context_get):
|
||||
And use it here.
|
||||
|
||||
2005-12-10 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* gdk/gdk.c (gdk_parse_args): Warn if parsing fails,
|
||||
|
@ -596,8 +596,7 @@ gtk_rc_color_scheme_changed (GtkSettings *settings,
|
||||
if (context->color_hash)
|
||||
g_hash_table_unref (context->color_hash);
|
||||
|
||||
context->color_hash = g_object_get_data (G_OBJECT (settings),
|
||||
"gtk-color-scheme");
|
||||
context->color_hash = _gtk_settings_get_color_hash (settings);
|
||||
if (context->color_hash)
|
||||
g_hash_table_ref (context->color_hash);
|
||||
|
||||
@ -629,8 +628,7 @@ gtk_rc_context_get (GtkSettings *settings)
|
||||
"gtk-color-scheme", &context->colors,
|
||||
NULL);
|
||||
|
||||
context->color_hash = g_object_get_data (G_OBJECT (settings),
|
||||
"gtk-color-scheme");
|
||||
context->color_hash = _gtk_settings_get_color_hash (settings);
|
||||
if (context->color_hash)
|
||||
g_hash_table_ref (context->color_hash);
|
||||
|
||||
|
@ -1590,11 +1590,16 @@ gtk_color_table_from_string (const gchar *str)
|
||||
while (*p == ' ')
|
||||
p++;
|
||||
|
||||
s = strchr (p, '\n');
|
||||
if (s)
|
||||
s = p;
|
||||
while (*s)
|
||||
{
|
||||
if (*s == '\n')
|
||||
{
|
||||
*s = '\0';
|
||||
s++;
|
||||
break;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
|
||||
if (!gdk_color_parse (p, &color))
|
||||
@ -1633,5 +1638,17 @@ settings_update_color_scheme (GtkSettings *settings)
|
||||
g_free (colors);
|
||||
}
|
||||
|
||||
GHashTable *
|
||||
_gtk_settings_get_color_hash (GtkSettings *settings)
|
||||
{
|
||||
if (g_object_get_data (G_OBJECT (settings),
|
||||
"gtk-color-scheme") == NULL)
|
||||
settings_update_color_scheme (settings);
|
||||
|
||||
return (GHashTable *) g_object_get_data (G_OBJECT (settings),
|
||||
"gtk-color-scheme");
|
||||
}
|
||||
|
||||
|
||||
#define __GTK_SETTINGS_C__
|
||||
#include "gtkaliasdef.c"
|
||||
|
@ -126,6 +126,7 @@ gboolean _gtk_settings_parse_convert (GtkRcPropertyParser parser,
|
||||
const GValue *src_value,
|
||||
GParamSpec *pspec,
|
||||
GValue *dest_value);
|
||||
GHashTable* _gtk_settings_get_color_hash (GtkSettings *settings);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
Loading…
Reference in New Issue
Block a user