From 625fc3f91d97227c0d619c91d31e03cff44c28ab Mon Sep 17 00:00:00 2001 From: George Moon Date: Tue, 20 Feb 2024 11:41:12 +0100 Subject: [PATCH] Updated controls ordering and UI tooltips to be consistent with keybindings --- src/ui.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ui.js b/src/ui.js index 7add8d11c..7bc2cb58d 100644 --- a/src/ui.js +++ b/src/ui.js @@ -105,11 +105,21 @@ export default function(ctx) { if (!controls) return controlGroup; + if (controls[Constants.types.POINT]) { + buttonElements[Constants.types.POINT] = createControlButton(Constants.types.POINT, { + container: controlGroup, + className: Constants.classes.CONTROL_BUTTON_POINT, + title: `Marker tool ${ctx.options.keybindings ? '(1)' : ''}`, + onActivate: () => ctx.events.changeMode(Constants.modes.DRAW_POINT), + onDeactivate: () => ctx.events.trash() + }); + } + if (controls[Constants.types.LINE]) { buttonElements[Constants.types.LINE] = createControlButton(Constants.types.LINE, { container: controlGroup, className: Constants.classes.CONTROL_BUTTON_LINE, - title: `LineString tool ${ctx.options.keybindings ? '(l)' : ''}`, + title: `LineString tool ${ctx.options.keybindings ? '(2)' : ''}`, onActivate: () => ctx.events.changeMode(Constants.modes.DRAW_LINE_STRING), onDeactivate: () => ctx.events.trash() }); @@ -119,22 +129,12 @@ export default function(ctx) { buttonElements[Constants.types.POLYGON] = createControlButton(Constants.types.POLYGON, { container: controlGroup, className: Constants.classes.CONTROL_BUTTON_POLYGON, - title: `Polygon tool ${ctx.options.keybindings ? '(p)' : ''}`, + title: `Polygon tool ${ctx.options.keybindings ? '(3)' : ''}`, onActivate: () => ctx.events.changeMode(Constants.modes.DRAW_POLYGON), onDeactivate: () => ctx.events.trash() }); } - if (controls[Constants.types.POINT]) { - buttonElements[Constants.types.POINT] = createControlButton(Constants.types.POINT, { - container: controlGroup, - className: Constants.classes.CONTROL_BUTTON_POINT, - title: `Marker tool ${ctx.options.keybindings ? '(m)' : ''}`, - onActivate: () => ctx.events.changeMode(Constants.modes.DRAW_POINT), - onDeactivate: () => ctx.events.trash() - }); - } - if (controls.trash) { buttonElements.trash = createControlButton('trash', { container: controlGroup,