diff options
author | Marcus Lundblad <ml@dfupdate.se> | 2023-05-03 22:30:12 +0200 |
---|---|---|
committer | Marcus Lundblad <ml@dfupdate.se> | 2023-05-06 23:55:31 +0200 |
commit | 26e4437d3dbd74cafe215278365a852d3543b1c9 (patch) | |
tree | d8def30ba9920088f69a988503c57574b62bbfaf | |
parent | e1c308cac42802846805e3e49de8ddb680a08bcf (diff) | |
download | gnome-maps-26e4437d3dbd74cafe215278365a852d3543b1c9.tar.gz |
mainWindow: Embed the map view in an overlay
This will allow us to add overlayed
zoom and rotation control buttons that
are not part of the map view (when exported
to an image).
-rw-r--r-- | data/ui/main-window.ui | 8 | ||||
-rw-r--r-- | src/mainWindow.js | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/data/ui/main-window.ui b/data/ui/main-window.ui index 881a3608..edb531f6 100644 --- a/data/ui/main-window.ui +++ b/data/ui/main-window.ui @@ -51,6 +51,14 @@ <child> <object class="GtkGrid" id="grid"> <child> + <object class="GtkOverlay" id="mapOverlay"> + <layout> + <property name="column">0</property> + <property name="row">0</property> + </layout> + </object> + </child> + <child> <object class="GtkBox" id="placeBarContainer"> <layout> <property name="column">0</property> diff --git a/src/mainWindow.js b/src/mainWindow.js index 2b63aee0..163ee4e2 100644 --- a/src/mainWindow.js +++ b/src/mainWindow.js @@ -107,7 +107,7 @@ export class MainWindow extends Gtk.ApplicationWindow { hexpand: true, vexpand: true }); - this._grid.attach(this._mapView, 0, 0, 1, 1); + this._mapOverlay.child = this._mapView; this._mapView.gotoUserLocation(false); @@ -670,5 +670,6 @@ GObject.registerClass({ 'actionBar', 'actionBarRevealer', 'placeBarContainer', - 'overlay'] + 'overlay', + 'mapOverlay'] }, MainWindow); |