summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-07 04:37:43 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-13 15:05:41 +0100
commit3758b1025d59bd534717bd78d0e87dba9d45e542 (patch)
treef5f7dbe11d1a0cacb4c63378a7c8fb5d2f390c5e /src
parentd74c80ebae7d2acd4804ac1d20f6d77b1df53a2a (diff)
downloadcaja-3758b1025d59bd534717bd78d0e87dba9d45e542.tar.bz2
caja-3758b1025d59bd534717bd78d0e87dba9d45e542.tar.xz
GTK3 list-view: port to GtkStyleContext
Diffstat (limited to 'src')
-rw-r--r--src/file-manager/fm-list-view.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index dc9bc20b..56ff9b17 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -3262,20 +3262,35 @@ real_set_is_active (FMDirectoryView *view,
gboolean is_active)
{
GtkWidget *tree_view;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkStyleContext *style;
+ GdkRGBA color;
+#else
GtkStyle *style;
GdkColor color;
+#endif
tree_view = GTK_WIDGET (fm_list_view_get_tree_view (FM_LIST_VIEW (view)));
if (is_active)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gtk_widget_override_background_color (tree_view, GTK_STATE_FLAG_NORMAL, NULL);
+#else
gtk_widget_modify_base (tree_view, GTK_STATE_NORMAL, NULL);
+#endif
}
else
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ style = gtk_widget_get_style_context (tree_view);
+ gtk_style_context_get_background_color (style, GTK_STATE_FLAG_INSENSITIVE, &color);
+ gtk_widget_override_background_color (tree_view, GTK_STATE_FLAG_NORMAL, &color);
+#else
style = gtk_widget_get_style (tree_view);
color = style->base[GTK_STATE_INSENSITIVE];
gtk_widget_modify_base (tree_view, GTK_STATE_NORMAL, &color);
+#endif
}
EEL_CALL_PARENT (FM_DIRECTORY_VIEW_CLASS,