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

Full-height tabs in maximised win32 windows #1109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions app/background-process/ui/windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@ export function createShellWindow (windowState) {
unregisterShortcut(win, 'Esc')
sendToWebContents('leave-full-screen')(e)
})
win.on('maximize', sendToWebContents('maximize'))
win.on('unmaximize', sendToWebContents('unmaximize'))
win.on('closed', onClosed(win))

return win
Expand Down
2 changes: 2 additions & 0 deletions app/shell-window/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function onWindowEvent (event, type) {
break
case 'enter-full-screen': return document.body.classList.add('fullscreen')
case 'leave-full-screen': return document.body.classList.remove('fullscreen')
case 'maximize': return document.body.classList.add('maximized')
case 'unmaximize': return document.body.classList.remove('maximized')
case 'leave-page-full-screen': pages.leavePageFullScreen()
}
}
15 changes: 13 additions & 2 deletions app/stylesheets/shell-window/chrome-tabs.less
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ body.darwin .chrome-tabs {
-webkit-app-region: drag;
}

// make room for resizing on the top
body.win32 {
// make room for resizing on the top when not maximized.
body:not(.maximized).win32{
.chrome-tabs-shell {
padding-top: 4px;
}
Expand All @@ -272,6 +272,17 @@ body.win32 {
}
}

// Ensure tabs go right to top of screen when maximized on win32.
body.maximized.win32 {
.chrome-tab {
top: 0px;
}

.chrome-tabs-shell {
height: 30px;
}
}

// make room for the traffic lights
.darwin:not(.fullscreen) .chrome-tabs {
padding-left: 75px;
Expand Down
5 changes: 5 additions & 0 deletions app/stylesheets/shell-window/toolbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ body.fullscreen #toolbar {
background: #e0e0e0;
}

// Ensure toolbar resizes correctly when maximized on win32.
body.maximized.win32 {
height: 68px;
}

.download-started-animation {
position: fixed;
bottom: 20px;
Expand Down
11 changes: 11 additions & 0 deletions app/stylesheets/shell-window/win32-titlebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,15 @@
}
body.win32 #win32-titlebar {
display: flex;
}

// Ensure that the controls are properly sized when maximized.
body.maximized.win32 {
#win32-titlebar {
height: 30px;
}

#win32-titlebar .win32-titlebar-close:after {
line-height: 30px;
}
}