Skip to content

Commit

Permalink
Implements #35
Browse files Browse the repository at this point in the history
New setting added to Settings Window to control if the notification about closing window to system tray should be displayed or not.
  • Loading branch information
evsar3 committed Aug 21, 2020
1 parent c1e5f75 commit 287ec77
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/renderer/components/MainWindow/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default {
settings () {
const window = windowManager.createNew('settings-window', '', '/index.html#settings', null, {
height: 250,
height: 265,
width: 500,
useContentSize: true,
frame: false,
Expand Down Expand Up @@ -200,9 +200,11 @@ export default {
showRunningInBackgroundNotification () {
if (!this.runningInBackgroundNotificationShowed) {
this.notify('Program still running in the system tray')
this.runningInBackgroundNotificationShowed = true
if (this.$store.state.Settings.settings.displayTrayMessageOnClose) {
this.notify('Program still running in the system tray')
this.runningInBackgroundNotificationShowed = true
}
}
},
Expand Down
12 changes: 11 additions & 1 deletion src/renderer/components/SettingsWindow/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="form-item" style="margin: 10px 0">
<label>Startup with windows <toggle-button style="float: right;" :color="toggleButtonColor" v-model="data.startupWithOS" sync labels></toggle-button></label>
<div class="check-item">
<label>Startup with windows <toggle-button :color="toggleButtonColor" v-model="data.startupWithOS" sync labels></toggle-button></label>
</div>
<div class="check-item">
<label>Display system tray message on close <toggle-button :color="toggleButtonColor" v-model="data.displayTrayMessageOnClose" sync labels></toggle-button></label>
</div>
</div>

<div class="footer">
Expand Down Expand Up @@ -87,6 +92,11 @@ export default {
.wrap {
padding: 15px 20px;
.form-item .check-item .vue-js-switch {
float: right;
clear: both;
}
.footer {
position: fixed;
bottom: 0;
Expand Down
6 changes: 4 additions & 2 deletions src/renderer/store/modules/Settings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const state = {
settings: {
sshfsBinary: 'C:\\Program Files\\SSHFS-Win\\bin\\sshfs-win.exe',
startupWithOS: true
startupWithOS: true,
displayTrayMessageOnClose: true
}
}

Expand All @@ -13,7 +14,8 @@ const mutations = {
RESET_SETTINGS (state) {
state.settings = {
sshfsBinary: 'C:\\Program Files\\SSHFS-Win\\bin\\sshfs-win.exe',
startupWithOS: true
startupWithOS: true,
displayTrayMessageOnClose: true
}
}
}
Expand Down

0 comments on commit 287ec77

Please sign in to comment.