[gnome-shell] Port more to CSS



commit c4a49b4de203e70c1fc461925d563966f5677f28
Author: Colin Walters <walters verbum org>
Date:   Tue Oct 27 13:27:00 2009 -0400

    Port more to CSS
    
    https://bugzilla.gnome.org/show_bug.cgi?id=599661

 data/theme/gnome-shell.css |   13 +++++++++++++
 js/ui/lookingGlass.js      |   20 ++++++++------------
 2 files changed, 21 insertions(+), 12 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index 7fc91ff..3c2a6dc 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -364,6 +364,19 @@ StTooltip {
   border-radius: 4px;
 }
 
+#LookingGlassDialog .labels {
+  spacing: 4px;
+}
+
+#LookingGlassDialog .notebook-tab {
+  padding: 2px;
+}
+
+#LookingGlassDialog .notebook-tab:selected {
+  border: 1px solid #88ff66;
+  padding: 1px;
+}
+
 #LookingGlassDialog StLabel
 {
   color: #88ff66;
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index 3583624..469c86d 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -39,24 +39,21 @@ Notebook.prototype = {
     _init: function() {
         this.actor = new St.BoxLayout({ vertical: true });
 
-        this.tabControls = new Big.Box({ orientation: Big.BoxOrientation.HORIZONTAL,
-                                         spacing: 4, padding: 2 });
+        this.tabControls = new St.BoxLayout({ style_class: "labels" });
 
         this._selectedIndex = -1;
         this._tabs = [];
     },
 
     appendPage: function(name, child) {
-        let labelOuterBox = new Big.Box({ padding: 2 });
-        let labelBox = new St.BoxLayout({ reactive: true });
-        labelOuterBox.append(labelBox, Big.BoxPackFlags.NONE);
-        let label = new St.Label({ text: name });
-        labelBox.connect('button-press-event', Lang.bind(this, function () {
+        let labelBox = new St.BoxLayout({ style_class: "notebook-tab" });
+        let label = new St.Button({ label: name });
+        label.connect('clicked', Lang.bind(this, function () {
             this.selectChild(child);
             return true;
         }));
         labelBox.add(label, { expand: true });
-        this.tabControls.append(labelOuterBox, Big.BoxPackFlags.NONE);
+        this.tabControls.add(labelBox);
 
         let scrollview = new St.ScrollView({ x_fill: true, y_fill: true });
         scrollview.get_hscroll_bar().hide();
@@ -64,6 +61,7 @@ Notebook.prototype = {
 
         let tabData = { child: child,
                         labelBox: labelBox,
+                        label: label,
                         scrollView: scrollview,
                         _scrollToBottom: false };
         this._tabs.push(tabData);
@@ -82,8 +80,7 @@ Notebook.prototype = {
         if (this._selectedIndex < 0)
             return;
         let tabData = this._tabs[this._selectedIndex];
-        tabData.labelBox.padding = 2;
-        tabData.labelBox.border = 0;
+        tabData.labelBox.set_style_pseudo_class(null);
         tabData.scrollView.hide();
         this._selectedIndex = -1;
     },
@@ -97,8 +94,7 @@ Notebook.prototype = {
             return;
         }
         let tabData = this._tabs[index];
-        tabData.labelBox.padding = 1;
-        tabData.labelBox.border = 1;
+        tabData.labelBox.set_style_pseudo_class('selected');
         tabData.scrollView.show();
         this._selectedIndex = index;
         this.emit('selection', tabData.child);



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