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 760656 - Turn layersPopover.js into a composite templated widget
Turn layersPopover.js into a composite templated widget
Status: RESOLVED FIXED
Product: gnome-maps
Classification: Applications
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: gnome-maps-maint
gnome-maps-maint
Depends on:
Blocks:
 
 
Reported: 2016-01-15 06:17 UTC by Jonas Danielsson
Modified: 2016-01-29 23:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Turn layersPopover.js into a composite templated widget (5.99 KB, patch)
2016-01-26 12:59 UTC, Alaf
needs-work Details | Review
layersPopover: Convert to composite template (9.50 KB, patch)
2016-01-26 18:52 UTC, Alaf
committed Details | Review

Description Jonas Danielsson 2016-01-15 06:17:26 UTC
The file layersPopover.js right now uses GtkBuilder to load UI resources from layers-popover.ui. We want to convert to using templates instead.

Look at for instance zoomControl.js/zoom-control.ui or sidebar.js/sidebar.ui to get inspiration!
Comment 1 Alaf 2016-01-26 12:59:12 UTC
Created attachment 319745 [details] [review]
Turn layersPopover.js into a composite templated widget
Comment 2 Jonas Danielsson 2016-01-26 15:43:20 UTC
Review of attachment 319745 [details] [review]:

Thanks!

Don't you also need to change the ui file to

  <template class="Gjs_LayersPopover" parent="GtkPopover"> ?

Like for instance sidebar.ui?

::: data/ui/layers-popover.ui
@@ +22,2 @@
             <property name="visible">True</property>
+            <property name="pixbuf">data/media/maptype-street.png</property>

why is this needed? And why can't we use icon-name for these?
Comment 3 Jonas Danielsson 2016-01-26 15:43:51 UTC
Review of attachment 319745 [details] [review]:

Also, could commit log be something like:

"layersPopover: Convert to composite template"
Comment 4 Alaf 2016-01-26 18:50:05 UTC
Review of attachment 319745 [details] [review]:

::: data/ui/layers-popover.ui
@@ +22,2 @@
             <property name="visible">True</property>
+            <property name="pixbuf">data/media/maptype-street.png</property>

Without data/media/ it can't find .png file.

I am not sure why behavior was different before but now it said:

Could not load image 'maptype-street.png': Failed to open file '/home/alaf/jhbuild/checkout/gnome-maps/maptype-street.png': No such file or directory

So I added data/media/ , now it works fine.
Comment 5 Alaf 2016-01-26 18:52:40 UTC
Created attachment 319788 [details] [review]
layersPopover: Convert to composite template
Comment 6 Jonas Danielsson 2016-01-29 23:22:23 UTC
Attachment 319788 [details] pushed as 68fe080 - layersPopover: Convert to composite template