mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
style: Use GTK menu radius on native context menus and panels
Differential Revision: https://phabricator.services.mozilla.com/D129439
This commit is contained in:
parent
9868cd52ba
commit
1b04838278
2 changed files with 13 additions and 1 deletions
|
@ -75,8 +75,13 @@ fn get_titlebar_radius(device: &Device) -> VariableValue {
|
||||||
VariableValue::pixel(device.titlebar_radius())
|
VariableValue::pixel(device.titlebar_radius())
|
||||||
}
|
}
|
||||||
|
|
||||||
static CHROME_ENVIRONMENT_VARIABLES: [EnvironmentVariable; 1] = [
|
fn get_menu_radius(device: &Device) -> VariableValue {
|
||||||
|
VariableValue::pixel(device.menu_radius())
|
||||||
|
}
|
||||||
|
|
||||||
|
static CHROME_ENVIRONMENT_VARIABLES: [EnvironmentVariable; 2] = [
|
||||||
make_variable!(atom!("-moz-gtk-csd-titlebar-radius"), get_titlebar_radius),
|
make_variable!(atom!("-moz-gtk-csd-titlebar-radius"), get_titlebar_radius),
|
||||||
|
make_variable!(atom!("-moz-gtk-menu-radius"), get_menu_radius),
|
||||||
];
|
];
|
||||||
|
|
||||||
impl CssEnvironment {
|
impl CssEnvironment {
|
||||||
|
|
|
@ -447,6 +447,13 @@ impl Device {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Returns the gtk menu radius in CSS pixels.
|
||||||
|
pub fn menu_radius(&self) -> f32 {
|
||||||
|
unsafe {
|
||||||
|
bindings::Gecko_GetLookAndFeelInt(bindings::LookAndFeel_IntID::GtkMenuRadius as i32) as f32
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Return whether the document is a chrome document.
|
/// Return whether the document is a chrome document.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_chrome_document(&self) -> bool {
|
pub fn is_chrome_document(&self) -> bool {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue