[gnome-maps] placeButtons: Unselect place when Directions is clicked
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps] placeButtons: Unselect place when Directions is clicked
- Date: Tue, 9 Feb 2021 20:56:57 +0000 (UTC)
commit 13f641d7eade4008474354950ca0db63b61aa7fe
Author: James Westman <james flyingpimonster net>
Date: Thu Jan 21 16:03:24 2021 -0600
placeButtons: Unselect place when Directions is clicked
This way, the PlaceBar/PlaceDialog/MapBubble gets out of your way so you
can see the route.
src/placeBar.js | 14 +++++++++++---
src/placeButtons.js | 2 ++
2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/src/placeBar.js b/src/placeBar.js
index 323c3ace..0cb66da1 100644
--- a/src/placeBar.js
+++ b/src/placeBar.js
@@ -73,6 +73,11 @@ var PlaceBar = GObject.registerClass({
_updatePlace() {
this._updateVisibility();
+ if (this._dialog) {
+ this._dialog.destroy();
+ delete this._dialog;
+ }
+
if (!this.place) {
return;
}
@@ -119,12 +124,15 @@ var PlaceBar = GObject.registerClass({
this._box.add(this._currentLocationView);
}
} else {
- let dialog = new PlaceDialog.PlaceDialog ({ transient_for: this.get_toplevel(),
+ this._dialog = new PlaceDialog.PlaceDialog ({ transient_for: this.get_toplevel(),
modal: true,
mapView: this._mapView,
place: this.place });
- dialog.connect('response', () => dialog.destroy());
- dialog.show();
+ this._dialog.connect('response', () => {
+ this._dialog.destroy();
+ delete this._dialog;
+ });
+ this._dialog.show();
}
}
diff --git a/src/placeButtons.js b/src/placeButtons.js
index 24624f84..e8147bd4 100644
--- a/src/placeButtons.js
+++ b/src/placeButtons.js
@@ -125,6 +125,8 @@ var PlaceButtons = GObject.registerClass({
from.place = Application.geoclue.place;
to.place = this._place;
+ Application.application.selected_place = null;
+
query.thaw_notify();
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]