[gnome-builder/wip/chergert/layout] style: tweak hover state for some treeviews



commit daa98d48f2aa8eaba14c41c8ed4c348abd5ece8c
Author: Christian Hergert <chergert redhat com>
Date:   Sat Jul 8 03:55:41 2017 -0700

    style: tweak hover state for some treeviews

 data/themes/shared.css                       |    1 +
 data/themes/shared/shared-treeview.css       |   19 +++++++++++++++++++
 libide/editor/ide-editor-properties.ui       |    3 +++
 libide/libide.gresource.xml                  |    1 +
 plugins/project-tree/gb-project-tree-addin.c |    1 +
 plugins/project-tree/themes/shared.css       |   13 -------------
 plugins/symbol-tree/themes/shared.css        |    3 +++
 7 files changed, 28 insertions(+), 13 deletions(-)
---
diff --git a/data/themes/shared.css b/data/themes/shared.css
index 8695339..420377c 100644
--- a/data/themes/shared.css
+++ b/data/themes/shared.css
@@ -1,5 +1,6 @@
 @import url("resource:///org/gnome/builder/themes/shared/shared-layout.css");
 @import url("resource:///org/gnome/builder/themes/shared/shared-editor.css");
+@import url("resource:///org/gnome/builder/themes/shared/shared-treeview.css");
 
 /* work around some gtk padding issue */
 filechooser actionbar button.combo {
diff --git a/data/themes/shared/shared-treeview.css b/data/themes/shared/shared-treeview.css
new file mode 100644
index 0000000..9f595fb
--- /dev/null
+++ b/data/themes/shared/shared-treeview.css
@@ -0,0 +1,19 @@
+treeview.i-wanna-be-listbox {
+  color: @theme_fg_color;
+  background: transparent;
+}
+treeview.i-wanna-be-listbox:hover {
+  background-color: alpha(@theme_fg_color, 0.05);
+}
+treeview.i-wanna-be-listbox:selected {
+  color: @theme_selected_fg_color;
+  background-color: @theme_selected_bg_color;
+}
+treeview.i-wanna-be-listbox:backdrop {
+  color: @theme_unfocused_fg_color;
+  background-color: @theme_unfocused_base_color;
+}
+treeview.i-wanna-be-listbox:selected:backdrop {
+  color: @theme_unfocused_selected_fg_color;
+  background-color: @theme_unfocused_selected_bg_color;
+}
diff --git a/libide/editor/ide-editor-properties.ui b/libide/editor/ide-editor-properties.ui
index 690908e..ed0641e 100644
--- a/libide/editor/ide-editor-properties.ui
+++ b/libide/editor/ide-editor-properties.ui
@@ -261,6 +261,9 @@
                     <property name="headers-visible">false</property>
                     <property name="model">languages</property>
                     <property name="visible">true</property>
+                    <style>
+                      <class name="i-wanna-be-listbox"/>
+                    </style>
                     <child internal-child="selection">
                       <object class="GtkTreeSelection">
                         <property name="mode">browse</property>
diff --git a/libide/libide.gresource.xml b/libide/libide.gresource.xml
index fb3f733..f8c256a 100644
--- a/libide/libide.gresource.xml
+++ b/libide/libide.gresource.xml
@@ -34,6 +34,7 @@
     <file compressed="true" alias="shared.css">../data/themes/shared.css</file>
     <file compressed="true" alias="shared/shared-editor.css">../data/themes/shared/shared-editor.css</file>
     <file compressed="true" alias="shared/shared-layout.css">../data/themes/shared/shared-layout.css</file>
+    <file compressed="true" 
alias="shared/shared-treeview.css">../data/themes/shared/shared-treeview.css</file>
   </gresource>
 
   <gresource prefix="/org/gnome/builder/modelines">
diff --git a/plugins/project-tree/gb-project-tree-addin.c b/plugins/project-tree/gb-project-tree-addin.c
index f485aed..448497a 100644
--- a/plugins/project-tree/gb-project-tree-addin.c
+++ b/plugins/project-tree/gb-project-tree-addin.c
@@ -81,6 +81,7 @@ gb_project_tree_addin_load (IdeWorkbenchAddin *addin,
                     G_CALLBACK (gtk_widget_destroyed),
                     &self->tree);
   dzl_gtk_widget_add_style_class (GTK_WIDGET (self->tree), "project-tree");
+  dzl_gtk_widget_add_style_class (GTK_WIDGET (self->tree), "i-wanna-be-listbox");
   gtk_container_add (GTK_CONTAINER (scroller), GTK_WIDGET (self->tree));
 
   ide_editor_sidebar_add_section (sidebar,
diff --git a/plugins/project-tree/themes/shared.css b/plugins/project-tree/themes/shared.css
index 3244f26..79880fb 100644
--- a/plugins/project-tree/themes/shared.css
+++ b/plugins/project-tree/themes/shared.css
@@ -4,17 +4,4 @@ ideeditorsidebar treeview.project-tree {
   -GtkTreeView-vertical-separator: 6;
   -gtk-icon-source: none;
   padding-left: 6px;
-  color: @theme_fg_color;
-}
-ideeditorsidebar treeview.project-tree:not(:selected) {
-  background: transparent;
-}
-ideeditorsidebar treeview.project-tree:selected {
-  color: @theme_selected_fg_color;
-}
-ideeditorsidebar treeview.project-tree:backdrop {
-  color: @theme_unfocused_fg_color;
-}
-ideeditorsidebar treeview.project-tree:selected:backdrop {
-  color: @theme_unfocused_selected_fg_color;
 }
diff --git a/plugins/symbol-tree/themes/shared.css b/plugins/symbol-tree/themes/shared.css
index 25378b8..c15d673 100644
--- a/plugins/symbol-tree/themes/shared.css
+++ b/plugins/symbol-tree/themes/shared.css
@@ -12,6 +12,9 @@ popover.symbols-button treeview {
   background: transparent;
   color: @theme_fg_color;
 }
+popover.symbols-button treeview:hover {
+  background-color: alpha(@theme_fg_color, 0.05);
+}
 popover.symbols-button treeview:backdrop {
   color: @theme_unfocused_fg_color;
 }


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