From 30cf04d26c8da07a84665636299b2f04ade9ea29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 9 Mar 2021 00:33:06 +0000 Subject: [PATCH] Bug 1696988 - Add backgrounds for non-native tooltips on Linux and OSX. r=ntim The Linux styles match Adwaita trunk[1], so it's a bit smaller than the native ones but I think that's fine (it matches other themes more closely, like Arc). On OSX the system color needs to be tweaked (will do in a follow-up) since it is windows-style yellow right now, which is rather ugly. But this is a progression regardless. [1]: https://gitlab.gnome.org/GNOME/gtk/-/issues/3352 Differential Revision: https://phabricator.services.mozilla.com/D107548 --- toolkit/themes/linux/global/tooltip.css | 4 ++++ toolkit/themes/osx/global/tooltip.css | 1 + widget/gtk/nsNativeThemeGTK.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/toolkit/themes/linux/global/tooltip.css b/toolkit/themes/linux/global/tooltip.css index 496d8ebfbaa5..26bec1d7b47d 100644 --- a/toolkit/themes/linux/global/tooltip.css +++ b/toolkit/themes/linux/global/tooltip.css @@ -13,7 +13,11 @@ tooltip { appearance: auto; -moz-default-appearance: tooltip; max-width: 40em; + + padding: 6px 10px; /* Matches Adwaita. */ + color: InfoText; + background-color: InfoBackground; font: message-box; } diff --git a/toolkit/themes/osx/global/tooltip.css b/toolkit/themes/osx/global/tooltip.css index 04392367f562..382ee0eed15f 100644 --- a/toolkit/themes/osx/global/tooltip.css +++ b/toolkit/themes/osx/global/tooltip.css @@ -16,6 +16,7 @@ tooltip { padding: 2px 3px; max-width: 40em; color: InfoText; + background-color: InfoBackground; font: message-box; cursor: default; } diff --git a/widget/gtk/nsNativeThemeGTK.cpp b/widget/gtk/nsNativeThemeGTK.cpp index ab5b8afbfa1c..9bd4aad25040 100644 --- a/widget/gtk/nsNativeThemeGTK.cpp +++ b/widget/gtk/nsNativeThemeGTK.cpp @@ -1377,6 +1377,7 @@ bool nsNativeThemeGTK::GetWidgetPadding(nsDeviceContext* aContext, switch (aAppearance) { case StyleAppearance::ButtonFocus: case StyleAppearance::Toolbarbutton: + case StyleAppearance::Tooltip: case StyleAppearance::MozWindowButtonBox: case StyleAppearance::MozWindowButtonClose: case StyleAppearance::MozWindowButtonMinimize: