Skip to content

Commit

Permalink
GTK+3: Get values from GtkStyleContext states properly
Browse files Browse the repository at this point in the history
  • Loading branch information
raveit65 committed Feb 26, 2016
1 parent 7bdd79e commit 95335ff
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions mate-volume-control/gvc-level-bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,20 @@ bar_calc_layout (GvcLevelBar *bar)

context = gtk_widget_get_style_context (GTK_WIDGET (bar));

gtk_style_context_save (context);
gtk_style_context_set_state (context, GTK_STATE_FLAG_NORMAL);
gtk_style_context_get_background_color (context,
GTK_STATE_FLAG_NORMAL,
gtk_style_context_get_state (context),
&bar->priv->layout.color_bg);
gtk_style_context_get_background_color (context,
GTK_STATE_FLAG_SELECTED,
&bar->priv->layout.color_fg);

mate_desktop_gtk_style_get_dark_color (context,
GTK_STATE_FLAG_NORMAL,
gtk_style_context_get_state (context),
&bar->priv->layout.color_dark);

gtk_style_context_set_state (context, GTK_STATE_FLAG_SELECTED);
gtk_style_context_get_background_color (context,
gtk_style_context_get_state (context),
&bar->priv->layout.color_fg);
gtk_style_context_restore (context);
#else
GtkStyle *style;

Expand Down

0 comments on commit 95335ff

Please sign in to comment.