[gnome-maps/wip/placeEntry: 1/3] SearchPopup: forward popover properties



commit 75e1908e5c50f8de7a0b0d12e8b8435b39468bb3
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date:   Thu Jun 12 05:11:11 2014 +0200

    SearchPopup: forward popover properties
    
    Take in a full properties object and forward that to GtkPopover instead
    of hardcoding the properties to pass.
    This makes searchPopup a bit more flexible in other settings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731545

 src/searchPopup.js |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/src/searchPopup.js b/src/searchPopup.js
index 6874e95..f54d58c 100644
--- a/src/searchPopup.js
+++ b/src/searchPopup.js
@@ -38,8 +38,9 @@ const SearchPopup = new Lang.Class({
     Name: 'SearchPopup',
     Extends: Gtk.Popover,
 
-    _init: function(relativeTo, numVisible) {
-        this._numVisible = numVisible;
+    _init: function(props) {
+        this._numVisible = props.num_visible;
+        delete props.num_visible;
 
         let ui = Utils.getUIObject('search-popup', ['scrolled-window',
                                                     'stack',
@@ -60,13 +61,10 @@ const SearchPopup = new Lang.Class({
         this._treeView.connect('row-activated',
                                this._onRowActivated.bind(this));
         this._initList();
-        this.height_request = this._cellHeight * numVisible;
+        this.height_request = this._cellHeight * this._numVisible;
         this._scrolledWindow.set_min_content_height(this.height_request);
 
-        this.parent({ relative_to: relativeTo,
-                      width_request: 500,
-                      no_show_all: true,
-                      visible: true });
+        this.parent(props);
 
         this.get_style_context().add_class('maps-popover');
         this.add(this._stack);


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