[gnome-characters] categoryList: Don't rely on old style classes



commit c9177deff8635362f02eb3da481b6e80ef1a4797
Author: Daiki Ueno <dueno src gnome org>
Date:   Mon Dec 14 17:24:02 2015 +0900

    categoryList: Don't rely on old style classes

 data/application.css |   13 +++++++++++--
 src/categoryList.js  |    9 +++------
 2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/data/application.css b/data/application.css
index e87e990..8788d3b 100644
--- a/data/application.css
+++ b/data/application.css
@@ -1,5 +1,14 @@
-.category-image, .category-label {
-    padding: 3pt;
+.categories {
+    background-color: shade(@theme_bg_color, 0.99);
+}
+
+.category {
+    padding: 15px;
+    padding-right: 30px;
+}
+
+.category-icon {
+    padding-right: 10px;
 }
 
 Gjs_MenuPopover {
diff --git a/src/categoryList.js b/src/categoryList.js
index 3ed789e..a85fe59 100644
--- a/src/categoryList.js
+++ b/src/categoryList.js
@@ -91,7 +91,6 @@ const CategoryListRowWidget = new Lang.Class({
         params = Params.fill(params, {});
         this.parent(params);
         this.category = category;
-        this.get_style_context().add_class('category-list-row');
         this.get_accessible().accessible_name =
             _('%s Category List Row').format(category.title);
 
@@ -101,7 +100,7 @@ const CategoryListRowWidget = new Lang.Class({
 
         let icon = new Gio.ThemedIcon({ name: category.icon_name });
         let image = Gtk.Image.new_from_gicon(icon, Gtk.IconSize.LARGE_TOOLBAR);
-        image.get_style_context().add_class('category-image');
+        image.get_style_context().add_class('category-icon');
         hbox.pack_start(image, false, false, 2);
 
         let label = new Gtk.Label({ label: Gettext.gettext(category.title),
@@ -119,16 +118,14 @@ const CategoryListWidget = new Lang.Class({
         params = Params.fill(params, {});
         this.parent(params);
 
-        // Mimic GtkStackSidebar to take advantage of the standard theme.
-        this.get_style_context().add_class('sidebar');
+        this.get_style_context().add_class('categories');
 
         this._ensureCategoryList();
 
         for (let index in this._categoryList) {
             let category = this._categoryList[index];
             let rowWidget = new CategoryListRowWidget({}, category);
-            // Mimic GtkStackSidebar to take advantage of the standard theme.
-            rowWidget.get_style_context().add_class('sidebar-item');
+            rowWidget.get_style_context().add_class('category');
             this.add(rowWidget);
         }
     },


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