aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorTerry Truong <terry06890@gmail.com>2022-06-29 21:20:28 +1000
committerTerry Truong <terry06890@gmail.com>2022-06-29 21:28:49 +1000
commit6ab6d5884b715560f789a114cdb8e0d98d2e0940 (patch)
tree9d6ce18cd33ccec2ae32521b9dc50533700cf1e9 /src/components
parente4c2de4f953e34f5f5e27f6574943770090b4ce0 (diff)
Add setting for disabling keyboard shortcuts
Avoid showing the setting on touch devices
Diffstat (limited to 'src/components')
-rw-r--r--src/components/SettingsModal.vue8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/SettingsModal.vue b/src/components/SettingsModal.vue
index 6512aa4..20259e9 100644
--- a/src/components/SettingsModal.vue
+++ b/src/components/SettingsModal.vue
@@ -85,6 +85,10 @@
<label> <input type="checkbox" v-model="uiOpts.searchJumpMode"
@change="onSettingChg('UI', 'searchJumpMode')"/> Skip search animation </label>
</div>
+ <div v-if="!onTouchDevice">
+ <label> <input type="checkbox" v-model="uiOpts.disableShortcuts"
+ @change="onSettingChg('UI', 'disableShortcuts')"/> Disable keyboard shortcuts </label>
+ </div>
</div>
<s-button class="mx-auto mt-2" :style="{color: uiOpts.textColor, backgroundColor: uiOpts.bgColor}"
@click="onResetAll">
@@ -105,6 +109,7 @@ import SButton from './SButton.vue';
import CloseIcon from './icon/CloseIcon.vue';
import {UiOptions, OptionType, getDefaultLytOpts, getDefaultUiOpts} from '../lib';
import {LayoutOptions} from '../layout';
+import {onTouchDevice} from '../util';
export default defineComponent({
props: {
@@ -113,10 +118,11 @@ export default defineComponent({
},
data(){
return {
- saved: false, // Set to true after a setting is saved
sweepLeaves: this.lytOpts.layoutType == 'sweep',
// For making only two of 'layoutType's values available for user selection
+ saved: false, // Set to true after a setting is saved
settingChgTimeout: 0, // Use to throttle some setting-change handling
+ onTouchDevice: onTouchDevice(),
};
},
computed: {