From 1ab35c3c64a46309786aa614200f5c464ef7df7c Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Thu, 19 Sep 2024 22:21:44 +0200 Subject: [PATCH 1/2] placeEntry: Expose setTextWithoutTriggeringSearch method Mark this as available to external usage. --- src/placeEntry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/placeEntry.js b/src/placeEntry.js index 6138b6ba..e2bde9b2 100644 --- a/src/placeEntry.js +++ b/src/placeEntry.js @@ -71,7 +71,7 @@ export class PlaceEntry extends Gtk.Entry { } if (this.text !== this._placeText) - this._setTextWithoutTriggerSearch(this._placeText); + this.setTextWithoutTriggeringSearch(this._placeText); this._place = p; @@ -125,7 +125,7 @@ export class PlaceEntry extends Gtk.Entry { this.add_css_class('search'); } - _setTextWithoutTriggerSearch(text) { + setTextWithoutTriggeringSearch(text) { this._setText = text; this.text = text; } -- GitLab From 0174cfc7cd75db8ee41fe57912061052e5653185 Mon Sep 17 00:00:00 2001 From: Marcus Lundblad Date: Thu, 19 Sep 2024 22:26:46 +0200 Subject: [PATCH 2/2] application: Fill in search entry with query Set the search entry text to the query text when launching a search query (e.g. by opening a maps: URI). --- src/application.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application.js b/src/application.js index 62e5fa0c..a3360151 100644 --- a/src/application.js +++ b/src/application.js @@ -252,8 +252,8 @@ export class Application extends Adw.Application { if (error) { this._mainWindow.showToast(_("An error has occurred")); } else { - // clear search entry - this._mainWindow.searchBar.text = ''; + // fill in search entry with query string + this._mainWindow.searchBar.setTextWithoutTriggeringSearch(query); if (places) { /* if there's only one place in results, show it directly -- GitLab