From 76f9397bb55490999a24213964aa412f654965c1 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 5 Jul 2017 18:12:51 -0400 Subject: [PATCH] Add Tools tab to keyboard shortcuts, add panels key shortcuts --- css/80_app.css | 6 ++++++ data/core.yaml | 26 +++++++++++++++++--------- data/shortcuts.json | 40 ++++++++++++++++++++++++++++++++++++---- dist/locales/en.json | 30 ++++++++++++++++++++---------- modules/ui/shortcuts.js | 2 +- 5 files changed, 80 insertions(+), 24 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index e2ec1530c..190766206 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -3172,6 +3172,7 @@ img.tile-removing { .modal-shortcuts .modal-section:last-child { padding-top: 10px; + min-height: 275px; } .modal-shortcuts .tabs-bar { @@ -3206,6 +3207,11 @@ img.tile-removing { width: 50%; } +.modal-shortcuts .shortcut-tab-tools .shortcut-column { + flex: 1 1 100%; + width: 100%; +} + .modal-shortcuts td { padding-bottom: 5px; } diff --git a/data/core.yaml b/data/core.yaml index 3653dd58f..4d2ce97f7 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -274,6 +274,14 @@ en: truncated_list: "Edits by {users} and {count} others" info_panels: key: I + background: + key: B + title: Background + zoom: Zoom + vintage: Vintage + unknown: Unknown + show_tiles: Show Tiles + hide_tiles: Hide Tiles history: key: H title: History @@ -284,14 +292,6 @@ en: changeset: Changeset unknown: Unknown link_text: History on openstreetmap.org - background: - key: B - title: Background - zoom: Zoom - vintage: Vintage - unknown: Unknown - show_tiles: Show Tiles - hide_tiles: Hide Tiles location: key: L title: Location @@ -1101,7 +1101,6 @@ en: lasso: "Draw a selection lasso around features" with_selected: title: "With feature selected" - info_panels: "Toggle information panels" edit_menu: "Toggle edit menu" vertex_selected: title: "With node selected" @@ -1141,3 +1140,12 @@ en: undo: "Undo last action" redo: "Redo last action" save: "Save changes" + tools: + title: "Tools" + info: + title: "Information" + all: "Toggle all information panels" + background: "Toggle background panel" + history: "Toggle history panel" + location: "Toggle location panel" + measurement: "Toggle measurement panel" diff --git a/data/shortcuts.json b/data/shortcuts.json index 9b9f602f8..924d9b868 100644 --- a/data/shortcuts.json +++ b/data/shortcuts.json @@ -93,9 +93,8 @@ "shortcuts": ["Right-click", "shortcuts.key.space"], "text": "shortcuts.browsing.with_selected.edit_menu" }, { - "modifiers": ["⌘"], - "shortcuts": ["info_panels.key"], - "text": "shortcuts.browsing.with_selected.info_panels" + "shortcuts": [], + "text": "" }, { @@ -166,7 +165,7 @@ "shortcuts": ["Z"], "text": "shortcuts.editing.commands.undo" }, { - "modifiers": ["⌘","⇧"], + "modifiers": ["⌘", "⇧"], "shortcuts": ["Z"], "text": "shortcuts.editing.commands.redo" }, { @@ -221,5 +220,38 @@ ] } ] + }, { + "tab": "tools", + "text": "shortcuts.tools.title", + "columns" : [ + { + "rows": [ + { + "section": "info", + "text": "shortcuts.tools.info.title" + }, { + "modifiers": ["⌘"], + "shortcuts": ["info_panels.key"], + "text": "shortcuts.tools.info.all" + }, { + "modifiers": ["⌘", "⇧"], + "shortcuts": ["info_panels.background.key"], + "text": "shortcuts.tools.info.background" + }, { + "modifiers": ["⌘", "⇧"], + "shortcuts": ["info_panels.history.key"], + "text": "shortcuts.tools.info.history" + }, { + "modifiers": ["⌘", "⇧"], + "shortcuts": ["info_panels.location.key"], + "text": "shortcuts.tools.info.location" + }, { + "modifiers": ["⌘", "⇧"], + "shortcuts": ["info_panels.measurement.key"], + "text": "shortcuts.tools.info.measurement" + } + ] + } + ] } ]} diff --git a/dist/locales/en.json b/dist/locales/en.json index dacd734dd..d307aa31b 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -350,6 +350,15 @@ }, "info_panels": { "key": "I", + "background": { + "key": "B", + "title": "Background", + "zoom": "Zoom", + "vintage": "Vintage", + "unknown": "Unknown", + "show_tiles": "Show Tiles", + "hide_tiles": "Hide Tiles" + }, "history": { "key": "H", "title": "History", @@ -361,15 +370,6 @@ "unknown": "Unknown", "link_text": "History on openstreetmap.org" }, - "background": { - "key": "B", - "title": "Background", - "zoom": "Zoom", - "vintage": "Vintage", - "unknown": "Unknown", - "show_tiles": "Show Tiles", - "hide_tiles": "Hide Tiles" - }, "location": { "key": "L", "title": "Location", @@ -979,7 +979,6 @@ }, "with_selected": { "title": "With feature selected", - "info_panels": "Toggle information panels", "edit_menu": "Toggle edit menu" }, "vertex_selected": { @@ -1025,6 +1024,17 @@ "redo": "Redo last action", "save": "Save changes" } + }, + "tools": { + "title": "Tools", + "info": { + "title": "Information", + "all": "Toggle all information panels", + "background": "Toggle background panel", + "history": "Toggle history panel", + "location": "Toggle location panel", + "measurement": "Toggle measurement panel" + } } }, "presets": { diff --git a/modules/ui/shortcuts.js b/modules/ui/shortcuts.js index bf5245990..2e2a63d8f 100644 --- a/modules/ui/shortcuts.js +++ b/modules/ui/shortcuts.js @@ -105,7 +105,7 @@ export function uiShortcuts() { var shortcutsEnter = shortcuts .enter() .append('div') - .attr('class', 'shortcut-tab'); + .attr('class', function(d) { return 'shortcut-tab shortcut-tab-' + d.tab; }); var columnsEnter = shortcutsEnter .selectAll('.shortcut-column')