[evince] libview: Port EvLoadingWindow to GtkStyleContext
- From: Carlos Garcia Campos <carlosgc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evince] libview: Port EvLoadingWindow to GtkStyleContext
- Date: Thu, 23 Dec 2010 18:13:44 +0000 (UTC)
commit 082ba0dbfeed04fb5cb5bb2e5d81c77c831e8c7a
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Nov 15 23:10:48 2010 -0500
libview: Port EvLoadingWindow to GtkStyleContext
libview/ev-loading-window.c | 34 ++++++++++++++++------------------
1 files changed, 16 insertions(+), 18 deletions(-)
---
diff --git a/libview/ev-loading-window.c b/libview/ev-loading-window.c
index 434beac..b413431 100644
--- a/libview/ev-loading-window.c
+++ b/libview/ev-loading-window.c
@@ -71,8 +71,8 @@ ev_loading_window_init (EvLoadingWindow *window)
GtkWidget *widget = GTK_WIDGET (window);
GtkWidget *hbox;
GtkWidget *label;
- GtkStyle *style;
- GdkColor fg, bg;
+ GtkStyleContext *context;
+ GdkRGBA fg, bg;
const gchar *loading_text = _("Loadingâ?¦");
const gchar *fg_color_name = "info_fg_color";
const gchar *bg_color_name = "info_bg_color";
@@ -99,24 +99,22 @@ ev_loading_window_init (EvLoadingWindow *window)
gtk_window_set_decorated (gtk_window, FALSE);
gtk_window_set_resizable (gtk_window, FALSE);
- style = gtk_widget_get_style (widget);
- if (!gtk_style_lookup_color (style, fg_color_name, &fg) ||
- !gtk_style_lookup_color (style, bg_color_name, &bg)) {
- fg.pixel = 0;
- fg.red = 0xb800;
- fg.green = 0xad00;
- fg.blue = 0x9d00;
-
- bg.pixel = 0;
- bg.red = 0xff00;
- bg.green = 0xff00;
- bg.blue = 0xbf00;
+ context = gtk_widget_get_style_context (widget);
+ if (!gtk_style_context_lookup_color (context, fg_color_name, &fg) ||
+ !gtk_style_context_lookup_color (context, bg_color_name, &bg)) {
+ fg.red = 0.7;
+ fg.green = 0.67;
+ fg.blue = 0.63;
+ fg.alpha = 1.0;
+
+ bg.red = 0.99;
+ bg.green = 0.99;
+ bg.blue = 0.71;
+ bg.alpha = 1.0;
}
- if (!gdk_color_equal (&bg, &style->bg[GTK_STATE_NORMAL]))
- gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &bg);
- if (!gdk_color_equal (&fg, &style->fg[GTK_STATE_NORMAL]))
- gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, &fg);
+ gtk_widget_override_background_color (widget, GTK_STATE_NORMAL, &bg);
+ gtk_widget_override_color (widget, GTK_STATE_NORMAL, &fg);
}
static GObject *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]