summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Danielsson <jonas@threetimestwo.org>2014-02-06 13:47:29 +0100
committerJonas Danielsson <jonas@threetimestwo.org>2014-02-11 13:16:38 +0100
commitdbe68f28484b858abfeb2099130d03647af22e7d (patch)
treed6a12644b752504d2a955907395846a222591deb
parent2c533ed05cb098bc41428c765946b7d95bcfc307 (diff)
downloadgnome-maps-dbe68f28484b858abfeb2099130d03647af22e7d.tar.gz
searchPopup: Convert to GtkPopover
https://bugzilla.gnome.org/show_bug.cgi?id=722869
-rw-r--r--data/gnome-maps.css8
-rw-r--r--src/mainWindow.js4
-rw-r--r--src/search-popup.ui3
-rw-r--r--src/searchPopup.js16
4 files changed, 11 insertions, 20 deletions
diff --git a/data/gnome-maps.css b/data/gnome-maps.css
index 9a1745d8..90b699a5 100644
--- a/data/gnome-maps.css
+++ b/data/gnome-maps.css
@@ -7,11 +7,9 @@
}
.search-popup {
- border-style: solid;
- border-width: 5px;
- border-color: black;
- border-radius: 6px 6px 6px 6px;
- background-color: white;
+ margin: 0px;
+ padding: 5px;
+ border-radius: 0px;
}
.zoom-control {
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 97f6261f..00fd633f 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -82,8 +82,6 @@ const MainWindow = new Lang.Class({
this._initSignals();
this._restoreWindowGeometry();
- this._mapOverlay.add_overlay(this._searchPopup);
-
grid.add(this._mapOverlay);
grid.show_all();
@@ -100,7 +98,7 @@ const MainWindow = new Lang.Class({
},
_initSearchWidgets: function() {
- this._searchPopup = new SearchPopup.SearchPopup(10);
+ this._searchPopup = new SearchPopup.SearchPopup(this._searchEntry, 10);
let model = new Gtk.ListStore();
model.set_column_types([GdkPixbuf.Pixbuf,
diff --git a/src/search-popup.ui b/src/search-popup.ui
index 13696c4a..1d675078 100644
--- a/src/search-popup.ui
+++ b/src/search-popup.ui
@@ -5,9 +5,6 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="transition-type">crossfade</property>
- <style>
- <class name="search-popup" />
- </style>
<child>
<object class="GtkScrolledWindow" id="scrolled-window">
<property name="visible">True</property>
diff --git a/src/searchPopup.js b/src/searchPopup.js
index 40aa3915..aa33a056 100644
--- a/src/searchPopup.js
+++ b/src/searchPopup.js
@@ -30,16 +30,15 @@ const Columns = {
const SearchPopup = new Lang.Class({
Name: 'SearchPopup',
- Extends: Gtk.Bin,
+ Extends: Gtk.Popover,
- _init: function(numVisible) {
+ _init: function(relativeTo, numVisible) {
this._numVisible = numVisible;
- let ui = Utils.getUIObject('search-popup', ['frame',
- 'scrolled-window',
+ let ui = Utils.getUIObject('search-popup', ['scrolled-window',
'stack',
'spinner',
- 'treeview']);
+ 'treeview',]);
this._stack = ui.stack;
this._scrolledWindow = ui.scrolledWindow;
@@ -53,13 +52,12 @@ const SearchPopup = new Lang.Class({
this.height_request = this._cellHeight * this._numVisible;
this._scrolledWindow.set_min_content_height(this.height_request);
- this.parent({ width_request: 500,
- halign: Gtk.Align.CENTER,
- valign: Gtk.Align.START,
- margin_top: 10,
+ this.parent({ relative_to: relativeTo,
+ width_request: 500,
no_show_all: true,
visible: true });
+ this.get_style_context().add_class('search-popup');
this.add(this._stack);
this.hide();
},