mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Add an in-out boolean color-scheme property to Palette (#4701)
This allows applications to force dark/light mode, as well as determine which mode is active.
This commit is contained in:
parent
ccc92e6143
commit
68083243b2
48 changed files with 234 additions and 139 deletions
|
@ -3080,8 +3080,8 @@ fn compile_builtin_function_call(
|
|||
a = a.next().unwrap(),
|
||||
)
|
||||
}
|
||||
BuiltinFunction::DarkColorScheme => {
|
||||
format!("{}.dark_color_scheme()", access_window_field(ctx))
|
||||
BuiltinFunction::ColorScheme => {
|
||||
format!("{}.color_scheme()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::SetTextInputFocused => {
|
||||
format!("{}.set_text_input_focused({})", access_window_field(ctx), a.next().unwrap())
|
||||
|
|
|
@ -2538,9 +2538,9 @@ fn compile_builtin_function_call(
|
|||
sp::Color::from_argb_u8(a, r, g, b)
|
||||
})
|
||||
}
|
||||
BuiltinFunction::DarkColorScheme => {
|
||||
BuiltinFunction::ColorScheme => {
|
||||
let window_adapter_tokens = access_window_adapter_field(ctx);
|
||||
quote!(sp::WindowInner::from_pub(#window_adapter_tokens.window()).dark_color_scheme())
|
||||
quote!(sp::WindowInner::from_pub(#window_adapter_tokens.window()).color_scheme())
|
||||
}
|
||||
BuiltinFunction::TextInputFocused => {
|
||||
let window_adapter_tokens = access_window_adapter_field(ctx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue