Improve support for gtk-csd-reversed-placement

This patch changes how we deal with window control buttons on left
layouts. Previously, we looked to a pref that was only set on macos
but with this patch we use media queries to detect whether the system
is macOS or gtk-csd buttons use left-side layout.

To support old-style "override pref" this patch also introduces a
new custom pref userchrome.force-window-controls-on-left.enabled
which can be used e.g on Windows to move window controls to left side.
This logic is currently only supported in styles that use
window_control_placeholder_support.css
This commit is contained in:
MrOtherGuy
2022-12-23 13:53:51 +02:00
parent c07ce454e8
commit 95fbda2710
5 changed files with 68 additions and 24 deletions

View File

@@ -8,7 +8,9 @@ See the above repository for updates as well as full license text. */
/*
urlbar_popup_full_width.css is VERY MUCH recommended for Firefox 71+ because of new urlbar popup
*/
:root[tabsintitlebar][sizemode="normal"]{
--uc-window-drag-space-width: 24px;
}
:root[uidensity="compact"]{
--tab-block-margin: 2px !important;
}
@@ -51,12 +53,24 @@ urlbar_popup_full_width.css is VERY MUCH recommended for Firefox 71+ because of
}
/* Window drag space */
:root[tabsintitlebar="true"] #nav-bar{ padding-left: 24px !important }
:root[tabsintitlebar="true"] #nav-bar{ padding-left: var(--uc-window-drag-space-width) !important }
/* Rules specific to window controls on right layout */
@supports -moz-bool-pref("layout.css.osx-font-smoothing.enabled"){
.titlebar-buttonbox-container{ position: fixed; display: block; left: 0px; z-index: 3; }
:root[tabsintitlebar="true"] #nav-bar{ padding-left: 96px !important; padding-right: 0px !important; }
/* Rules for window controls on left layout */
@media (-moz-gtk-csd-reversed-placement),
(-moz-platform: macos){
.titlebar-buttonbox-container{
position: fixed;
display: flex;
left: 0px;
z-index: 3;
height: var(--uc-toolbar-height);
align-items: center
}
:root[tabsintitlebar="true"] #nav-bar{ padding-inline: calc(var(--uc-window-drag-space-width,0px) + 84px) 0px !important; }
}
@media (-moz-platform: macos){
:root[tabsintitlebar="true"] #nav-bar{ padding-inline: calc(var(--uc-window-drag-space-width,0px) + 72px) 0px !important; }
}
/* 1px margin on touch density causes tabs to be too high */