summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarcus Lundblad <ml@dfupdate.se>2023-01-07 16:47:53 +0100
committerMarcus Lundblad <ml@dfupdate.se>2023-01-17 22:53:47 +0100
commit05e26e670a3449374de7f9379e1f44a8491d2206 (patch)
tree533f92d131b5d644a7987fdea233e16394d417e9 /src
parent9fcf2b8436af3da666f01b325334e4e2eb35874a (diff)
downloadgnome-maps-05e26e670a3449374de7f9379e1f44a8491d2206.tar.gz
placePopover: Add public method to show a row
Diffstat (limited to 'src')
-rw-r--r--src/placePopover.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/placePopover.js b/src/placePopover.js
index 3a1fc1ad..2b0d3b29 100644
--- a/src/placePopover.js
+++ b/src/placePopover.js
@@ -118,6 +118,16 @@ export class PlacePopover extends SearchPopover {
}
}
+ /* Selects given row and ensures that it is visible. */
+ selectRow(row) {
+ this.list.select_row(row);
+ let adjustment = this.list.get_adjustment();
+ if (adjustment) {
+ let allocation = row.get_allocation();
+ adjustment.clamp_page(allocation.y, allocation.y + allocation.height);
+ }
+ }
+
_addRow(place, type, searchString) {
let row = new PlaceListRow({ place: place,
searchString: searchString,