Skip to content

Commit d5c4237

Browse files
authored
Merge pull request #685 from PaulHax/mouse-instructions
feat(ControlsModal): list mouse view controls
2 parents 06a4282 + fade5fd commit d5c4237

File tree

5 files changed

+49
-23
lines changed

5 files changed

+49
-23
lines changed

src/components/AboutBox.vue

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
For investigational use only
88
</v-alert>
99
<v-card-text>
10+
<v-btn
11+
class="my-2"
12+
@click="openKeyboardShortcuts"
13+
prepend-icon="mdi-keyboard"
14+
color="secondary"
15+
>
16+
Keyboard Shortcuts and View Controls
17+
</v-btn>
1018
<h2 class="mt-2">About VolView</h2>
1119
<v-divider class="mb-2" />
1220
<p class="float-right">
@@ -198,6 +206,7 @@
198206
import { defineComponent } from 'vue';
199207
import { useDisplay } from 'vuetify';
200208
import VolViewFullLogo from './icons/VolViewFullLogo.vue';
209+
import { useKeyboardShortcutsStore } from '../store/keyboard-shortcuts';
201210
202211
export default defineComponent({
203212
name: 'AboutBox',
@@ -207,7 +216,13 @@ export default defineComponent({
207216
setup() {
208217
const display = useDisplay();
209218
219+
const keyboardStore = useKeyboardShortcutsStore();
220+
const openKeyboardShortcuts = () => {
221+
keyboardStore.settingsOpen = true;
222+
};
223+
210224
return {
225+
openKeyboardShortcuts,
211226
mobile: display.xs,
212227
versions: {
213228
volview: __VERSIONS__.volview,

src/components/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929
</div>
3030
</v-main>
31-
<keyboard-shortcuts />
31+
<controls-modal />
3232
</v-app>
3333
<persistent-overlay
3434
:disabled="!dragHover"
@@ -70,7 +70,7 @@ import LayoutGrid from '@/src/components/LayoutGrid.vue';
7070
import ModulePanel from '@/src/components/ModulePanel.vue';
7171
import DragAndDrop from '@/src/components/DragAndDrop.vue';
7272
import PersistentOverlay from '@/src/components/PersistentOverlay.vue';
73-
import KeyboardShortcuts from '@/src/components/KeyboardShortcuts.vue';
73+
import ControlsModal from '@/src/components/ControlsModal.vue';
7474
import { useImageStore } from '@/src/store/datasets-images';
7575
import { useServerStore } from '@/src/store/server';
7676
import { useGlobalErrorHook } from '@/src/composables/useGlobalErrorHook';
@@ -85,7 +85,7 @@ export default defineComponent({
8585
DragAndDrop,
8686
ModulePanel,
8787
PersistentOverlay,
88-
KeyboardShortcuts,
88+
ControlsModal,
8989
WelcomePage,
9090
AppBar,
9191
},
Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
<template>
22
<closeable-dialog v-model="keyboardStore.settingsOpen">
3-
<v-card>
4-
<v-card-title class="d-flex flex-row align-center">
5-
Keyboard Shortcuts
6-
</v-card-title>
7-
<v-table class="pa-4">
8-
<thead>
9-
<th class="text-left">Command</th>
10-
<th class="text-left">Keybinding</th>
11-
</thead>
3+
<v-card class="pa-4">
4+
<div class="text-h4 pb-2">View Controls</div>
5+
<v-table>
6+
<tbody>
7+
<tr>
8+
<td>Scroll Slices</td>
9+
<td>Mouse wheel or 2 finger vertical scroll</td>
10+
</tr>
11+
<tr>
12+
<td>Zoom</td>
13+
<td>Right mouse button + move vertically</td>
14+
</tr>
15+
<tr>
16+
<td>Pan</td>
17+
<td>Shift + left mouse button + move</td>
18+
</tr>
19+
</tbody>
20+
</v-table>
21+
22+
<div class="text-h4 pb-2">Keyboard Shortcuts</div>
23+
<v-table>
1224
<tbody>
1325
<tr v-for="[action, key] in bindings" :key="action">
1426
<td>{{ action }}</td>

src/components/Settings.vue

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
<v-card>
33
<v-card-title class="d-flex flex-row align-center">Settings</v-card-title>
44
<v-card-text>
5+
<v-btn
6+
class="my-2"
7+
@click="openKeyboardShortcuts"
8+
prepend-icon="mdi-keyboard"
9+
color="secondary"
10+
>
11+
Keyboard Shortcuts and View Controls
12+
</v-btn>
513
<v-switch
614
:label="`Dark Theme (${dark ? 'On' : 'Off'})`"
715
v-model="dark"
@@ -27,15 +35,6 @@
2735
hide-details
2836
></v-switch>
2937

30-
<v-btn
31-
class="my-2"
32-
@click="openKeyboardShortcuts"
33-
prepend-icon="mdi-keyboard"
34-
color="secondary"
35-
>
36-
Keyboard Shortcuts
37-
</v-btn>
38-
3938
<v-divider class="mt-2 mb-6"></v-divider>
4039
<dicom-web-settings />
4140

@@ -52,14 +51,14 @@ import { useTheme } from 'vuetify';
5251
import { useLocalStorage } from '@vueuse/core';
5352
5453
import { useKeyboardShortcutsStore } from '@/src/store/keyboard-shortcuts';
54+
import { useViewCameraStore } from '@/src/store/view-configs/camera';
5555
import DicomWebSettings from './dicom-web/DicomWebSettings.vue';
5656
import ServerSettings from './ServerSettings.vue';
5757
import { DarkTheme, LightTheme, ThemeStorageKey } from '../constants';
5858
import {
5959
useErrorReporting,
6060
errorReportingConfigured,
6161
} from '../utils/errorReporting';
62-
import { useViewCameraStore } from '@/src/store/view-configs/camera';
6362
6463
export default defineComponent({
6564
setup() {

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const ACTIONS = {
6161
},
6262

6363
mergeNewPolygon: {
64-
readable: 'Hold down to merge new polygons with overlapping polygons',
64+
readable: 'Hold to merge new polygons with overlapping polygons',
6565
},
6666

6767
showKeyboardShortcuts: {

0 commit comments

Comments
 (0)