From 419bf964fa79f9dbca4995fb4e9c82f286bd9c8e Mon Sep 17 00:00:00 2001 From: Aleksandr Shoronov Date: Wed, 4 Dec 2024 13:11:10 +0200 Subject: [PATCH] Fix keybindings ordering and tooltips --- src/ui.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/ui.js b/src/ui.js index ff9edb697..82b287a8a 100644 --- a/src/ui.js +++ b/src/ui.js @@ -104,11 +104,22 @@ 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() }); @@ -118,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,