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

Reposition Brave Lion on Windows #5485

Merged
merged 1 commit into from
Nov 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/renderer/components/windowCaptionButtons.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ class WindowCaptionButtons extends ImmutableComponent {

return <div className={cx({
fullscreen: this.props.windowMaximized,
windowCaptionButtons: true
windowCaptionButtons: true,
verticallyCenter: this.props.verticallyCenter
})}>
<div className='container'>
<button
Expand Down
15 changes: 11 additions & 4 deletions js/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,7 @@ class Main extends ImmutableComponent {
contextMenuDetail={this.props.windowState.get('contextMenuDetail')}
autohide={getSetting(settings.AUTO_HIDE_MENU)}
lastFocusedSelector={customTitlebar.lastFocusedSelector} />
<WindowCaptionButtons windowMaximized={customTitlebar.isMaximized} />
</div>
: null
}
Expand Down Expand Up @@ -969,7 +970,7 @@ class Main extends ImmutableComponent {
/>
<div className='topLevelEndButtons'>
<div className={cx({
extraDragArea: true,
extraDragArea: !customTitlebar.menubarVisible,
allowDragging: shouldAllowWindowDrag
})} />
{
Expand All @@ -980,15 +981,21 @@ class Main extends ImmutableComponent {
className={cx({
navbutton: true,
braveShieldsDisabled,
braveShieldsDown: !braverySettings.shieldsUp
braveShieldsDown: !braverySettings.shieldsUp,
leftOfCaptionButton: customTitlebar.captionButtonsVisible && !customTitlebar.menubarVisible
})}
onClick={this.onBraveMenu} />
{
customTitlebar.captionButtonsVisible && !customTitlebar.menubarVisible
? <span className='buttonSeparator' />
: null
}
</div>
</div>
</div>
{
customTitlebar.captionButtonsVisible
? <WindowCaptionButtons windowMaximized={customTitlebar.isMaximized} />
customTitlebar.captionButtonsVisible && !customTitlebar.menubarVisible
? <WindowCaptionButtons windowMaximized={customTitlebar.isMaximized} verticallyCenter='true' />
: null
}
</div>
Expand Down
2 changes: 1 addition & 1 deletion less/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

span.buttonSeparator {
width: 1px;
border-left: 1px solid @gray;
border-left: 1px solid #e2e2e2;
margin: 4px 3px 4px 3px;
}

Expand Down
40 changes: 34 additions & 6 deletions less/navigationBar.less
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@
}
}
}
.verticallyCenter {
justify-content: center;
}
}

// Windows 10 specific styles
Expand All @@ -243,16 +246,29 @@
border: 1px solid #2283d3;
}
.windowCaptionButtons {
&.verticallyCenter {
> .container {
height: 100%;
}
}
&:not(.verticallyCenter) {
> .container {
button.captionButton {
height: 29px;
&.fullscreen {
height: 21px;
}
}
}
}

> .container {
button.captionButton {
width: 45px;
height: 29px;
border: 0;
background-color: transparent;

&.fullscreen {
height:21px;
}
&.fullscreen { }

&.minimize {
&:hover {
Expand Down Expand Up @@ -350,6 +366,9 @@
}
}
}
.verticallyCenter {
justify-content: center;
}
}
}

Expand Down Expand Up @@ -414,8 +433,9 @@
display: flex;
cursor: default;
-webkit-user-select: none;
flex-grow: 0;
flex-grow: 1;
margin-top: 2px;
height: 19px;

.menubarItem {
color: black;
Expand All @@ -436,6 +456,10 @@
border: 1px solid #99d1ff !important;
}
}

.windowCaptionButtons {
flex-grow: 0;
}
}

// Here I grouped the rules to keep the layout of the top bar consistent.
Expand Down Expand Up @@ -499,6 +523,7 @@
.topLevelEndButtons {
display: flex;
flex-direction: row;
margin-left: 3px;

.extensionButton {
-webkit-app-region: no-drag;
Expand All @@ -522,6 +547,9 @@
-webkit-filter: grayscale(100%);
opacity: 0.4;
}
&.leftOfCaptionButton {
margin-right: 1px;
}
}

.extraDragArea {
Expand Down Expand Up @@ -812,7 +840,7 @@
&.endButtons {
margin-right: 20px;
@media (max-width: @breakpointNarrowViewport) {
margin-right: -5px;
margin-right: 0px;
}
}
}
Expand Down