[gnome-builder/wip/chergert/perspective] css: fix search-bar styling with manual adwaita overrides



commit 4eb3e641649f99c976bf0c4c070cfc0fc7641b2b
Author: Christian Hergert <chergert redhat com>
Date:   Fri Nov 6 17:27:01 2015 -0800

    css: fix search-bar styling with manual adwaita overrides

 contrib/egg/egg-search-bar.c |   15 +++++++++------
 data/theme/Adwaita.css       |   14 ++++++++++++++
 2 files changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/contrib/egg/egg-search-bar.c b/contrib/egg/egg-search-bar.c
index ed2eb3f..2ece233 100644
--- a/contrib/egg/egg-search-bar.c
+++ b/contrib/egg/egg-search-bar.c
@@ -336,7 +336,7 @@ egg_search_bar_init (EggSearchBar *self)
 {
   EggSearchBarPrivate *priv = egg_search_bar_get_instance_private (self);
   GtkStyleContext *style_context;
-  GtkBox *vbox;
+  GtkBox *box;
 
   priv->window_signals = egg_signal_group_new (GTK_TYPE_WINDOW);
   egg_signal_group_connect_object (priv->window_signals,
@@ -355,14 +355,17 @@ egg_search_bar_init (EggSearchBar *self)
                   "transition-type", GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN,
                   "visible", TRUE,
                   NULL);
-  vbox =
+  /* outer box used for styling */
+  box =
     g_object_new (GTK_TYPE_BOX,
-                  "orientation", GTK_ORIENTATION_VERTICAL,
+                  "orientation", GTK_ORIENTATION_HORIZONTAL,
                   "visible", TRUE,
                   NULL);
   priv->box =
     g_object_new (GTK_TYPE_BOX,
+                  "hexpand", TRUE,
                   "margin", 6,
+                  "orientation", GTK_ORIENTATION_HORIZONTAL,
                   "visible", TRUE,
                   NULL);
   priv->entry =
@@ -381,11 +384,11 @@ egg_search_bar_init (EggSearchBar *self)
                   "visible", FALSE,
                   NULL);
 
-  style_context = gtk_widget_get_style_context (GTK_WIDGET (vbox));
+  style_context = gtk_widget_get_style_context (GTK_WIDGET (box));
   gtk_style_context_add_class (style_context, "search-bar");
 
-  gtk_container_add (GTK_CONTAINER (priv->revealer), GTK_WIDGET (vbox));
-  gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (priv->box));
+  gtk_container_add (GTK_CONTAINER (priv->revealer), GTK_WIDGET (box));
+  gtk_container_add (GTK_CONTAINER (box), GTK_WIDGET (priv->box));
   gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (priv->revealer));
   gtk_container_add_with_properties (GTK_CONTAINER (priv->box),
                                      GTK_WIDGET (priv->close_button),
diff --git a/data/theme/Adwaita.css b/data/theme/Adwaita.css
index 32ef4f4..a1cb37f 100644
--- a/data/theme/Adwaita.css
+++ b/data/theme/Adwaita.css
@@ -53,3 +53,17 @@ GbAccelLabel .frame {
   color: #555753;
   padding: 3px 8px 3px 8px;
 }
+
+
+GtkBox.horizontal.search-bar {
+  background: none;
+  background-color: #d6d6d6;
+  box-shadow: inset 0 2px 3px -1px #b6b6b6, 0 1px white;
+  border: none;
+  border-bottom: 1px solid #a1a1a1;
+}
+GtkBox.horizontal.search-bar:backdrop {
+  border-color: darkgrey;
+  background-color: #d5d5d5;
+  box-shadow: none;
+}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]