fix(preferences): Windows / Linux styling and adjustments

This commit is contained in:
Ben Gotow 2015-08-14 16:24:53 -07:00
parent 79b6c1d94a
commit c661f5cb73
7 changed files with 38 additions and 24 deletions

View file

@ -11,7 +11,7 @@ class PreferencesHeader extends React.Component
activeTab: React.PropTypes.object activeTab: React.PropTypes.object
render: => render: =>
<Flexbox className="preference-header" direction="row" style={alignItems: "center"}> <div className="preference-header">
{ @props.tabs.map (tab) => { @props.tabs.map (tab) =>
classname = "preference-header-item" classname = "preference-header-item"
classname += " active" if tab is @props.activeTab classname += " active" if tab is @props.activeTab
@ -27,8 +27,7 @@ class PreferencesHeader extends React.Component
</div> </div>
</div> </div>
} }
<div key="space" className="preference-header-item-spacer"></div> </div>
</Flexbox>
module.exports = PreferencesHeader module.exports = PreferencesHeader

View file

@ -1,24 +1,15 @@
@import "ui-variables"; @import "ui-variables";
@import "ui-mixins"; @import "ui-mixins";
body.is-blurred {
.preference-header {
background-image: -webkit-linear-gradient(top, lighten(@toolbar-background-color, 12%), lighten(@toolbar-background-color, 15%));
}
}
body.platform-darwin {
.preferences-wrap .platform-darwin-only {
display: inherit;
}
}
body.window-type-react-remote { body.window-type-react-remote {
margin:0;
.sheet-toolbar { .sheet-toolbar {
border-bottom: none; border-bottom: none;
height:30px; height:30px;
min-height:30px; min-height:30px;
max-height:30px; max-height:30px;
display: none;
.toolbar-window-controls { .toolbar-window-controls {
margin-top:3px; margin-top:3px;
@ -33,6 +24,26 @@ body.window-type-react-remote {
} }
} }
body.platform-darwin.window-type-react-remote {
.sheet-toolbar {
display:inherit;
}
}
// Preferences Specific
body.is-blurred {
.preference-header {
background-image: -webkit-linear-gradient(top, lighten(@toolbar-background-color, 12%), lighten(@toolbar-background-color, 15%));
}
}
body.platform-darwin {
.preferences-wrap .platform-darwin-only {
display: inherit;
}
}
.preferences-wrap { .preferences-wrap {
input[type=checkbox] {margin: 0px 7px 0px 0px; position: relative; top: -1px; } input[type=checkbox] {margin: 0px 7px 0px 0px; position: relative; top: -1px; }
input[type=radio] {margin: 0px 7px 0px 0px; position: relative; top: -1px; } input[type=radio] {margin: 0px 7px 0px 0px; position: relative; top: -1px; }
@ -225,20 +236,17 @@ body.window-type-react-remote {
-webkit-user-select: none; -webkit-user-select: none;
-webkit-app-region: drag; -webkit-app-region: drag;
.preference-header-item-spacer {
flex: 1;
}
.preference-header-item { .preference-header-item {
margin-left:3px; margin-left:3px;
margin-right:3px; margin-right:3px;
padding-left:3px; padding-left:3px;
padding-right:3px; padding-right:3px;
-webkit-app-region: no-drag; -webkit-app-region: no-drag;
display: block; display: inline-block;
.phi-container { .phi-container {
padding-left:5%; padding-left:5px;
padding-right:5%; padding-right:5px;
padding-top: 3px; padding-top: 3px;
text-align: center; text-align: center;
height:58px; height:58px;

View file

@ -4,6 +4,7 @@
submenu: [ submenu: [
{ label: '&New Message', command: 'application:new-message' } { label: '&New Message', command: 'application:new-message' }
{ type: 'separator' } { type: 'separator' }
{ label: 'Preferences', command: 'application:open-preferences' }
{ label: 'Link External Account', command: 'atom-workspace:add-account' } { label: 'Link External Account', command: 'atom-workspace:add-account' }
{ label: 'Log Out', command: 'application:logout' } { label: 'Log Out', command: 'application:logout' }
{ label: 'Clos&e Window', command: 'window:close' } { label: 'Clos&e Window', command: 'window:close' }

View file

@ -7,6 +7,7 @@
{ label: 'Link External Account', command: 'atom-workspace:add-account' } { label: 'Link External Account', command: 'atom-workspace:add-account' }
{ label: 'Clos&e Window', command: 'window:close' } { label: 'Clos&e Window', command: 'window:close' }
{ type: 'separator' } { type: 'separator' }
{ label: 'Preferences', command: 'application:open-preferences' }
{ label: 'Log Out', command: 'application:logout' } { label: 'Log Out', command: 'application:logout' }
{ type: 'separator' } { type: 'separator' }
{ label: 'E&xit', command: 'application:quit' } { label: 'E&xit', command: 'application:quit' }

View file

@ -254,6 +254,8 @@ class AtomWindow
isVisible: -> @browserWindow.isVisible() isVisible: -> @browserWindow.isVisible()
isLoaded: -> @loaded
isWebViewFocused: -> @browserWindow.isWebViewFocused() isWebViewFocused: -> @browserWindow.isWebViewFocused()
isSpecWindow: -> @isSpec isSpecWindow: -> @isSpec

View file

@ -212,7 +212,7 @@ class WindowManager
destroyedLoadingWindow = false destroyedLoadingWindow = false
{loadedWindows} = @_hotWindows[windowType] {loadedWindows} = @_hotWindows[windowType]
for win in loadedWindows for win in loadedWindows
destroyedLoadingWindow = true if not win.loaded destroyedLoadingWindow = true if not win.isLoaded()
win.browserWindow.destroy() win.browserWindow.destroy()
# Delete the hot window configuration # Delete the hot window configuration
@ -408,7 +408,7 @@ class WindowManager
if process.platform in ['win32', 'linux'] if process.platform in ['win32', 'linux']
@quitCheck ?= _.debounce => @quitCheck ?= _.debounce =>
noVisibleWindows = @visibleWindows().length is 0 noVisibleWindows = @visibleWindows().length is 0
mainWindowLoading = @mainWindow and not @mainWindow.loaded mainWindowLoading = @mainWindow() and not @mainWindow().isLoaded()
if noVisibleWindows and not mainWindowLoading if noVisibleWindows and not mainWindowLoading
app.quit() app.quit()
, 10000 , 10000

View file

@ -208,13 +208,16 @@ var openWindowForComponent = function(Component, options) {
slashes: true slashes: true
}); });
var thinWindow = new BrowserWindow({ var thinWindow = new BrowserWindow({
frame: false, frame: process.platform !== 'darwin',
width: options.width || 800, width: options.width || 800,
height: options.height || 600, height: options.height || 600,
resizable: options.resizable, resizable: options.resizable,
show: false show: false
}); });
thinWindow.loadUrl(thinWindowUrl); thinWindow.loadUrl(thinWindowUrl);
if (process.platform !== 'darwin') {
thinWindow.setMenu(null);
}
// Add a container to our local document to hold the root component of the window // Add a container to our local document to hold the root component of the window
var container = document.createElement('div'); var container = document.createElement('div');