Fix additional deprecation warnings

Again with more code.
This commit is contained in:
Přemysl Eric Janouch 2015-01-20 09:36:43 +01:00
parent 13f212d4e9
commit 1adeac6c22
1 changed files with 15 additions and 6 deletions

View File

@ -340,6 +340,8 @@ on_draw (GtkWidget *widget, cairo_t *cr)
{ {
LdCategorySymbolView *self; LdCategorySymbolView *self;
GSList *iter; GSList *iter;
GdkRGBA color;
GtkStyleContext *context;
self = LD_CATEGORY_SYMBOL_VIEW (widget); self = LD_CATEGORY_SYMBOL_VIEW (widget);
@ -347,8 +349,10 @@ on_draw (GtkWidget *widget, cairo_t *cr)
if (!gdk_cairo_get_clip_rectangle (cr, &draw_area)) if (!gdk_cairo_get_clip_rectangle (cr, &draw_area))
return FALSE; return FALSE;
gdk_cairo_set_source_color (cr, context = gtk_widget_get_style_context (widget);
&gtk_widget_get_style (widget)->base[GTK_STATE_NORMAL]); gtk_style_context_get_background_color (context,
GTK_STATE_FLAG_NORMAL, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_paint (cr); cairo_paint (cr);
for (iter = self->priv->layout; iter; iter = iter->next) for (iter = self->priv->layout; iter; iter = iter->next)
@ -363,11 +367,16 @@ on_draw (GtkWidget *widget, cairo_t *cr)
gdk_cairo_rectangle (cr, &data->rect); gdk_cairo_rectangle (cr, &data->rect);
cairo_clip (cr); cairo_clip (cr);
gdk_cairo_set_source_color (cr, GtkStateFlags state = GTK_STATE_FLAG_NORMAL;
&gtk_widget_get_style (widget)->text[GTK_STATE_NORMAL]);
if (data == self->priv->preselected) if (data == self->priv->preselected)
cairo_paint_with_alpha (cr, 0.1); state = GTK_STATE_FLAG_SELECTED;
gtk_style_context_get_background_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_paint (cr);
gtk_style_context_get_color (context, state, &color);
gdk_cairo_set_source_rgba (cr, &color);
cairo_translate (cr, data->rect.x + data->dx, data->rect.y + data->dy); cairo_translate (cr, data->rect.x + data->dx, data->rect.y + data->dy);
cairo_scale (cr, data->scale, data->scale); cairo_scale (cr, data->scale, data->scale);