From 2aae4388c38f12715334c7ec462b3445735b1066 Mon Sep 17 00:00:00 2001 From: Brian Clifton Date: Sun, 25 Sep 2016 12:56:00 -0700 Subject: [PATCH] Fixed draggable areas of window. - parent item marks all as draggable - child items exclude themself as needed - parent level draggable is disregarded if modal is open, menu is open, etc (using shouldAllowWindowDrag) Other touch-ups: - tabs bar is now draggable (no longer right-clickable) - caption button drag and surrounding area is correct now - after acceptance of electron PR, corners are easy to click (hit testing) Fixes https://github.com/brave/browser-laptop/issues/4235 Fixes https://github.com/brave/browser-laptop/issues/4144 Depends on https://github.com/brave/electron/pull/63 Auditors: @bbondy @jonathansampson --- .gitignore | 1 + .../components/windowCaptionButtons.js | 4 -- js/components/main.js | 17 ++++--- less/navigationBar.less | 45 +++++-------------- 4 files changed, 21 insertions(+), 46 deletions(-) diff --git a/.gitignore b/.gitignore index 8715d9349f3..a11a33fb8f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Logs logs *.log +npm-debug.log.* # Runtime data pids diff --git a/app/renderer/components/windowCaptionButtons.js b/app/renderer/components/windowCaptionButtons.js index 36c6d3e3fcc..257ac6564ff 100644 --- a/app/renderer/components/windowCaptionButtons.js +++ b/app/renderer/components/windowCaptionButtons.js @@ -104,10 +104,6 @@ class WindowCaptionButtons extends ImmutableComponent { -
} } diff --git a/js/components/main.js b/js/components/main.js index bb3d2554377..675f450c431 100644 --- a/js/components/main.js +++ b/js/components/main.js @@ -870,7 +870,10 @@ class Main extends ImmutableComponent { : null }
-
+
{ customTitlebar.menubarVisible @@ -881,10 +884,6 @@ class Main extends ImmutableComponent { contextMenuDetail={this.props.windowState.get('contextMenuDetail')} autohide={getSetting(settings.AUTO_HIDE_MENU)} lastFocusedSelector={customTitlebar.lastFocusedSelector} /> -
: null } @@ -933,7 +932,7 @@ class Main extends ImmutableComponent { />
{ @@ -952,7 +951,7 @@ class Main extends ImmutableComponent {
{ customTitlebar.captionButtonsVisible - ? + ? : null }
@@ -1052,7 +1051,7 @@ class Main extends ImmutableComponent { }
@@ -1067,7 +1066,7 @@ class Main extends ImmutableComponent {
* { - -webkit-app-region: no-drag; - } - } - } } // Menubar (for use w/ slim titlebar) @@ -454,17 +447,6 @@ border: 1px solid #99d1ff !important; } } - .deadArea { - display: flex; - flex-grow: 1; - - &.allowDragging { - -webkit-app-region: drag; - >* { - -webkit-app-region: no-drag; - } - } - } } // Here I grouped the rules to keep the layout of the top bar consistent. @@ -530,6 +512,10 @@ display: flex; flex-direction: row; + .extensionButton { + -webkit-app-region: no-drag; + } + .braveMenu { width: @navbarBraveButtonWidth; margin-right: @navbarButtonSpacing; @@ -550,17 +536,10 @@ } } - .deadArea { + .extraDragArea { display: flex; flex-grow: 0; width: @navbarBraveButtonMarginLeft; - - &.allowDragging { - -webkit-app-region: drag; - >* { - -webkit-app-region: no-drag; - } - } } } }