summaryrefslogtreecommitdiff
path: root/src/caja-location-bar.c
diff options
context:
space:
mode:
authorWolfgang Ulbrich <[email protected]>2016-01-13 15:15:35 +0100
committerWolfgang Ulbrich <[email protected]>2016-01-13 15:15:35 +0100
commit3b7b4cfa969402c5cc9e45369f552729f2b65308 (patch)
tree610589db57c82fb63f5984d28b3009eb2c0cbb5a /src/caja-location-bar.c
parent3c5a4ef68906a73850fa2ffe403cfcd37dc31ff9 (diff)
parent1befe8ddf08c12b5c926d269b31d270fb94b9c3e (diff)
downloadcaja-3b7b4cfa969402c5cc9e45369f552729f2b65308.tar.bz2
caja-3b7b4cfa969402c5cc9e45369f552729f2b65308.tar.xz
Merge pull request #498 from mate-desktop/dev-GtkStyleContext
port to gtk_style_context and other fixes
Diffstat (limited to 'src/caja-location-bar.c')
-rw-r--r--src/caja-location-bar.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/caja-location-bar.c b/src/caja-location-bar.c
index 965da186..e2a70104 100644
--- a/src/caja-location-bar.c
+++ b/src/caja-location-bar.c
@@ -614,6 +614,21 @@ caja_location_bar_update_label (CajaLocationBar *bar)
void
caja_location_bar_set_active(CajaLocationBar *location_bar, gboolean is_active)
{
+#if GTK_CHECK_VERSION (3, 0, 0)
+ if (is_active)
+ {
+ /* reset style to default */
+ gtk_widget_override_background_color (GTK_WIDGET (location_bar->details->entry), GTK_STATE_FLAG_NORMAL, NULL);
+ }
+ else
+ {
+ GtkStyleContext *style;
+ GdkRGBA color;
+
+ style = gtk_widget_get_style_context (GTK_WIDGET (location_bar->details->entry));
+ gtk_style_context_get_background_color (style, GTK_STATE_FLAG_INSENSITIVE, &color);
+ gtk_widget_override_background_color (GTK_WIDGET (location_bar->details->entry), GTK_STATE_FLAG_ACTIVE, &color);
+#else
if(is_active)
{
/* reset style to default */
@@ -626,6 +641,7 @@ caja_location_bar_set_active(CajaLocationBar *location_bar, gboolean is_active)
style = gtk_widget_get_style (GTK_WIDGET (location_bar->details->entry));
color = style->base[GTK_STATE_INSENSITIVE];
gtk_widget_modify_base(GTK_WIDGET (location_bar->details->entry), GTK_STATE_NORMAL, &color);
+#endif
}
}