aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDavid Bordoley <bordoley@msu.edu>2003-07-11 21:47:47 +0800
committerDave Bordoley <Bordoley@src.gnome.org>2003-07-11 21:47:47 +0800
commitebab320d3037aa258cd26b12841b63e7f8c50b7d (patch)
treef4365c331f89582d8623858c628284c445ec05ea /lib
parentd65595a4ba6e55cd0109fc0af1f3a5b4df88e51e (diff)
downloadgsoc2013-epiphany-ebab320d3037aa258cd26b12841b63e7f8c50b7d.tar
gsoc2013-epiphany-ebab320d3037aa258cd26b12841b63e7f8c50b7d.tar.gz
gsoc2013-epiphany-ebab320d3037aa258cd26b12841b63e7f8c50b7d.tar.bz2
gsoc2013-epiphany-ebab320d3037aa258cd26b12841b63e7f8c50b7d.tar.lz
gsoc2013-epiphany-ebab320d3037aa258cd26b12841b63e7f8c50b7d.tar.xz
gsoc2013-epiphany-ebab320d3037aa258cd26b12841b63e7f8c50b7d.tar.zst
gsoc2013-epiphany-ebab320d3037aa258cd26b12841b63e7f8c50b7d.zip
Monitor for theme changes and set smb background accordingly.
2003-07-11 David Bordoley <bordoley@msu.edu> * lib/widgets/ephy-autocompletion-window.c: (set_renderer_bg_color), (ephy_autocompletion_window_init_widgets): Monitor for theme changes and set smb background accordingly.
Diffstat (limited to 'lib')
-rw-r--r--lib/widgets/ephy-autocompletion-window.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/lib/widgets/ephy-autocompletion-window.c b/lib/widgets/ephy-autocompletion-window.c
index 1326fe7b5..56cbb31ee 100644
--- a/lib/widgets/ephy-autocompletion-window.c
+++ b/lib/widgets/ephy-autocompletion-window.c
@@ -215,6 +215,25 @@ ephy_autocompletion_window_finalize_impl (GObject *o)
G_OBJECT_CLASS (g_object_class)->finalize (o);
}
+static gboolean
+set_renderer_bg_color (GtkWidget *widget,
+ GtkStyle *previous_style,
+ GtkCellRenderer *renderer)
+{
+ GValue v = { 0 };
+ GdkColor *bg_color;
+ GtkStyle *style;
+
+ g_value_init (&v, GDK_TYPE_COLOR);
+ g_object_get_property (G_OBJECT (renderer), "cell_background_gdk", &v);
+ bg_color = g_value_peek_pointer (&v);
+ style = gtk_widget_get_style (widget);
+ *bg_color = style->bg[GTK_STATE_NORMAL];
+ g_object_set_property (G_OBJECT (renderer), "cell_background_gdk", &v);
+
+ return FALSE;
+}
+
static void
ephy_autocompletion_window_init_widgets (EphyAutocompletionWindow *aw)
{
@@ -223,9 +242,6 @@ ephy_autocompletion_window_init_widgets (EphyAutocompletionWindow *aw)
GtkCellRenderer *renderer;
GtkWidget *frame;
GtkWidget *vbox;
- GdkColor *bg_color;
- GtkStyle *style;
- GValue v = { 0 };
p->window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_resizable (GTK_WINDOW (p->window), FALSE);
@@ -272,12 +288,9 @@ ephy_autocompletion_window_init_widgets (EphyAutocompletionWindow *aw)
renderer = gtk_cell_renderer_text_new ();
- g_value_init (&v, GDK_TYPE_COLOR);
- g_object_get_property (G_OBJECT (renderer), "cell_background_gdk", &v);
- bg_color = g_value_peek_pointer (&v);
- style = gtk_widget_get_style (p->window);
- *bg_color = style->bg[GTK_STATE_NORMAL];
- g_object_set_property (G_OBJECT (renderer), "cell_background_gdk", &v);
+ set_renderer_bg_color (p->window, NULL, renderer);
+ g_signal_connect (G_OBJECT (p->window), "style-set",
+ G_CALLBACK (set_renderer_bg_color), G_OBJECT (renderer));
p->action_col1 = gtk_tree_view_column_new ();
gtk_tree_view_column_pack_start (p->action_col1, renderer, TRUE);