From ba6373e9aa2b75f4a6cc53ca996c4d8832280d63 Mon Sep 17 00:00:00 2001 From: Martin Stransky Date: Fri, 24 May 2019 08:51:48 +0000 Subject: [PATCH] Bug 1531338 - [Linux/Gtk] Get and use Gtk theme text color for active/pressed button, r=dao,emilio - Follow Gtk and get theme button text color directly from "button" CSS node instead of "button label" - Provide new -moz-gtk-buttonactivetext color for active/pressed button text color - Replace ButtonText color with -moz-gtk-buttonactivetext when it's appropriate Differential Revision: https://phabricator.services.mozilla.com/D30566 --HG-- extra : moz-landing-system : lando --- browser/themes/linux/places/organizer.css | 9 ++++--- layout/style/res/forms.css | 13 ++++++++++ .../style/properties/longhands/color.mako.rs | 1 + toolkit/themes/linux/global/button.css | 6 +++++ widget/LookAndFeel.h | 5 ++++ widget/gtk/nsLookAndFeel.cpp | 26 +++++++++++-------- widget/gtk/nsLookAndFeel.h | 1 + widget/nsXPLookAndFeel.cpp | 2 ++ 8 files changed, 49 insertions(+), 14 deletions(-) diff --git a/browser/themes/linux/places/organizer.css b/browser/themes/linux/places/organizer.css index 02f0563968cb..a8e757634ca3 100644 --- a/browser/themes/linux/places/organizer.css +++ b/browser/themes/linux/places/organizer.css @@ -64,12 +64,15 @@ -moz-appearance: toolbarbutton; } -#placesMenu > menu:active, -#placesMenu > menu:hover, -#placesMenu > menu[open] { +#placesMenu > menu:hover { color: ButtonText; } +#placesMenu > menu:active, +#placesMenu > menu[open] { + color: -moz-gtk-buttonactivetext; +} + #placesMenu > menu::after { content: ""; display: -moz-box; diff --git a/layout/style/res/forms.css b/layout/style/res/forms.css index be0d2e30c0fe..827a85a12731 100644 --- a/layout/style/res/forms.css +++ b/layout/style/res/forms.css @@ -244,6 +244,14 @@ select { overflow-clip-box: padding-box !important; /* bug 992447 */ } +%ifdef MOZ_WIDGET_GTK +/* Comboboxes use button styles on Gtk so it's safe to + * use a button style here. */ +select:active:hover { + color: -moz-gtk-buttonactivetext; +} +%endif + /* Need the "select[size][multiple]" selector to override the settings on 'select[size="1"]', eg if one has