mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Make color-scheme affect Windows' non-native menus
This matches what Linux and macOS do, and that allows the fix for bug 1782623 to work on Windows for unstyled selects. This also simplifies the CSS (though it adds a new system color which is a bit more annoying). I filed https://github.com/w3c/csswg-drafts/issues/7561 to propose adding a more generic way to do this in the future (not just for Firefox). Differential Revision: https://phabricator.services.mozilla.com/D153549
This commit is contained in:
parent
f1e04f76f0
commit
befb407057
2 changed files with 5 additions and 12 deletions
|
@ -496,18 +496,8 @@ fn eval_moz_platform(_: &Context, query_value: Option<Platform>) -> bool {
|
|||
unsafe { bindings::Gecko_MediaFeatures_MatchesPlatform(query_value) }
|
||||
}
|
||||
|
||||
fn eval_moz_windows_non_native_menus(context: &Context) -> bool {
|
||||
let use_non_native_menus = match static_prefs::pref!("browser.display.windows.non_native_menus")
|
||||
{
|
||||
0 => false,
|
||||
1 => true,
|
||||
_ => {
|
||||
eval_moz_platform(context, Some(Platform::WindowsWin10)) &&
|
||||
get_lnf_int_as_bool(bindings::LookAndFeel_IntID::WindowsDefaultTheme as i32)
|
||||
},
|
||||
};
|
||||
|
||||
use_non_native_menus
|
||||
fn eval_moz_windows_non_native_menus(_: &Context) -> bool {
|
||||
unsafe { bindings::Gecko_MediaFeatures_WindowsNonNativeMenus() }
|
||||
}
|
||||
|
||||
fn eval_moz_overlay_scrollbars(context: &Context) -> bool {
|
||||
|
|
|
@ -198,6 +198,9 @@ pub enum SystemColor {
|
|||
MozButtonhovertext,
|
||||
/// Used for menu item backgrounds when hovered.
|
||||
MozMenuhover,
|
||||
/// Used for menu item backgrounds when hovered and disabled.
|
||||
#[parse(condition = "ParserContext::in_ua_or_chrome_sheet")]
|
||||
MozMenuhoverdisabled,
|
||||
/// Used for menu item text when hovered.
|
||||
MozMenuhovertext,
|
||||
/// Used for menubar item text.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue