Skip to content

Commit 90e6764

Browse files
committed
Bug 1974861 - Improve titlebar in Adwaita / Yaru by providing a button background. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D256181
1 parent 264f84e commit 90e6764

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

browser/themes/linux/browser.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@
208208
height: 24px;
209209
/* Matches the libadwaita transition */
210210
transition: background-color 0.2s ease;
211+
212+
@media (-moz-gtk-theme-family: adwaita) or (-moz-gtk-theme-family: yaru) {
213+
/* On Adwaita / Yaru, the titlebar buttons have a background by default */
214+
background-color: color-mix(in srgb, currentColor 10%, transparent);
215+
}
211216
}
212217

213218
&:hover > .toolbarbutton-icon {

widget/gtk/nsLookAndFeel.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2144,10 +2144,11 @@ void nsLookAndFeel::PerThemeData::Init() {
21442144
mName = GetGtkTheme();
21452145

21462146
mFamily = [&] {
2147-
if (mName.EqualsLiteral("Adwaita") || mName.EqualsLiteral("Adwaita-dark")) {
2147+
if (StringBeginsWith(mName, "Adw"_ns)) {
2148+
// This catches "Adwaita", "Adwaita-dark", and "Adw-gtk3" too.
21482149
return ThemeFamily::Adwaita;
21492150
}
2150-
if (mName.EqualsLiteral("Breeze") || mName.EqualsLiteral("Breeze-Dark")) {
2151+
if (StringBeginsWith(mName, "Breeze"_ns)) {
21512152
return ThemeFamily::Breeze;
21522153
}
21532154
if (StringBeginsWith(mName, "Yaru"_ns)) {

0 commit comments

Comments
 (0)