summaryrefslogtreecommitdiff
path: root/src/mapBubble.js
diff options
context:
space:
mode:
authorJames Westman <james@flyingpimonster.net>2020-09-27 21:32:42 -0500
committerJames Westman <james@flyingpimonster.net>2020-11-12 16:22:45 -0600
commitb77378cdbde29c74f01d458ea2c74f6d3bc3b361 (patch)
tree7df116951b49670242ceac73e3b7421f358e22b0 /src/mapBubble.js
parentd2340b8c1b89e32bffc6507a84f075cce4cb3b30 (diff)
downloadgnome-maps-b77378cdbde29c74f01d458ea2c74f6d3bc3b361.tar.gz
userLocationBubble: Design improvements
- Remove the Directions button. It's counterintuitive, since usually you click Directions to route to a place, not from one. It doesn't really serve any purpose--you can do the same thing more easily by searching for the place you want to go and clicking the directions button there. - Use the same style as place bubbles to show information (using rows with icons and separators) - Use title caps for "Current Location" - Slightly change the layout to avoid awkward whitespace with the Directions button removed
Diffstat (limited to 'src/mapBubble.js')
-rw-r--r--src/mapBubble.js36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/mapBubble.js b/src/mapBubble.js
index b1c018a7..9383022d 100644
--- a/src/mapBubble.js
+++ b/src/mapBubble.js
@@ -27,6 +27,7 @@ const Mainloop = imports.mainloop;
const Application = imports.application;
const ContactPlace = imports.contactPlace;
+const GeocodeFactory = imports.geocode;
const OSMAccountDialog = imports.osmAccountDialog;
const OSMEditDialog = imports.osmEditDialog;
const OSMUtils = imports.osmUtils;
@@ -60,9 +61,6 @@ class MapBubble extends Gtk.Popover {
let buttonFlags = params.buttons || Button.NONE;
delete params.buttons;
- let routeFrom = params.routeFrom;
- delete params.routeFrom;
-
let checkInMatchPlace = params.checkInMatchPlace;
if (checkInMatchPlace !== false)
checkInMatchPlace = true;
@@ -83,6 +81,8 @@ class MapBubble extends Gtk.Popover {
'bubble-button-area',
'bubble-route-button',
'bubble-send-to-button',
+ 'bubble-send-to-button-alt',
+ 'title-box',
'bubble-favorite-button',
'bubble-check-in-button',
'bubble-edit-button',
@@ -101,7 +101,7 @@ class MapBubble extends Gtk.Popover {
ui.bubbleButtonArea.visible = false;
else {
if (buttonFlags & Button.ROUTE)
- this._initRouteButton(ui.bubbleRouteButton, routeFrom);
+ this._initRouteButton(ui.bubbleRouteButton);
if (buttonFlags & Button.SEND_TO)
this._initSendToButton(ui.bubbleSendToButton);
if (buttonFlags & Button.FAVORITE)
@@ -112,6 +112,20 @@ class MapBubble extends Gtk.Popover {
this._initEditButton(ui.bubbleEditButton);
}
+ if (this.place.isCurrentLocation) {
+ /* Current Location bubbles have a slightly different layout, to
+ avoid awkward whitespace */
+
+ /* hide the normal button area */
+ ui.bubbleButtonArea.visible = false;
+ /* show the top-end-corner share button instead */
+ this._initSendToButton(ui.bubbleSendToButtonAlt);
+ /* adjust some margins */
+ ui.titleBox.margin = 12;
+ ui.titleBox.marginStart = 18;
+ ui.titleBox.spacing = 18;
+ }
+
this.add(this._mainStack);
/* Set up contact avatar */
@@ -213,7 +227,7 @@ class MapBubble extends Gtk.Popover {
});
}
- _initRouteButton(button, routeFrom) {
+ _initRouteButton(button) {
let query = Application.routeQuery;
let from = query.points[0];
let to = query.points[query.points.length - 1];
@@ -224,13 +238,11 @@ class MapBubble extends Gtk.Popover {
query.freeze_notify();
query.reset();
Application.routingDelegator.reset();
- if (routeFrom) {
- from.place = this._place;
- } else {
- if (Application.geoclue.place)
- from.place = Application.geoclue.place;
- to.place = this._place;
- }
+
+ if (Application.geoclue.place)
+ from.place = Application.geoclue.place;
+ to.place = this._place;
+
this.destroy();
query.thaw_notify();
});