aboutsummaryrefslogtreecommitdiffstats
path: root/libgnomecanvas
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2014-07-07 18:51:41 +0800
committerMilan Crha <mcrha@redhat.com>2014-07-07 18:51:41 +0800
commit50bda1bad222082488d3d9bc9fe1d0fb3867e974 (patch)
tree27042fc0a39e4a7f79d920bae88cb29aa5677d10 /libgnomecanvas
parent534864b39850ea2354b87419da6dc77538867756 (diff)
downloadgsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.gz
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.bz2
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.lz
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.xz
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.tar.zst
gsoc2013-evolution-50bda1bad222082488d3d9bc9fe1d0fb3867e974.zip
Replace GtkStyle usages with GtkStyleContext
This makes evolution depend on theme-defined named colors, namely: theme_bg_color theme_base_color theme_fg_color theme_text_color theme_selected_bg_color theme_selected_fg_color theme_unfocused_selected_bg_color theme_unfocused_selected_fg_color If it's not defined, then a fallback color is used, in the worse case one of the fallbacks defined in evolution itself.
Diffstat (limited to 'libgnomecanvas')
-rw-r--r--libgnomecanvas/gnome-canvas-text.c7
-rw-r--r--libgnomecanvas/gnome-canvas.c9
-rw-r--r--libgnomecanvas/gnome-canvas.h2
3 files changed, 11 insertions, 7 deletions
diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c
index e030b9b73b..548055125e 100644
--- a/libgnomecanvas/gnome-canvas-text.c
+++ b/libgnomecanvas/gnome-canvas-text.c
@@ -1184,12 +1184,13 @@ static void
gnome_canvas_text_apply_font_desc (GnomeCanvasText *text)
{
PangoFontDescription *font_desc;
+ PangoContext *pango_context;
GtkWidget *widget;
- GtkStyle *style;
widget = GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas);
- style = gtk_widget_get_style (widget);
- font_desc = pango_font_description_copy (style->font_desc);
+ pango_context = gtk_widget_create_pango_context (widget);
+ font_desc = pango_font_description_copy (pango_context_get_font_description (pango_context));
+ g_object_unref (pango_context);
if (text->font_desc)
pango_font_description_merge (font_desc, text->font_desc, TRUE);
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 45b383b47f..4d482c5594 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -2817,12 +2817,15 @@ gnome_canvas_draw_background (GnomeCanvas *canvas,
gint width,
gint height)
{
- GtkStyle *style;
+ GtkStyleContext *style_context;
+ GdkRGBA rgba;
- style = gtk_widget_get_style (GTK_WIDGET (canvas));
+ style_context = gtk_widget_get_style_context (GTK_WIDGET (canvas));
+ if (!gtk_style_context_lookup_color (style_context, "theme_bg_color", &rgba))
+ gdk_rgba_parse (&rgba, "#aaaaaa");
cairo_save (cr);
- gdk_cairo_set_source_color (cr, &style->bg[GTK_STATE_NORMAL]);
+ gdk_cairo_set_source_rgba (cr, &rgba);
cairo_paint (cr);
cairo_restore (cr);
}
diff --git a/libgnomecanvas/gnome-canvas.h b/libgnomecanvas/gnome-canvas.h
index f24c929f95..675de55742 100644
--- a/libgnomecanvas/gnome-canvas.h
+++ b/libgnomecanvas/gnome-canvas.h
@@ -195,7 +195,7 @@ void gnome_canvas_item_construct (GnomeCanvasItem *item, GnomeCanvasGroup *paren
/* Configure an item using the standard Gtk argument mechanism. The last
* argument must be a NULL pointer.
*/
-void gnome_canvas_item_set (GnomeCanvasItem *item, const gchar *first_arg_name, ...);
+void gnome_canvas_item_set (GnomeCanvasItem *item, const gchar *first_arg_name, ...) G_GNUC_NULL_TERMINATED;
/* Used only for language wrappers and the like */
void gnome_canvas_item_set_valist (GnomeCanvasItem *item,