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 #4193 from Sh1d0w/feature/top-bar-fullscreen
Browse files Browse the repository at this point in the history
Show top panel in fullscreen on mouse over
  • Loading branch information
bbondy authored Sep 26, 2016
2 parents 0fcdf0c + 340d012 commit 1499d9d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 8 deletions.
2 changes: 0 additions & 2 deletions js/components/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -901,8 +901,6 @@ class Frame extends ImmutableComponent {
this.webview.focus()
}
windowActions.setNavigated(e.url, this.props.frameKey, false)
// force temporary url display for tabnapping protection
windowActions.setMouseInTitlebar(true)

// After navigating to the URL, set correct frame title
let webContents = this.webview.getWebContents()
Expand Down
10 changes: 8 additions & 2 deletions js/components/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ class Main extends ImmutableComponent {
}

const height = navigator.getBoundingClientRect().bottom
if (this.pageY < height && this.props.windowState.getIn(['ui', 'mouseInTitlebar']) !== true) {
if (this.pageY <= height && this.props.windowState.getIn(['ui', 'mouseInTitlebar']) !== true) {
windowActions.setMouseInTitlebar(true)
} else if (this.pageY === undefined || this.pageY >= height && this.props.windowState.getIn(['ui', 'mouseInTitlebar']) !== false) {
windowActions.setMouseInTitlebar(false)
Expand Down Expand Up @@ -844,7 +844,13 @@ class Main extends ImmutableComponent {
return <div id='window'
className={cx({
isFullScreen: activeFrame && activeFrame.get('isFullScreen'),
frameless: customTitlebar.captionButtonsVisible
isWindowFullScreen: this.props.windowState.getIn(['ui', 'isFullScreen']),
frameless: customTitlebar.captionButtonsVisible,
visible: this.props.windowState.getIn(['ui', 'isFullScreen']) &&
(
(activeFrame && activeFrame.getIn(['navbar', 'urlbar', 'focused'])) ||
(this.props.windowState.getIn(['ui', 'mouseInTitlebar']))
)
})}
ref={(node) => { this.mainWindow = node }}
onMouseDown={this.onMouseDown}
Expand Down
5 changes: 5 additions & 0 deletions js/stores/windowStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ const doAction = (action) => {
if (!(action.location === 'about:newtab' && !FrameStateUtil.getActiveFrame(windowState).get('canGoForward'))) {
updateNavBarInput(action.location, frameStatePath(key))
}

if (!windowState.getIn(['ui', 'isFullScreen'])) {
// force temporary url display for tabnapping protection
windowState = windowState.setIn(['ui', 'mouseInTitlebar'], true)
}
break
case WindowConstants.WINDOW_SET_NAVBAR_INPUT:
updateNavBarInput(action.location)
Expand Down
27 changes: 23 additions & 4 deletions less/window.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,35 @@ html,
width: 100%;

&.isFullScreen {
.top, .downloadsBar, .hrefPreview {
display: none;
}
}
.top, .downloadsBar, .hrefPreview {
display: none;
}
}
}

#windowContainer {
width: 100%;
height: 100%;
position: absolute;

.platform--linux, .platform--win32 {
#window {
&.isWindowFullScreen {
.top, .downloadsBar, .hrefPreview {
transition: all 0.4s ease-out;
opacity: 0;
max-height: 0px;
}
}

&.visible {
.top, .downloadsBar, .hrefPreview {
max-height: 500px;
opacity: 1;
}
}
}
}
}

.top {
Expand Down

0 comments on commit 1499d9d

Please sign in to comment.