diff --git a/js/components/main.js b/js/components/main.js
index d52b1dae22a..26178993314 100644
--- a/js/components/main.js
+++ b/js/components/main.js
@@ -866,6 +866,7 @@ class Main extends ImmutableComponent {
return
{ this.mainWindow = node }}
diff --git a/js/lib/eventUtil.js b/js/lib/eventUtil.js
index 3db57a173a5..7fdc4c42f64 100644
--- a/js/lib/eventUtil.js
+++ b/js/lib/eventUtil.js
@@ -5,8 +5,8 @@
const {isDarwin} = require('../../app/common/lib/platformUtil')
module.exports.isForSecondaryAction = (e) =>
- e.ctrlKey && !isDarwin ||
- e.metaKey && isDarwin ||
+ (e.ctrlKey && !isDarwin()) ||
+ (e.metaKey && isDarwin()) ||
e.button === 1
module.exports.eventElHasAncestorWithClasses = (e, classesToCheck) => {
diff --git a/js/stores/appStore.js b/js/stores/appStore.js
index 9599c5a4388..0a4ac6a544f 100644
--- a/js/stores/appStore.js
+++ b/js/stores/appStore.js
@@ -55,42 +55,62 @@ function isModal (browserOpts) {
return browserOpts.scrollbars === false
}
-function navbarHeight () {
+const navbarHeight = () => {
// TODO there has to be a better way to get this or at least add a test
return 75
}
-const createWindow = (browserOpts, defaults, frameOpts, windowState) => {
- const parentWindowKey = browserOpts.parentWindowKey
-
+/**
+ * Determine window dimensions (width / height)
+ */
+const setWindowDimensions = (browserOpts, defaults, windowState) => {
if (windowState.ui && windowState.ui.size) {
browserOpts.width = firstDefinedValue(browserOpts.width, windowState.ui.size[0])
browserOpts.height = firstDefinedValue(browserOpts.height, windowState.ui.size[1])
}
-
browserOpts.width = firstDefinedValue(browserOpts.width, browserOpts.innerWidth, defaults.width)
// height and innerHeight are the frame webview size
browserOpts.height = firstDefinedValue(browserOpts.height, browserOpts.innerHeight)
- if (isNaN(browserOpts.height)) {
+ if (typeof browserOpts.height === 'number') {
+ // add navbar height to get total height for BrowserWindow
+ browserOpts.height = browserOpts.height + navbarHeight()
+ } else {
// no inner height so check outer height or use default
browserOpts.height = firstDefinedValue(browserOpts.outerHeight, defaults.height)
- } else {
- // BrowserWindow height is window height so add navbar height
- browserOpts.height = browserOpts.height + navbarHeight()
}
+ return browserOpts
+}
+/**
+ * Determine window position (x / y)
+ */
+const setWindowPosition = (browserOpts, defaults, windowState) => {
if (windowState.ui && windowState.ui.position) {
+ // Position comes from window state
browserOpts.x = firstDefinedValue(browserOpts.x, windowState.ui.position[0])
browserOpts.y = firstDefinedValue(browserOpts.y, windowState.ui.position[1])
+ } else if (typeof defaults.x === 'number' && typeof defaults.y === 'number') {
+ // Position comes from the default position
+ browserOpts.x = firstDefinedValue(browserOpts.x, defaults.x)
+ browserOpts.y = firstDefinedValue(browserOpts.y, defaults.y)
+ } else {
+ // Default the position
+ browserOpts.x = firstDefinedValue(browserOpts.x, browserOpts.left, browserOpts.screenX)
+ browserOpts.y = firstDefinedValue(browserOpts.y, browserOpts.top, browserOpts.screenY)
}
+ return browserOpts
+}
+
+const createWindow = (browserOpts, defaults, frameOpts, windowState) => {
+ browserOpts = setWindowDimensions(browserOpts, defaults, windowState)
+ browserOpts = setWindowPosition(browserOpts, defaults, windowState)
- browserOpts.x = firstDefinedValue(browserOpts.x, browserOpts.left, browserOpts.screenX, defaults.x)
- browserOpts.y = firstDefinedValue(browserOpts.y, browserOpts.top, browserOpts.screenY, defaults.y)
delete browserOpts.left
delete browserOpts.top
const screen = electron.screen
const primaryDisplay = screen.getPrimaryDisplay()
+ const parentWindowKey = browserOpts.parentWindowKey
const parentWindow = parentWindowKey ? BrowserWindow.fromId(parentWindowKey) : BrowserWindow.getFocusedWindow()
const bounds = parentWindow ? parentWindow.getBounds() : primaryDisplay.bounds
@@ -100,7 +120,7 @@ const createWindow = (browserOpts, defaults, frameOpts, windowState) => {
// if no parentWindow, x, y or center is defined then go ahead
// and center it if it's smaller than the display width
- // typeof and isNaN are used because 0 is falsy
+ // typeof and isNaN are used because 0 is falsey
if (!(parentWindow ||
browserOpts.center === false ||
browserOpts.x > 0 ||
@@ -258,8 +278,8 @@ function windowDefaults () {
show: false,
width: appState.getIn(['defaultWindowParams', 'width']) || appState.get('defaultWindowWidth'),
height: appState.getIn(['defaultWindowParams', 'height']) || appState.get('defaultWindowHeight'),
- x: appState.getIn(['defaultWindowParams', 'x']),
- y: appState.getIn(['defaultWindowParams', 'y']),
+ x: appState.getIn(['defaultWindowParams', 'x']) || undefined,
+ y: appState.getIn(['defaultWindowParams', 'y']) || undefined,
minWidth: 480,
minHeight: 300,
minModalHeight: 100,
diff --git a/less/about/bookmarks.less b/less/about/bookmarks.less
index fcdb04278e0..9cd15f2227d 100644
--- a/less/about/bookmarks.less
+++ b/less/about/bookmarks.less
@@ -72,7 +72,7 @@
height: 1rem;
&.selected >*,
&.isDragOver >* {
- font-weight: 800;
+ font-weight: 600;
}
&.isDragOver {
background-color: lighten(@braveOrange, 20%);
diff --git a/less/navigationBar.less b/less/navigationBar.less
index 9dd45b8262a..29e4f6289b2 100644
--- a/less/navigationBar.less
+++ b/less/navigationBar.less
@@ -36,7 +36,7 @@
// Windows specific styles
.platform--win32 {
- div#window.frameless {
+ div#window.frameless:not(.isFullScreen):not(.isMaximized) {
border: 1px solid #000;
box-sizing: border-box;
}
@@ -222,10 +222,10 @@
// Windows 10 specific styles
&.win10 {
- &.inactive div#window.frameless {
+ &.inactive div#window.frameless:not(.isFullScreen):not(.isMaximized) {
border: 1px solid #aaaaaa;
}
- div#window.frameless {
+ div#window.frameless:not(.isFullScreen):not(.isMaximized) {
border: 1px solid #2283d3;
}
.windowCaptionButtons {