added app settings

This commit is contained in:
supertiger1234 2019-09-13 20:54:54 +01:00
parent 1c8ca256c4
commit b23bbcb19c
3 changed files with 131 additions and 3 deletions

View file

@ -33,11 +33,13 @@
import { bus } from "@/main";
import {isMobile} from '@/utils/Mobile';
import isElectron from '@/utils/ElectronJS/isElectron';
const MyProfile = () => import("./SettingsPanels/MyProfile.vue");
const ManageEmojis = () => import("./SettingsPanels/ManageEmojis.vue");
const MessageDesign = () => import("./SettingsPanels/MessageDesign.vue");
const Notifications = () => import("./SettingsPanels/Notifications.vue");
const AppSettings = () => import("./SettingsPanels/appSettings");
export default {
@ -45,11 +47,11 @@ export default {
MyProfile,
ManageEmojis,
MessageDesign,
Notifications
Notifications,
AppSettings
},
data() {
return {
isElectron: window && window.process && window.process.type,
currentTab: 0,
tabs: [
{
@ -76,6 +78,13 @@ export default {
icon: "message",
component: "notifications",
hidden: isMobile(),
},
{
name: "App Settings",
tabName: "App Settings",
icon: "desktop_windows",
component: "app-settings",
hidden: !isElectron,
}
]
};
@ -83,7 +92,7 @@ export default {
methods: {
logout() {
this.$store.dispatch("logout");
this.isElectron ? window.location.href = '/login' : window.location.href = "/";
isElectron ? window.location.href = '/login' : window.location.href = "/";
},
close() {
this.$store.dispatch("setPopoutVisibility", {

View file

@ -0,0 +1,118 @@
<template>
<div class="my-profile-panel">
<div class="switches">
<div class="checkbox" @click="toggleStart">
<div class="checkbox-box" :class="{selected:startApp}" />
<div class="checkbox-name">
Start Nertivia when Windows starts.
</div>
</div>
<div class="checkbox" v-if="startApp" @click="toggleStartMinimized">
<div class="checkbox-box" :class="{selected:startMinimized}" />
<div class="checkbox-name">
Start minimized.
</div>
</div>
</div>
</div>
</template>
<script>
import isElectron from '@/utils/ElectronJS/isElectron';
import config from "@/config.js";
const { ipcRenderer, remote} = window.require("electron");
const Store = remote.require('electron-store');
const store = new Store();
export default {
data() {
return {
startApp: store.get('startup.enabled', true),
startMinimized: store.get('startup.minimized', true)
};
},
methods: {
toggleStart() {
this.startApp = !this.startApp;
ipcRenderer.send('startupOption', {startApp: this.startApp, startMinimized: this.startMinimized})
},
toggleStartMinimized() {
this.startMinimized = !this.startMinimized;
ipcRenderer.send('startupOption', {startApp: this.startApp, startMinimized: this.startMinimized})
}
},
mounted() {
},
computed: {
},
};
</script>
<style scoped>
.switches {
display: flex;
flex-direction: column;
margin: 20px;
user-select: none;
}
.checkbox {
display: flex;
margin-top: 3px;
margin-bottom: 3px;
cursor: pointer;
align-self: flex-start;
}
.checkbox-box {
background: rgba(88, 88, 88, 0.74);
height: 20px;
width: 20px;
margin: 10px;
margin-top: auto;
margin-bottom: auto;
transition: 0.3s;
border-radius: 5px;
}
.checkbox-box.selected {
background: rgba(66, 122, 244, 0.74);
}
.checkbox-box.selected:hover {
background: rgba(66, 122, 244, 0.94);
}
.checkbox-box:hover {
background: rgba(88, 88, 88, 0.94);
}
.checkbox-name {
}
.message-example{
padding: 10px;
background: rgba(88, 88, 88, 0.44);
border-radius: 10px;
margin: 10px;
}
.title{
font-size: 20px;
text-align: center;
margin-bottom: 5px;
}
.hidden {
display: none;
}
.my-profile-panel {
display: flex;
width: 100%;
height: 100%;
margin-top: 10px;
flex-direction: column;
}
</style>

View file

@ -0,0 +1 @@
export default window && window.process && window.process.type