From 409c5a7b913228e1da7288fadf78bc1cfd6dd4e0 Mon Sep 17 00:00:00 2001
From: AkiraFukushima
Date: Tue, 23 Oct 2018 08:49:53 +0900
Subject: [PATCH] refs #625 Add option to hide/show global header
---
src/main/index.js | 24 +++++++++++++++++++
src/main/preferences.js | 3 ++-
src/renderer/components/GlobalHeader.vue | 18 +++++++++++---
src/renderer/components/TimelineSpace.vue | 4 +---
.../components/TimelineSpace/SideMenu.vue | 20 +++++++++++++---
src/renderer/store/GlobalHeader.js | 12 +++++++++-
src/renderer/store/TimelineSpace/SideMenu.js | 13 +++++++++-
7 files changed, 82 insertions(+), 12 deletions(-)
diff --git a/src/main/index.js b/src/main/index.js
index 35a1bbfe..8c7c2b4c 100644
--- a/src/main/index.js
+++ b/src/main/index.js
@@ -642,6 +642,30 @@ ipcMain.on('get-collapse', (event, _) => {
})
})
+ipcMain.on('change-global-header', (event, value) => {
+ const preferences = new Preferences(preferencesDBPath)
+ preferences.update(
+ {
+ state: {
+ hideGlobalHeader: value
+ }
+ })
+ .then((conf) => {
+ event.sender.send('response-change-global-header', conf)
+ })
+ .catch(err => {
+ log.error(err)
+ })
+})
+
+ipcMain.on('get-global-header', (event, _) => {
+ const preferences = new Preferences(preferencesDBPath)
+ preferences.load()
+ .then((conf) => {
+ event.sender.send('response-get-global-header', conf.state.hideGlobalHeader)
+ })
+})
+
ipcMain.on('change-language', (event, value) => {
const preferences = new Preferences(preferencesDBPath)
preferences.update(
diff --git a/src/main/preferences.js b/src/main/preferences.js
index da29b0ff..b40eb6e2 100644
--- a/src/main/preferences.js
+++ b/src/main/preferences.js
@@ -17,7 +17,8 @@ const Base = {
tootVisibility: Visibility.Public.value
},
state: {
- collapse: false
+ collapse: false,
+ hideGlobalHeader: false
},
language: {
language: Language.en.key
diff --git a/src/renderer/components/GlobalHeader.vue b/src/renderer/components/GlobalHeader.vue
index eaf422dc..11dace27 100644
--- a/src/renderer/components/GlobalHeader.vue
+++ b/src/renderer/components/GlobalHeader.vue
@@ -1,6 +1,7 @@