[gnome-shell/wip/re-search: 10/17] popupMenu: Break separator drawing code out of PopupSeparatorMenuItem



commit ca90bbd8ceb45dca529ff952588550bb3af4af29
Author: Tanner Doshier <doshitan gmail com>
Date:   Wed Aug 15 20:28:49 2012 -0500

    popupMenu: Break separator drawing code out of PopupSeparatorMenuItem
    
    https://bugzilla.gnome.org/show_bug.cgi?id=681797

 data/theme/gnome-shell.css |    8 ++++++++
 js/ui/popupMenu.js         |   14 +++++++++++---
 js/ui/searchDisplay.js     |    4 ++--
 3 files changed, 21 insertions(+), 5 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index 16bf47a..dc9e99f 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -698,6 +698,14 @@ StButton.popup-menu-item:insensitive {
     spacing: 16px;
 }
 
+.search-section-separator {
+    -gradient-height: 1px;
+    -gradient-start: rgba(255,255,255,0);
+    -gradient-end: rgba(255,255,255,0.5);
+    -margin-horizontal: 1.5em;
+    height: 1px;
+}
+
 .search-section-content {
     /* This is the space between the provider icon and the results container */
     spacing: 25px;
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 3c49c5d..6eb47b5 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -398,9 +398,17 @@ const PopupSeparatorMenuItem = new Lang.Class({
         this.parent({ reactive: false,
                       can_focus: false});
 
-        this._drawingArea = new St.DrawingArea({ style_class: 'popup-separator-menu-item' });
-        this.addActor(this._drawingArea, { span: -1, expand: true });
-        this._drawingArea.connect('repaint', Lang.bind(this, this._onRepaint));
+        this._separator = new HorzSeparator({ style_class: 'popup-separator-menu-item' });
+        this.addActor(this._separator.actor, { span: -1, expand: true });
+    }
+});
+
+const HorzSeparator = new Lang.Class({
+    Name: 'HorzSeparator',
+
+    _init: function (params) {
+        this.actor = new St.DrawingArea(params);
+        this.actor.connect('repaint', Lang.bind(this, this._onRepaint));
     },
 
     _onRepaint: function(area) {
diff --git a/js/ui/searchDisplay.js b/js/ui/searchDisplay.js
index 30625c7..5d46aad 100644
--- a/js/ui/searchDisplay.js
+++ b/js/ui/searchDisplay.js
@@ -404,8 +404,8 @@ const SearchDisplay = new Lang.Class({
 
         let providerIcon;
         if (!isAppsProvider) {
-            let separator = new PopupMenu.PopupSeparatorMenuItem();
-            providerBox.add(separator.actor);
+            let separator = new PopupMenu.HorzSeparator({ style_class: 'search-section-separator' });
+            providerBox.add(separator.actor, { expand: true });
 
             providerIcon = new ProviderIcon(provider);
             providerIcon.connect('launch-search', Lang.bind(this, function(providerIcon) {



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