feat(UI): option to disable blur effects, closes #209

This commit is contained in:
Fabio Di Stasio 2022-03-22 16:13:44 +01:00
parent 8f3efabb69
commit e9079adb25
5 changed files with 39 additions and 6 deletions

View File

@ -1,5 +1,5 @@
<template> <template>
<div id="wrapper" :class="`theme-${applicationTheme}`"> <div id="wrapper" :class="[`theme-${applicationTheme}`, !disableBlur || 'no-blur']">
<TheTitleBar /> <TheTitleBar />
<div id="window-content"> <div id="window-content">
<TheSettingBar /> <TheSettingBar />
@ -51,6 +51,7 @@ export default {
isScratchpad: 'application/isScratchpad', isScratchpad: 'application/isScratchpad',
connections: 'connections/getConnections', connections: 'connections/getConnections',
applicationTheme: 'settings/getApplicationTheme', applicationTheme: 'settings/getApplicationTheme',
disableBlur: 'settings/getDisableBlur',
isUnsavedDiscardModal: 'workspaces/isUnsavedDiscardModal' isUnsavedDiscardModal: 'workspaces/isUnsavedDiscardModal'
}) })
}, },

View File

@ -117,6 +117,19 @@
</label> </label>
</div> </div>
</div> </div>
<div class="form-group mb-0">
<div class="col-7 col-sm-12">
<label class="form-label">
{{ $t('message.disableBlur') }}
</label>
</div>
<div class="col-5 col-sm-12">
<label class="form-switch d-inline-block" @click.prevent="toggleDisableBlur">
<input type="checkbox" :checked="disableBlur">
<i class="form-icon" />
</label>
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-7 col-sm-12"> <div class="col-7 col-sm-12">
<label class="form-label"> <label class="form-label">
@ -389,6 +402,7 @@ export default {
selectedLineWrap: 'settings/getLineWrap', selectedLineWrap: 'settings/getLineWrap',
notificationsTimeout: 'settings/getNotificationsTimeout', notificationsTimeout: 'settings/getNotificationsTimeout',
restoreTabs: 'settings/getRestoreTabs', restoreTabs: 'settings/getRestoreTabs',
disableBlur: 'settings/getDisableBlur',
applicationTheme: 'settings/getApplicationTheme', applicationTheme: 'settings/getApplicationTheme',
editorTheme: 'settings/getEditorTheme', editorTheme: 'settings/getEditorTheme',
editorFontSize: 'settings/getEditorFontSize', editorFontSize: 'settings/getEditorFontSize',
@ -450,6 +464,7 @@ ORDER BY
changeLocale: 'settings/changeLocale', changeLocale: 'settings/changeLocale',
changePageSize: 'settings/changePageSize', changePageSize: 'settings/changePageSize',
changeRestoreTabs: 'settings/changeRestoreTabs', changeRestoreTabs: 'settings/changeRestoreTabs',
changeDisableBlur: 'settings/changeDisableBlur',
changeAutoComplete: 'settings/changeAutoComplete', changeAutoComplete: 'settings/changeAutoComplete',
changeLineWrap: 'settings/changeLineWrap', changeLineWrap: 'settings/changeLineWrap',
changeApplicationTheme: 'settings/changeApplicationTheme', changeApplicationTheme: 'settings/changeApplicationTheme',
@ -477,6 +492,9 @@ ORDER BY
toggleRestoreSession () { toggleRestoreSession () {
this.changeRestoreTabs(!this.restoreTabs); this.changeRestoreTabs(!this.restoreTabs);
}, },
toggleDisableBlur () {
this.changeDisableBlur(!this.disableBlur);
},
toggleAutoComplete () { toggleAutoComplete () {
this.changeAutoComplete(!this.selectedAutoComplete); this.changeAutoComplete(!this.selectedAutoComplete);
}, },

View File

@ -286,7 +286,8 @@ module.exports = {
executedQueries: '{n} query executed | {n} queries executed', executedQueries: '{n} query executed | {n} queries executed',
ourputFormat: 'Output format', ourputFormat: 'Output format',
singleFile: 'Single {ext} file', singleFile: 'Single {ext} file',
zipCompressedFile: 'ZIP compressed {ext} file' zipCompressedFile: 'ZIP compressed {ext} file',
disableBlur: 'Disable blur'
}, },
faker: { faker: {
address: 'Address', address: 'Address',

View File

@ -167,11 +167,15 @@ option:checked {
} }
.modal-overlay{ .modal-overlay{
background: rgba( 255, 255, 255, 0.1 ); background: rgba( 255, 255, 255, 0.1);
box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 ); box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
}
}
#wrapper:not(.no-blur){
.modal-overlay{
backdrop-filter: blur( 4px ); backdrop-filter: blur( 4px );
-webkit-backdrop-filter: blur( 4px ); -webkit-backdrop-filter: blur( 4px );
border: 1px solid rgba( 255, 255, 255, 0.18 );
} }
} }

View File

@ -20,7 +20,8 @@ export default {
application_theme: persistentStore.get('application_theme', defaultAppTheme), application_theme: persistentStore.get('application_theme', defaultAppTheme),
editor_theme: persistentStore.get('editor_theme', defaultEditorTheme), editor_theme: persistentStore.get('editor_theme', defaultEditorTheme),
editor_font_size: persistentStore.get('editor_font_size', 'medium'), editor_font_size: persistentStore.get('editor_font_size', 'medium'),
restore_tabs: persistentStore.get('restore_tabs', true) restore_tabs: persistentStore.get('restore_tabs', true),
disable_blur: persistentStore.get('disable_blur', false)
}, },
getters: { getters: {
getLocale: state => state.locale, getLocale: state => state.locale,
@ -33,7 +34,8 @@ export default {
getApplicationTheme: state => state.application_theme, getApplicationTheme: state => state.application_theme,
getEditorTheme: state => state.editor_theme, getEditorTheme: state => state.editor_theme,
getEditorFontSize: state => state.editor_font_size, getEditorFontSize: state => state.editor_font_size,
getRestoreTabs: state => state.restore_tabs getRestoreTabs: state => state.restore_tabs,
getDisableBlur: state => state.disable_blur
}, },
mutations: { mutations: {
SET_LOCALE (state, locale) { SET_LOCALE (state, locale) {
@ -80,6 +82,10 @@ export default {
SET_RESTORE_TABS (state, val) { SET_RESTORE_TABS (state, val) {
state.restore_tabs = val; state.restore_tabs = val;
persistentStore.set('restore_tabs', state.restore_tabs); persistentStore.set('restore_tabs', state.restore_tabs);
},
SET_DISABLE_BLUR (state, val) {
state.disable_blur = val;
persistentStore.set('disable_blur', state.disable_blur);
} }
}, },
actions: { actions: {
@ -115,6 +121,9 @@ export default {
}, },
changeRestoreTabs ({ commit }, size) { changeRestoreTabs ({ commit }, size) {
commit('SET_RESTORE_TABS', size); commit('SET_RESTORE_TABS', size);
},
changeDisableBlur ({ commit }, val) {
commit('SET_DISABLE_BLUR', val);
} }
} }
}; };