diff options
author | Marcus Lundblad <ml@dfupdate.se> | 2023-01-26 22:40:29 +0100 |
---|---|---|
committer | Marcus Lundblad <ml@dfupdate.se> | 2023-05-17 22:54:45 +0200 |
commit | d65b00a0c6e545d7608bb05681ac2490afc41c5b (patch) | |
tree | 50fe965c3dc2dfd339df50e49f552c09233e53b3 | |
parent | 6b706af3de505974281482473da560c28465e35a (diff) | |
download | gnome-maps-d65b00a0c6e545d7608bb05681ac2490afc41c5b.tar.gz |
placeEntry: Add construct parameter to determine POI mode
Adds a parameter to control if the attached popover should
have POI browsing functionallity.
-rw-r--r-- | src/placeEntry.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/placeEntry.js b/src/placeEntry.js index c1f83fd8..c59206c1 100644 --- a/src/placeEntry.js +++ b/src/placeEntry.js @@ -89,7 +89,8 @@ export class PlaceEntry extends Gtk.SearchEntry { return this._mapView; } - constructor({mapView, maxChars, matchRoute, ...params}) { + constructor({mapView, maxChars, matchRoute, hasPoiBrowser = false, + ...params}) { super(params); this._mapView = mapView; @@ -103,7 +104,7 @@ export class PlaceEntry extends Gtk.SearchEntry { this.connect('activate', this._onActivate.bind(this)); - this._popover = this._createPopover(maxChars); + this._popover = this._createPopover(maxChars, hasPoiBrowser); this.connect('search-changed', this._onSearchChanged.bind(this)); @@ -170,9 +171,10 @@ export class PlaceEntry extends Gtk.SearchEntry { placeA.location.longitude === placeB.location.longitude); } - _createPopover(maxChars) { + _createPopover(maxChars, hasPoiBrowser) { let popover = new PlacePopover({ entry: this, - maxChars: maxChars }); + maxChars: maxChars, + hasPoiBrowser: hasPoiBrowser }); popover.set_parent(this); this.set_key_capture_widget(popover); |