From 7eeba0c082e687a8ffeb3ba3b42b5183a48de179 Mon Sep 17 00:00:00 2001 From: Dick Choi Date: Sun, 14 Aug 2016 03:58:19 +0900 Subject: [PATCH 1/4] App on Linux without cinnamon must be terminated after closing main window --- lib/main-window.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/main-window.js b/lib/main-window.js index b93b3c6c..dd275e39 100644 --- a/lib/main-window.js +++ b/lib/main-window.js @@ -33,6 +33,9 @@ mainWindow.webContents.sendInputEvent({ }) mainWindow.on('close', function (e) { + if (process.platform === 'linux' && process.env.DESKTOP_SESSION !== 'cinnamon') { + return true + } mainWindow.hide() e.preventDefault() }) From dd0440519b3737ce16c6377bedb41947cc8b1bde Mon Sep 17 00:00:00 2001 From: Dick Choi Date: Sun, 14 Aug 2016 13:08:28 +0900 Subject: [PATCH 2/4] change home to all notes --- browser/main/SideNav/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browser/main/SideNav/index.js b/browser/main/SideNav/index.js index d7fdca82..37bf994a 100644 --- a/browser/main/SideNav/index.js +++ b/browser/main/SideNav/index.js @@ -68,8 +68,8 @@ class SideNav extends React.Component { : null } diff --git a/browser/main/TopBar/TopBar.styl b/browser/main/TopBar/TopBar.styl index 69d6d1d6..dafe6a54 100644 --- a/browser/main/TopBar/TopBar.styl +++ b/browser/main/TopBar/TopBar.styl @@ -102,3 +102,65 @@ $control-height = 34px line-height normal opacity 0 transition 0.1s + +body[data-theme="dark"] + .root, .root--expanded + background-color $ui-dark-backgroundColor + + .control + border-color $ui-dark-borderColor + .control-search + background-color $dark-background-color + + .control-search-icon + absolute top bottom left + line-height 32px + width 35px + color $ui-dark-inactive-text-color + + .control-search-input + input + background-color $dark-background-color + color $ui-dark-text-color + .control-search-optionList + color white + background-color $ui-dark-button--hover-backgroundColor + border-color $ui-dark-borderColor + box-shadow 2px 2px 10px black + + .control-search-optionList-item + border-color $ui-dark-borderColor + &:hover + background-color lighten($ui-dark-button--hover-backgroundColor, 15%) + .control-search-optionList-item-folder + color $ui-dark-text-color + .control-search-optionList-item-folder-surfix + font-size 10px + margin-left 5px + color $ui-inactive-text-color + .control-search-optionList-item-type + font-size 12px + color $ui-inactive-text-color + padding-right 3px + .control-search-optionList-empty + height 150px + color $ui-inactive-text-color + line-height 150px + text-align center + .control-newPostButton + colorDarkDefaultButton() + border-color $ui-dark-borderColor + &:active + border-color $ui-dark-button--active-backgroundColor + + .control-newPostButton-tooltip + darkTooltip() + position fixed + pointer-events none + top 45px + left 385px + z-index 10 + padding 5px + line-height normal + opacity 0 + transition 0.1s diff --git a/browser/main/global.styl b/browser/main/global.styl index d4073aff..c907a1a0 100644 --- a/browser/main/global.styl +++ b/browser/main/global.styl @@ -83,3 +83,7 @@ modalBackColor = transparentify(white, 65%) absolute top left bottom right background-color modalBackColor z-index modalZIndex + 1 +body[data-theme="dark"] + .ModalBase + .modalBack + background-color alpha(black, 60%) diff --git a/browser/main/lib/ConfigManager.js b/browser/main/lib/ConfigManager.js index 43802707..bafdffed 100644 --- a/browser/main/lib/ConfigManager.js +++ b/browser/main/lib/ConfigManager.js @@ -67,6 +67,12 @@ function set (updates) { if (!validate(newConfig)) throw new Error('INVALID CONFIG') _save(newConfig) + if (newConfig.ui.theme === 'dark') { + document.body.setAttribute('data-theme', 'dark') + } else { + document.body.setAttribute('data-theme', 'default') + } + remote.getCurrentWindow().webContents.send('config-renew', { config: get(), silent: false diff --git a/browser/main/lib/ipc.js b/browser/main/lib/ipc.js index e0d117cf..2e3de2e2 100644 --- a/browser/main/lib/ipc.js +++ b/browser/main/lib/ipc.js @@ -114,6 +114,7 @@ nodeIpc.serve( nodeIpc.server.on('connect', function (socket) { console.log('connected') + nodeIpc.server.broadcast('config-renew', ConfigManager.get()) socket.on('close', function () { console.log('socket dead') }) diff --git a/browser/main/modals/NewNoteModal.styl b/browser/main/modals/NewNoteModal.styl index 7973a463..ed985f6a 100644 --- a/browser/main/modals/NewNoteModal.styl +++ b/browser/main/modals/NewNoteModal.styl @@ -54,3 +54,28 @@ color $ui-inactive-text-color text-align center margin-bottom 25px + +body[data-theme="dark"] + .root + modalDark() + + .header + background-color $ui-dark-button--hover-backgroundColor + border-color $ui-dark-borderColor + color $ui-dark-text-color + + .closeButton + border-color $ui-dark-borderColor + color $ui-dark-text-color + colorDarkDefaultButton() + + .control-button + border-color $ui-dark-borderColor + color $ui-dark-text-color + background-color transparent + &:focus + colorPrimaryButton() + + .description + color $ui-inactive-text-color + diff --git a/browser/main/modals/PreferencesModal/ConfigTab.js b/browser/main/modals/PreferencesModal/ConfigTab.js index 947ad318..d685b04d 100644 --- a/browser/main/modals/PreferencesModal/ConfigTab.js +++ b/browser/main/modals/PreferencesModal/ConfigTab.js @@ -230,7 +230,6 @@ class ConfigTab extends React.Component {