Fix fullscreen and improve CSD code (#434)

This commit is contained in:
Commenter 2022-08-28 11:47:31 -05:00 committed by GitHub
parent 73c929f3b1
commit 8adfeb8641
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 38 deletions

View File

@ -11,30 +11,43 @@
border-radius: env(-moz-gtk-csd-titlebar-radius) env(-moz-gtk-csd-titlebar-radius) 0 0 !important;
}
/* Window buttons: at least 1 button */
@media (-moz-gtk-csd-minimize-button), (-moz-gtk-csd-maximize-button), (-moz-gtk-csd-close-button) {
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-right: 50px !important;
:root {
--gnome-navbar-csd-offset: 50px;
}
}
/* Window buttons: at least 2 buttons */
@media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button),
(-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-close-button),
(-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-right: 90px !important;
:root {
--gnome-navbar-csd-offset: 90px;
}
}
/* Window buttons: 3 buttons */
@media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-right: 130px !important;
:root {
--gnome-navbar-csd-offset: 130px;
}
}
/* Right window buttons offset by button count */
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-left: 3px !important;
padding-right: var(--gnome-navbar-csd-offset) !important;
}
/* Fullscreen headerbar padding for 1 button */
:root[tabsintitlebar][inFullscreen] #nav-bar {
padding-right: 50px !important;
}
/* Left window buttons */
@media (-moz-gtk-csd-reversed-placement) {
/* Window controls offset by button count */
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-left: var(--gnome-navbar-csd-offset) !important;
padding-right: 3px !important;
}
@ -44,40 +57,29 @@
right: auto !important;
}
/* Window controls: at least 1 button */
@media (-moz-gtk-csd-minimize-button), (-moz-gtk-csd-maximize-button), (-moz-gtk-csd-close-button) {
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-left: 50px !important;
}
/* Fullscreen headerbar padding for 1 button */
:root[tabsintitlebar][inFullscreen] #nav-bar {
padding-left: 50px !important;
padding-right: 3px !important
}
/* Window controls: at least 2 buttons */
@media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button),
(-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-close-button),
(-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-left: 90px !important;
}
}
/* Window controls: 3 buttons */
@media (-moz-gtk-csd-minimize-button) and (-moz-gtk-csd-maximize-button) and (-moz-gtk-csd-close-button) {
:root[tabsintitlebar]:not([inFullscreen]) #nav-bar {
padding-left: 130px !important;
}
}
}
/* Fullscreen headerbar padding for 1 button */
:root[tabsintitlebar][inFullscreen] #nav-bar {
padding-right: 50px !important;
}
/* Remove close and minimize buttons from fullscreen buttons */
:root[tabsintitlebar][inFullscreen] #window-controls #close-button,
:root[tabsintitlebar][inFullscreen] #window-controls #minimize-button,
:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-buttonbox-container {
:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-buttonbox-container .titlebar-min,
:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-buttonbox-container .titlebar-close {
display: none !important;
}
/* Force the restore button to appear regardless of maximize button's status */
:root[tabsintitlebar][inFullscreen] #titlebar .titlebar-buttonbox-container .titlebar-restore {
display: inherit !important;
}
/* Hide window controls when navbar is hidden */
:root[tabsintitlebar][inFullscreen] #navigator-toolbox[style*='margin-top:'] #titlebar .titlebar-buttonbox-container {
top: -999px;
}
/* Remove tabsbar titlebar blank spaces */
:root[tabsintitlebar] #TabsToolbar .titlebar-placeholder {
display: none !important;
@ -100,11 +102,9 @@
}
/* Window buttons box */
:root[tabsintitlebar] #titlebar .titlebar-buttonbox-container,
:root[tabsintitlebar] #titlebar-buttonbox-container,
:root[tabsintitlebar][inFullscreen] #window-controls {
:root[tabsintitlebar] #titlebar .titlebar-buttonbox-container {
-moz-appearance: none !important;
padding: 6px 3px;
padding: 5px 3px;
position: absolute !important;
right: 0;
top: 0;