From 1318abd37e2a115e09b886edf41cbf7d1f081904 Mon Sep 17 00:00:00 2001 From: Dick Choi Date: Tue, 17 Nov 2015 09:01:25 +0900 Subject: [PATCH] =?UTF-8?q?Windows=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B?= =?UTF-8?q?=E3=81=A6UI=E4=BF=AE=E6=AD=A3=EF=BC=88Font/Username/Key=20input?= =?UTF-8?q?:Command=20key=20->=20Control=20key)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- browser/main/HomePage.js | 10 +++++----- browser/main/HomePage/ArticleNavigator.js | 5 ++++- browser/styles/finder/index.styl | 4 +++- browser/styles/main/index.styl | 6 ++++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/browser/main/HomePage.js b/browser/main/HomePage.js index c40b4dfb..eada1e07 100644 --- a/browser/main/HomePage.js +++ b/browser/main/HomePage.js @@ -43,7 +43,7 @@ class HomePage extends React.Component { } // Search inputがfocusされていたら大体のキー入力は無視される。 - if (top.isInputFocused() && !e.metaKey) { + if (top.isInputFocused() && !(e.metaKey || e.ctrlKey)) { if (e.keyCode === 13 || e.keyCode === 27) top.escape() return } @@ -54,7 +54,7 @@ class HomePage extends React.Component { if (e.keyCode === 27) { detail.handleCancelButtonClick() } - if ((e.keyCode === 13 && e.metaKey) || (e.keyCode === 83 && e.metaKey)) { + if ((e.keyCode === 13 && (e.metaKey || e.ctrlKey)) || (e.keyCode === 83 && (e.metaKey || e.ctrlKey))) { detail.handleSaveButtonClick() } break @@ -72,14 +72,14 @@ class HomePage extends React.Component { if (e.keyCode === 27) { detail.handleDeleteCancelButtonClick() } - if (e.keyCode === 13 && e.metaKey) { + if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) { detail.handleDeleteConfirmButtonClick() } break } // `detail`の`openDeleteConfirmMenu`が`true`なら呼ばれない。 - if (e.keyCode === 27 || (e.keyCode === 70 && e.metaKey)) { + if (e.keyCode === 27 || (e.keyCode === 70 && (e.metaKey || e.ctrlKey))) { top.focusInput() } @@ -91,7 +91,7 @@ class HomePage extends React.Component { list.selectNextArticle() } - if (e.keyCode === 65 || e.keyCode === 13 && e.metaKey) { + if (e.keyCode === 65 || e.keyCode === 13 && (e.metaKey || e.ctrlKey)) { nav.handleNewPostButtonClick() e.preventDefault() } diff --git a/browser/main/HomePage/ArticleNavigator.js b/browser/main/HomePage/ArticleNavigator.js index d4c21131..bdc2ead4 100644 --- a/browser/main/HomePage/ArticleNavigator.js +++ b/browser/main/HomePage/ArticleNavigator.js @@ -7,7 +7,10 @@ import Preferences from 'boost/components/modal/Preferences' import CreateNewFolder from 'boost/components/modal/CreateNewFolder' import remote from 'remote' -let userName = remote.getGlobal('process').env.USER +let mainEnv = remote.getGlobal('process').env +let userName = mainEnv.USER != null + ? mainEnv.USER + : mainEnv.USERNAME const BRAND_COLOR = '#18AF90' diff --git a/browser/styles/finder/index.styl b/browser/styles/finder/index.styl index d91383c5..d4737829 100644 --- a/browser/styles/finder/index.styl +++ b/browser/styles/finder/index.styl @@ -7,8 +7,10 @@ global-reset() iptBgColor = #E6E6E6 iptFocusBorderColor = #369DCD +DEFAULT_FONTS = 'Lato', 'MS Gothic', 'Malgun Gothic', 'Sans-serif' + body - font-family "Lato" + font-family DEFAULT_FONTS color textColor font-size fontSize width 100% diff --git a/browser/styles/main/index.styl b/browser/styles/main/index.styl index 8377d835..549c3799 100644 --- a/browser/styles/main/index.styl +++ b/browser/styles/main/index.styl @@ -7,6 +7,8 @@ global-reset() @import './containers/*' @import './HomeContainer' +DEFAULT_FONTS = 'Lato', 'MS Gothic', 'Malgun Gothic', 'Sans-serif' + * -webkit-app-region no-drag -webkit-user-select none @@ -17,13 +19,13 @@ html, body overflow hidden body - font-family "Lato" + font-family DEFAULT_FONTS color textColor font-size fontSize font-weight 400 button, input, select - font-family "Lato" + font-family DEFAULT_FONTS div, span, a, button, input, textarea box-sizing border-box