After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 722869 - Use GtkPopover for search popup
Use GtkPopover for search popup
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-24 00:06 UTC by Zeeshan Ali
Modified: 2014-02-11 12:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
SearchPopup as GtkPopover over mapView (471.76 KB, image/png)
2014-01-28 11:41 UTC, Jonas Danielsson
  Details
SearchPopup as GtkPopover over blue window (38.53 KB, image/png)
2014-01-28 11:42 UTC, Jonas Danielsson
  Details
SearchPopup as GtkPopover over mapView with margin 0 (868.15 KB, image/png)
2014-01-28 12:13 UTC, Jonas Danielsson
  Details
searchPopup: make GtkStack the top-level widget (4.34 KB, patch)
2014-02-06 12:52 UTC, Jonas Danielsson
committed Details | Review
searchPopup: Convert to GtkPopover (3.91 KB, patch)
2014-02-06 12:52 UTC, Jonas Danielsson
committed Details | Review

Description Zeeshan Ali 2014-01-24 00:06:52 UTC
Now that Gtk+ has this awesome widget:

http://blogs.gnome.org/mclasen/2014/01/22/and-now-popovers/

I think it makes sense to put our search popup into this widget.
Comment 1 Mattias Bengtsson 2014-01-24 05:44:35 UTC
Yeah either a popover or a modal (I have no real preference here, just noting that that would be another possibility).
Comment 2 Jonas Danielsson 2014-01-24 12:50:28 UTC
The Popover always points at something, tho? Should the searcPopup point?
Comment 3 Zeeshan Ali 2014-01-24 13:40:04 UTC
(In reply to comment #2)
> The Popover always points at something, tho? Should the searcPopup point?

The search entry of course :)
Comment 4 Jonas Danielsson 2014-01-28 11:41:27 UTC
I think we will run into the problem of no transparency over Clutter.

I'll attach two picture to demonstrate, one with the searchPopup as a GtkPopover over mapView and one where I didn't add the mapView and instead have a blue background.
Comment 5 Jonas Danielsson 2014-01-28 11:41:54 UTC
Created attachment 267398 [details]
SearchPopup as GtkPopover over mapView
Comment 6 Jonas Danielsson 2014-01-28 11:42:13 UTC
Created attachment 267399 [details]
SearchPopup as GtkPopover over blue window
Comment 7 Jonas Danielsson 2014-01-28 12:13:20 UTC
Created attachment 267401 [details]
SearchPopup as GtkPopover over mapView with margin 0

The GtkPopover css in Adwaita sets a margin of 10, we can have our own css and set margin to 0px.
Then it can look something like this.
Comment 8 Zeeshan Ali 2014-01-28 14:19:33 UTC
(In reply to comment #7)
> Created an attachment (id=267401) [details]
> SearchPopup as GtkPopover over mapView with margin 0
> 
> The GtkPopover css in Adwaita sets a margin of 10, we can have our own css and
> set margin to 0px.
> Then it can look something like this.

This looks ok.
Comment 9 Jonas Danielsson 2014-02-06 12:52:41 UTC
Created attachment 268286 [details] [review]
searchPopup: make GtkStack the top-level widget

It is bad practice to add children that can not scroll to a
GtkScrolledWindow.

This patch makes the GtkStack the top-level widget of the
search-popup ui file. With this patch the GtkTreeView will be the
only child of the GtkScrolledWindow.

This change also fixes a buglet where the spinner would not be
centered in the visible popup when scrollbars where visible.
Comment 10 Jonas Danielsson 2014-02-06 12:52:45 UTC
Created attachment 268287 [details] [review]
searchPopup: Convert to GtkPopover
Comment 11 Jonas Danielsson 2014-02-06 12:54:20 UTC
Ok so the first patch is not really needed for the second. But I found it while doing the patch so I appended it here.

The first one also seem to solve the bug with the missing scrollbars :)
At least it is not reproducible anymore.
Comment 12 Mattias Bengtsson 2014-02-06 20:32:36 UTC
Review of attachment 268286 [details] [review]:

This looks good to me.
Comment 13 Mattias Bengtsson 2014-02-06 20:37:04 UTC
Review of attachment 268287 [details] [review]:

Looks good! Thanks for doing this.

::: src/mainWindow.js
@@ +46,3 @@
 const _WINDOW_MIN_HEIGHT = 500;
 
+const _PLACE_ICON_SIZE = 24;

Perhaps a separate patch? But yeah, 24px looks much better than 20px.

::: src/searchPopup.js
@@ +58,3 @@
                       visible: true });
 
+        this.get_style_context().add_class('maps-popover');

I wish we had templates so this could go into the ui-file instead.
Comment 14 Mattias Bengtsson 2014-02-06 20:37:05 UTC
Review of attachment 268287 [details] [review]:

Looks good! Thanks for doing this.

::: src/mainWindow.js
@@ +46,3 @@
 const _WINDOW_MIN_HEIGHT = 500;
 
+const _PLACE_ICON_SIZE = 24;

Perhaps a separate patch? But yeah, 24px looks much better than 20px.

::: src/searchPopup.js
@@ +58,3 @@
                       visible: true });
 
+        this.get_style_context().add_class('maps-popover');

I wish we had templates so this could go into the ui-file instead.
Comment 15 Jonas Danielsson 2014-02-08 13:08:31 UTC
Review of attachment 268287 [details] [review]:

::: src/mainWindow.js
@@ +46,3 @@
 const _WINDOW_MIN_HEIGHT = 500;
 
+const _PLACE_ICON_SIZE = 24;

Yeah, if this gets accepted-commit I'll push without this change.

Thanks for review.
Comment 16 Mattias Bengtsson 2014-02-08 16:48:05 UTC
Zeeshan: what do you think? :)
Comment 17 Zeeshan Ali 2014-02-11 01:15:41 UTC
Review of attachment 268287 [details] [review]:

looks good otherwise

::: data/gnome-maps.css
@@ +7,3 @@
 }
 
+.maps-popover {

why the name change?
Comment 18 Zeeshan Ali 2014-02-11 01:17:00 UTC
Review of attachment 268286 [details] [review]:

ack
Comment 19 Jonas Danielsson 2014-02-11 11:18:30 UTC
Review of attachment 268287 [details] [review]:

::: data/gnome-maps.css
@@ +7,3 @@
 }
 
+.maps-popover {

The idea was that we might want popovers on other places and this should be the style for them.
If we want something that is unique for the search-popup then we can create a class for that.


You want it in a separate patch? Or not at all? :)
Comment 20 Zeeshan Ali 2014-02-11 12:09:50 UTC
Review of attachment 268287 [details] [review]:

::: data/gnome-maps.css
@@ +7,3 @@
 }
 
+.maps-popover {

Ah ok. Separate patch will give you opportunity to put the justification in the commit log so it would be better but no strong feelings in this case. In any case, feel free to push directly now.
Comment 21 Jonas Danielsson 2014-02-11 12:19:13 UTC
Attachment 268286 [details] pushed as 2c533ed - searchPopup: make GtkStack the top-level widget
Attachment 268287 [details] pushed as dbe68f2 - searchPopup: Convert to GtkPopover