1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 09:46:22 +00:00

Windowsに合わせてUI修正(Font/Username/Key input:Command key -> Control key)

This commit is contained in:
Dick Choi
2015-11-17 09:01:25 +09:00
parent 76a031a8c9
commit 1318abd37e
4 changed files with 16 additions and 9 deletions

View File

@@ -43,7 +43,7 @@ class HomePage extends React.Component {
} }
// Search inputがfocusされていたら大体のキー入力は無視される。 // Search inputがfocusされていたら大体のキー入力は無視される。
if (top.isInputFocused() && !e.metaKey) { if (top.isInputFocused() && !(e.metaKey || e.ctrlKey)) {
if (e.keyCode === 13 || e.keyCode === 27) top.escape() if (e.keyCode === 13 || e.keyCode === 27) top.escape()
return return
} }
@@ -54,7 +54,7 @@ class HomePage extends React.Component {
if (e.keyCode === 27) { if (e.keyCode === 27) {
detail.handleCancelButtonClick() 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() detail.handleSaveButtonClick()
} }
break break
@@ -72,14 +72,14 @@ class HomePage extends React.Component {
if (e.keyCode === 27) { if (e.keyCode === 27) {
detail.handleDeleteCancelButtonClick() detail.handleDeleteCancelButtonClick()
} }
if (e.keyCode === 13 && e.metaKey) { if (e.keyCode === 13 && (e.metaKey || e.ctrlKey)) {
detail.handleDeleteConfirmButtonClick() detail.handleDeleteConfirmButtonClick()
} }
break break
} }
// `detail`の`openDeleteConfirmMenu`が`true`なら呼ばれない。 // `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() top.focusInput()
} }
@@ -91,7 +91,7 @@ class HomePage extends React.Component {
list.selectNextArticle() list.selectNextArticle()
} }
if (e.keyCode === 65 || e.keyCode === 13 && e.metaKey) { if (e.keyCode === 65 || e.keyCode === 13 && (e.metaKey || e.ctrlKey)) {
nav.handleNewPostButtonClick() nav.handleNewPostButtonClick()
e.preventDefault() e.preventDefault()
} }

View File

@@ -7,7 +7,10 @@ import Preferences from 'boost/components/modal/Preferences'
import CreateNewFolder from 'boost/components/modal/CreateNewFolder' import CreateNewFolder from 'boost/components/modal/CreateNewFolder'
import remote from 'remote' 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' const BRAND_COLOR = '#18AF90'

View File

@@ -7,8 +7,10 @@ global-reset()
iptBgColor = #E6E6E6 iptBgColor = #E6E6E6
iptFocusBorderColor = #369DCD iptFocusBorderColor = #369DCD
DEFAULT_FONTS = 'Lato', 'MS Gothic', 'Malgun Gothic', 'Sans-serif'
body body
font-family "Lato" font-family DEFAULT_FONTS
color textColor color textColor
font-size fontSize font-size fontSize
width 100% width 100%

View File

@@ -7,6 +7,8 @@ global-reset()
@import './containers/*' @import './containers/*'
@import './HomeContainer' @import './HomeContainer'
DEFAULT_FONTS = 'Lato', 'MS Gothic', 'Malgun Gothic', 'Sans-serif'
* *
-webkit-app-region no-drag -webkit-app-region no-drag
-webkit-user-select none -webkit-user-select none
@@ -17,13 +19,13 @@ html, body
overflow hidden overflow hidden
body body
font-family "Lato" font-family DEFAULT_FONTS
color textColor color textColor
font-size fontSize font-size fontSize
font-weight 400 font-weight 400
button, input, select button, input, select
font-family "Lato" font-family DEFAULT_FONTS
div, span, a, button, input, textarea div, span, a, button, input, textarea
box-sizing border-box box-sizing border-box