Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4296 from bsclifton/draggable_fixes
Browse files Browse the repository at this point in the history
Fixed draggable areas of window.
  • Loading branch information
bbondy authored Sep 27, 2016
2 parents 0d59cba + 2aae438 commit 10a4613
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 45 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Logs
logs
*.log
npm-debug.log.*

# Runtime data
pids
Expand Down
4 changes: 0 additions & 4 deletions app/renderer/components/windowCaptionButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,6 @@ class WindowCaptionButtons extends ImmutableComponent {
</div>
</button>
</div>
<div className={cx({
deadArea: true,
allowDragging: this.props.shouldAllowWindowDrag
})} />
</div>
}
}
Expand Down
17 changes: 8 additions & 9 deletions js/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,10 @@ class Main extends ImmutableComponent {
: null
}
<div className='top'>
<div className='navbarCaptionButtonContainer'>
<div className={cx({
navbarCaptionButtonContainer: true,
allowDragging: shouldAllowWindowDrag
})}>
<div className='navbarMenubarFlexContainer'>
{
customTitlebar.menubarVisible
Expand All @@ -881,10 +884,6 @@ class Main extends ImmutableComponent {
contextMenuDetail={this.props.windowState.get('contextMenuDetail')}
autohide={getSetting(settings.AUTO_HIDE_MENU)}
lastFocusedSelector={customTitlebar.lastFocusedSelector} />
<div className={cx({
deadArea: true,
allowDragging: shouldAllowWindowDrag
})} />
</div>
: null
}
Expand Down Expand Up @@ -933,7 +932,7 @@ class Main extends ImmutableComponent {
/>
<div className='topLevelEndButtons'>
<div className={cx({
deadArea: true,
extraDragArea: true,
allowDragging: shouldAllowWindowDrag
})} />
{
Expand All @@ -952,7 +951,7 @@ class Main extends ImmutableComponent {
</div>
{
customTitlebar.captionButtonsVisible
? <WindowCaptionButtons windowMaximized={customTitlebar.isMaximized} shouldAllowWindowDrag={shouldAllowWindowDrag} />
? <WindowCaptionButtons windowMaximized={customTitlebar.isMaximized} />
: null
}
</div>
Expand Down Expand Up @@ -1052,7 +1051,7 @@ class Main extends ImmutableComponent {
}
<div className={cx({
tabPages: true,
allowDragging: shouldAllowWindowDrag && !isWindows,
allowDragging: shouldAllowWindowDrag,
singlePage: nonPinnedFrames.size <= tabsPerPage
})}
onContextMenu={this.onTabContextMenu}>
Expand All @@ -1067,7 +1066,7 @@ class Main extends ImmutableComponent {
</div>
<TabsToolbar
paintTabs={getSetting(settings.PAINT_TABS)}
shouldAllowWindowDrag={shouldAllowWindowDrag && !isWindows}
shouldAllowWindowDrag={shouldAllowWindowDrag}
draggingOverData={this.props.windowState.getIn(['ui', 'dragging', 'draggingOver', 'dragType']) === dragTypes.TAB && this.props.windowState.getIn(['ui', 'dragging', 'draggingOver'])}
previewTabs={getSetting(settings.SHOW_TAB_PREVIEWS)}
tabsPerTabPage={tabsPerPage}
Expand Down
43 changes: 11 additions & 32 deletions less/navigationBar.less
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
// changes to ensure window can be as small as 480px wide
// and still be useable and have the caption buttons intact
@media (max-width: @breakpointExtensionButtonPadding) {
.navigatorWrapper .topLevelEndButtons .deadArea {
.navigatorWrapper .topLevelEndButtons .extraDragArea {
width: 0;
}
}
Expand Down Expand Up @@ -81,6 +81,10 @@
.navbarCaptionButtonContainer {
display: flex;
border-bottom: 1px solid #aaaaaa;

&.allowDragging {
-webkit-app-region: drag;
}
}
.navbarMenubarFlexContainer {
display: flex;
Expand All @@ -100,7 +104,6 @@
.windowCaptionButtons {
display: flex;
flex-direction: column;

white-space: nowrap;

.hidden {
Expand All @@ -121,6 +124,7 @@
.container {
display: flex;
flex-grow: 0;
-webkit-app-region: no-drag;
}

.win7 {
Expand Down Expand Up @@ -415,17 +419,6 @@
}
}
}

.deadArea {
display: flex;
flex-grow:1;
&.allowDragging {
-webkit-app-region: drag;
>* {
-webkit-app-region: no-drag;
}
}
}
}

// Menubar (for use w/ slim titlebar)
Expand Down Expand Up @@ -459,17 +452,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.
Expand Down Expand Up @@ -535,6 +517,10 @@
display: flex;
flex-direction: row;

.extensionButton {
-webkit-app-region: no-drag;
}

.braveMenu {
width: @navbarBraveButtonWidth;
margin-right: @navbarButtonSpacing;
Expand All @@ -555,17 +541,10 @@
}
}

.deadArea {
.extraDragArea {
display: flex;
flex-grow: 0;
width: @navbarBraveButtonMarginLeft;

&.allowDragging {
-webkit-app-region: drag;
>* {
-webkit-app-region: no-drag;
}
}
}
}
}
Expand Down

0 comments on commit 10a4613

Please sign in to comment.