diff options
author | raveit65 <[email protected]> | 2016-02-26 20:48:33 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-02-26 20:48:33 +0100 |
commit | 95335ff8cb062660908985442728374476fe9909 (patch) | |
tree | 4e970873c0a1464094d181d9b956fc225ab2bd12 /mate-volume-control | |
parent | 7bdd79ebd7d9376c6ba54c1e0d9a0aa55fe71ac8 (diff) | |
download | mate-media-95335ff8cb062660908985442728374476fe9909.tar.bz2 mate-media-95335ff8cb062660908985442728374476fe9909.tar.xz |
GTK+3: Get values from GtkStyleContext states properly
Diffstat (limited to 'mate-volume-control')
-rw-r--r-- | mate-volume-control/gvc-level-bar.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/mate-volume-control/gvc-level-bar.c b/mate-volume-control/gvc-level-bar.c index 9a67c1d..46bf6df 100644 --- a/mate-volume-control/gvc-level-bar.c +++ b/mate-volume-control/gvc-level-bar.c @@ -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; |