fix(preferences): Windows / Linux styling and adjustments

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

View file

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

View file

@ -1,24 +1,15 @@
@import "ui-variables";
@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 {
margin:0;
.sheet-toolbar {
border-bottom: none;
height:30px;
min-height:30px;
max-height:30px;
display: none;
.toolbar-window-controls {
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 {
input[type=checkbox] {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-app-region: drag;
.preference-header-item-spacer {
flex: 1;
}
.preference-header-item {
margin-left:3px;
margin-right:3px;
padding-left:3px;
padding-right:3px;
-webkit-app-region: no-drag;
display: block;
display: inline-block;
.phi-container {
padding-left:5%;
padding-right:5%;
padding-left:5px;
padding-right:5px;
padding-top: 3px;
text-align: center;
height:58px;

View file

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

View file

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

View file

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

View file

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

View file

@ -208,13 +208,16 @@ var openWindowForComponent = function(Component, options) {
slashes: true
});
var thinWindow = new BrowserWindow({
frame: false,
frame: process.platform !== 'darwin',
width: options.width || 800,
height: options.height || 600,
resizable: options.resizable,
show: false
});
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
var container = document.createElement('div');