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 #10512 from petemill/navbar-vertical-rhythm
Browse files Browse the repository at this point in the history
Fix vertical spacing for all navbar item combinations
  • Loading branch information
bsclifton authored Sep 4, 2017
2 parents 862b896 + 9690bf6 commit 36bf92d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 22 deletions.
5 changes: 3 additions & 2 deletions app/renderer/components/bookmarks/bookmarksToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,13 +211,14 @@ const styles = StyleSheet.create({
boxSizing: 'border-box',
display: 'flex',
flex: 1,
padding: `${globalStyles.spacing.navbarMenubarMargin} ${globalStyles.spacing.bookmarksToolbarPadding}`
padding: `0 ${globalStyles.spacing.bookmarksToolbarPadding}`,
margin: `${globalStyles.spacing.navbarMenubarMargin} 0`
},
bookmarksToolbar__allowDragging: {
WebkitAppRegion: 'drag'
},
bookmarksToolbar__showOnlyFavicon: {
padding: `${globalStyles.spacing.navbarMenubarMargin} 0 ${globalStyles.spacing.tabPagesHeight} ${globalStyles.spacing.bookmarksToolbarPadding}`
padding: `0 0 0 ${globalStyles.spacing.bookmarksToolbarPadding}`
},
bookmarksToolbar__bookmarkButton: {
boxSizing: 'border-box',
Expand Down
34 changes: 21 additions & 13 deletions app/renderer/components/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,11 @@ class Main extends React.Component {
? <PopupWindow />
: null
}
<div className='top'
<div className={cx({
top: true,
allowDragging: this.props.shouldAllowWindowDrag,
})
}
onMouseEnter={windowActions.setMouseInTitlebar.bind(null, true)}
onMouseLeave={windowActions.setMouseInTitlebar.bind(null, false)}
>
Expand Down Expand Up @@ -686,18 +690,22 @@ class Main extends React.Component {
? <BookmarksToolbar />
: null
}
<div className={cx({
tabPages: true,
allowDragging: this.props.shouldAllowWindowDrag,
singlePage: this.props.isSinglePage
})}
onContextMenu={this.onTabContextMenu}>
{
this.props.showTabPages
? <TabPages />
: null
}
</div>
{
this.props.isSinglePage
? null
: <div className={cx({
tabPages: true,
allowDragging: this.props.shouldAllowWindowDrag,
singlePage: this.props.isSinglePage
})}
onContextMenu={this.onTabContextMenu}>
{
this.props.showTabPages
? <TabPages />
: null
}
</div>
}
<TabsToolbar key='tab-bar' />
{
this.props.showNotificationBar
Expand Down
1 change: 1 addition & 0 deletions app/renderer/components/styles/commonStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ const styles = StyleSheet.create({

// notificationBar
notificationBar: {
'-webkit-app-region': 'no-drag',
display: 'inline-block',
boxSizing: 'border-box',
width: '100%',
Expand Down
1 change: 1 addition & 0 deletions less/findbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@import "variables.less";

.findBar {
-webkit-app-region: no-drag;
background: @findbarBackground;
border-bottom: 1px solid @lightGray;
color: @highlightBlue;
Expand Down
2 changes: 1 addition & 1 deletion less/navigationBar.less
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
// Styles had to be reworked to properly position the new caption buttons for Windows
.navbarCaptionButtonContainer {
display: flex;
//border-bottom: 1px solid #bbb;
margin-bottom: @navbarMenubarMargin;

&.allowDragging {
-webkit-app-region: drag;
Expand Down
8 changes: 2 additions & 6 deletions less/tabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
}

.tabsToolbar {
-webkit-app-region: no-drag;
box-sizing: border-box;
background: @tabsBackground;
display: flex;
Expand All @@ -143,7 +144,7 @@
display: flex;
justify-content: center;
height: @tabPagesHeight;
padding: @tabPagesHeight 0 @navbarMenubarMargin 0;
margin: @navbarMenubarMargin 0 @navbarMenubarMargin 0;
position: relative;
z-index: @zindexTabs;

Expand All @@ -154,11 +155,6 @@
}
}

&.singlePage {
margin: 0;
padding: 0;
}

>div {
display: flex
}
Expand Down
3 changes: 3 additions & 0 deletions less/window.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ html,

.top {
background: linear-gradient(to bottom, #eaeaea, #f2f2f4);
&.allowDragging {
-webkit-app-region: drag;
}
}

.mainContainer {
Expand Down

0 comments on commit 36bf92d

Please sign in to comment.