Skip to content

Commit

Permalink
Some UI fixes (#937)
Browse files Browse the repository at this point in the history
* Fix Onboarding UX
* Allow to open the app on latest unity
  • Loading branch information
aenario authored Jan 22, 2018
1 parent 282089b commit 5e950b7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion gui/elm/Address.elm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,10 @@ view helpers model =
[ text ("https://") ]
, input
[ placeholder ("cloudy.mycozy.cloud")
, class "wizard__address"
, classList
[ ( "wizard__address", True )
, ( "error", model.error /= "" )
]
, type_ "text"
, value model.address
, disabled model.busy
Expand Down
14 changes: 11 additions & 3 deletions gui/js/tray.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const {Tray, Menu} = require('electron')
const {Tray, Menu, MenuItem} = require('electron')
const {translate} = require('./i18n')
const path = require('path')

Expand All @@ -24,13 +24,21 @@ module.exports.init = (app, listener) => {
tray.on('double-click', clicked)
tray.setToolTip('loading')

// on MacOS, if a tray has a contextmenu, click event does not work
// on MacOS & Unity, if a tray has a contextmenu, click event does not work
// on Gnome, if a tray has no contextmenu, tray is not shown
// @TODO test on windows
if (process.platform !== 'darwin') {

const isMac = process.platform !== 'darwin'
const isUnity = process.env.XDG_CURRENT_DESKTOP && process.env.XDG_CURRENT_DESKTOP.match(/Unity/)

if (isUnity || isMac) {
const cm = Menu.buildFromTemplate([
{ label: translate('Tray Quit application'), click: app.quit }
])
if (isUnity) {
cm.insert(0, new MenuItem({label: translate('Tray Show application'), click: clicked}))
cm.insert(1, new MenuItem({type: 'separator'}))
}
tray.setContextMenu(cm)
}
setState('idle')
Expand Down
1 change: 1 addition & 0 deletions gui/styles/_wizard.styl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ a.more-info
flex 0 0
padding: 0.9em 0.3em
font-size: 1.1em
color black
input
flex 1 0
.step-address .cozy-form-tip
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"cozy"
],
"scripts": {
"build": "yarn build:core && yarn build:css & yarn build:tx && yarn build:elm",
"build": "yarn build:core && yarn build:css && yarn build:elm && yarn build:tx",
"build:core": "babel --source-maps --out-dir core-built core/",
"build:core:coverage": "babel --plugins babel-plugin-istanbul --source-maps --out-dir core-cov core/",
"build:css": "stylus --sourcemap --compress --use cozy-ui/stylus gui/styles/app.styl --out gui",
Expand Down

0 comments on commit 5e950b7

Please sign in to comment.