Adjust the titlebar/menubar xml and styling.

Reasoning:
- Different Linux DEs specify different titlebar button (min, max,
close) locations which we did not and could not support before.
- Previous approach copied from Firefox depended on custom offsets
specified in CSS instead of allowing the browser engine to place
elements

Changes:
- Titlebar and menubar no longer collapsed into each other with a
negative margin, instead just a single flexbox (on macOS the titlebar
is still collapsed into the tab bar)
- Support for -moz-gtk-csd-reversed-placement to correctly place the
titlebar buttons on Linux
- Removed/changed some code copied from Firefox that does not apply or
uses the wrong selectors
- Fixed the display of Linux Unity DE buttons with icons appearing outside
of button borders
- Removed the Z in the titlebar on Linux since only a few DEs use that.
- Aligned the tabbar on Linux and Windows to the left margin of the
window.
This commit is contained in:
Adomas Venčkauskas 2024-02-14 13:21:31 +02:00 committed by Dan Stillman
parent 34b389d118
commit beb7b51cb3
10 changed files with 104 additions and 183 deletions

View file

@ -8,18 +8,21 @@
background: var(--material-tabbar);
}
#navigator-toolbox {
#titlebar {
height: var(--tab-min-height);
-moz-box-pack: center;
pointer-events: none;
-moz-appearance: -moz-window-titlebar;
}
#toolbar-menubar {
pointer-events: none;
visibility: visible;
// space for 30*30 icon
padding-left: var(--tab-min-height);
margin: 0 8px;
height: var(--tab-min-height);
appearance: none;
flex: 1;
}
#menubar-items {
@ -30,39 +33,19 @@
height: var(--tab-min-height);
}
#titlebar {
pointer-events: none;
}
.titlebar-buttonbox {
pointer-events: all;
margin: 0 4px;
margin: 0 10px;
}
.titlebar-button {
margin: 4px 0;
width: calc(var(--tab-min-height) - 8px);
height: calc(var(--tab-min-height) - 8px);
position: relative;
position: static;
// Fix KDE rendering bug
z-index: 1;
}
.titlebar-icon-container {
margin-bottom: calc(0px - var(--tab-min-height));
height: var(--tab-min-height);
}
.titlebar-icon {
-moz-window-dragging: drag;
// to make the icon 30*30
margin: 7px;
object-fit: none;
}
.titlebar-buttonbox-container {
-moz-box-pack: end;
height: var(--tab-min-height);
display: none;
}
// Following rules from https://searchfox.org/mozilla-central/source/browser/themes/linux/browser.css
@ -73,9 +56,9 @@
* can swallow those events. */
.titlebar-buttonbox {
z-index: 1;
display: flex;
align-items: center;
// Disable button stretch
-moz-box-align: baseline;
height: var(--tab-min-height);
}
/* Render titlebar command buttons according to system config.
@ -156,7 +139,8 @@
}
@media (-moz-gtk-csd-reversed-placement) {
.titlebar-buttonbox-container {
order: -1;
.titlebar-buttonbox {
order: -1;
margin-right: 0;
}
}