1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

feat: option to disable scratchpad

This commit is contained in:
2022-07-04 15:10:40 +02:00
parent a9a4344a71
commit 56b0a4815c
7 changed files with 53 additions and 12 deletions

View File

@ -96,6 +96,12 @@
</div>
</div>
</div>
<input
readonly
class="p-absolute"
style="width: 1px; height: 1px; opacity: 0"
type="text"
><!-- workaround for useFocusTrap $lastFocusable -->
</TransitionGroup>
</div>
</div>

View File

@ -126,6 +126,19 @@
</label>
</div>
</div>
<div class="form-group column col-12 mb-0">
<div class="col-5 col-sm-12">
<label class="form-label">
{{ t('message.disableScratchpad') }}
</label>
</div>
<div class="col-3 col-sm-12">
<label class="form-switch d-inline-block" @click.prevent="toggleDisableScratchpad">
<input type="checkbox" :checked="disableScratchpad">
<i class="form-icon" />
</label>
</div>
</div>
<div class="form-group column col-12">
<div class="col-5 col-sm-12">
<label class="form-label">
@ -337,6 +350,7 @@ const {
notificationsTimeout,
restoreTabs,
disableBlur,
disableScratchpad,
applicationTheme,
editorTheme,
editorFontSize
@ -349,6 +363,7 @@ const {
changePageSize,
changeRestoreTabs,
changeDisableBlur,
changeDisableScratchpad,
changeAutoComplete,
changeLineWrap,
changeApplicationTheme,
@ -490,6 +505,10 @@ const toggleDisableBlur = () => {
changeDisableBlur(!disableBlur.value);
};
const toggleDisableScratchpad = () => {
changeDisableScratchpad(!disableScratchpad.value);
};
const toggleAutoComplete = () => {
changeAutoComplete(!selectedAutoComplete.value);
};

View File

@ -71,7 +71,11 @@
<div class="settingbar-bottom-elements">
<ul class="settingbar-elements">
<li class="settingbar-element btn btn-link ex-tooltip" @click="showScratchpad">
<li
v-if="!disableScratchpad"
class="settingbar-element btn btn-link ex-tooltip"
@click="showScratchpad"
>
<i class="settingbar-element-icon mdi mdi-24px mdi-notebook-edit-outline text-light" />
<span class="ex-tooltip-content">{{ $t('word.scratchpad') }}</span>
</li>
@ -90,6 +94,7 @@ import { storeToRefs } from 'pinia';
import { useApplicationStore } from '@/stores/application';
import { useConnectionsStore } from '@/stores/connections';
import { useWorkspacesStore } from '@/stores/workspaces';
import { useSettingsStore } from '@/stores/settings';
import * as Draggable from 'vuedraggable';
import SettingBarContext from '@/components/SettingBarContext.vue';
import { ConnectionParams } from 'common/interfaces/antares';
@ -98,10 +103,12 @@ import { useElementBounding, useScroll } from '@vueuse/core';
const applicationStore = useApplicationStore();
const connectionsStore = useConnectionsStore();
const workspacesStore = useWorkspacesStore();
const settingsStore = useSettingsStore();
const { updateStatus } = storeToRefs(applicationStore);
const { connections: storedConnections, pinnedConnections, lastConnections } = storeToRefs(connectionsStore);
const { getSelected: selectedWorkspace } = storeToRefs(workspacesStore);
const { disableScratchpad } = storeToRefs(settingsStore);
const { showSettingModal, showScratchpad } = applicationStore;
const { getConnectionName, updatePinnedConnections } = connectionsStore;