Browse Source

feat(gui): add option to disable screensaver

Added enable/disable checkbox option under Themes settings

closes #171

Signed-off-by: Pranav C Balan <pranavxc@gmail.com>
pull/223/head
Pranav C Balan 4 years ago
parent
commit
4119a01326
  1. 3
      packages/nc-gui/components/project/appStore/inputs/passwordField.vue
  2. 22
      packages/nc-gui/components/project/settings/appearance.vue
  3. 4
      packages/nc-gui/components/projectTabs.vue
  4. 5
      packages/nc-gui/store/windows.js

3
packages/nc-gui/components/project/appStore/inputs/passwordField.vue

@ -1,7 +1,4 @@
<template>
<!--
todo : add toggle button
-->
<v-text-field
:type="show ? 'text' : 'password'"
dense

22
packages/nc-gui/components/project/settings/appearance.vue

@ -38,6 +38,20 @@
</v-tooltip>
</td>
</tr>
<tr>
<td>Show Screensaver</td>
<td>
<v-tooltip bottom>
<template v-slot:activator="{ on }">
<v-checkbox v-model="showScreensaver" v-on="on" x-large
color="primary">
mdi-bat
</v-checkbox>
</template>
Show/hide metatables
</v-tooltip>
</td>
</tr>
<tr>
<td>Language</td>
<td>
@ -180,6 +194,14 @@ export default {
set(show) {
this.$store.commit('windows/MutMetatables', show)
}
},
showScreensaver: {
get() {
return this.$store.state.windows.screensaver;
},
set(show) {
this.$store.commit('windows/MutScreensaver', show)
}
}
},
methods: {

4
packages/nc-gui/components/projectTabs.vue

@ -278,7 +278,7 @@ export default {
let position = 0;
let idleTime = 0;
//Increment the idle time counter every minute.
let idleInterval = setInterval(timerIncrement, 1000); // 1 minute
let idleInterval = setInterval(timerIncrement, 1000);
const self = this;
//Zero the idle timer on mouse movement.
@ -311,7 +311,7 @@ export default {
}
}
self.showScreensaver = true;
self.showScreensaver = self.$store.state.windows.screensaver;
scrolltitle();
clearInterval(idleInterval)
}

5
packages/nc-gui/store/windows.js

@ -43,12 +43,15 @@ export const state = () => ({
isComp: false,
metatables: false,
nc: true,
miniSponsorCard: 0
miniSponsorCard: 0,
screensaver: true
});
export const mutations = {
MutToggleLogWindow(state, show) {
state.logWindow = !state.logWindow;
}, MutScreensaver(state, show) {
state.screensaver = show;
}, MutToggleDarkMode(state, status) {
if (typeof status !== 'boolean') status = !state.darkTheme;
state.darkTheme = status;

Loading…
Cancel
Save