mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
DatePicker: finished features
This commit is contained in:
parent
f75cedb893
commit
973ecac989
66 changed files with 1350 additions and 246 deletions
|
@ -3229,6 +3229,27 @@ fn compile_builtin_function_call(
|
|||
BuiltinFunction::ColorScheme => {
|
||||
format!("{}.color_scheme()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::MonthForDate => {
|
||||
format!("{}.month_for_date()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::MonthOffset => {
|
||||
format!("{}.month_offset()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::FormatDate => {
|
||||
format!("{}.format_date()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::DateNow => {
|
||||
format!("{}.date_now()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::WeekDaysShort => {
|
||||
format!("{}.week_days_short()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::ValidDate => {
|
||||
format!("{}.valid_date()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::ParseDate => {
|
||||
format!("{}.parse_date()", access_window_field(ctx))
|
||||
}
|
||||
BuiltinFunction::SetTextInputFocused => {
|
||||
format!("{}.set_text_input_focused({})", access_window_field(ctx), a.next().unwrap())
|
||||
}
|
||||
|
|
|
@ -2687,6 +2687,33 @@ fn compile_builtin_function_call(
|
|||
let window_adapter_tokens = access_window_adapter_field(ctx);
|
||||
quote!(sp::WindowInner::from_pub(#window_adapter_tokens.window()).color_scheme())
|
||||
}
|
||||
BuiltinFunction::MonthForDate => {
|
||||
let (m, y) = (a.next().unwrap(), a.next().unwrap());
|
||||
quote!(slint::private_unstable_api::month_for_date(#m as u32, #y as i32))
|
||||
}
|
||||
BuiltinFunction::MonthOffset => {
|
||||
let (m, y) = (a.next().unwrap(), a.next().unwrap());
|
||||
quote!(slint::private_unstable_api::month_offset(#m as u32, #y as i32))
|
||||
}
|
||||
BuiltinFunction::FormatDate => {
|
||||
let (f, d, m, y) =
|
||||
(a.next().unwrap(), a.next().unwrap(), a.next().unwrap(), a.next().unwrap());
|
||||
quote!(slint::private_unstable_api::format_date(&#f, #d as u32, #m as u32, #y as i32))
|
||||
}
|
||||
BuiltinFunction::ValidDate => {
|
||||
let (d, f) = (a.next().unwrap(), a.next().unwrap());
|
||||
quote!(slint::private_unstable_api::valid_date(#d.as_str(), #f.as_str()))
|
||||
}
|
||||
BuiltinFunction::ParseDate => {
|
||||
let (d, f) = (a.next().unwrap(), a.next().unwrap());
|
||||
quote!(slint::private_unstable_api::parse_date(#d.as_str(), #f.as_str()))
|
||||
}
|
||||
BuiltinFunction::WeekDaysShort => {
|
||||
quote!(slint::private_unstable_api::week_days_short())
|
||||
}
|
||||
BuiltinFunction::DateNow => {
|
||||
quote!(slint::private_unstable_api::date_now())
|
||||
}
|
||||
BuiltinFunction::TextInputFocused => {
|
||||
let window_adapter_tokens = access_window_adapter_field(ctx);
|
||||
quote!(sp::WindowInner::from_pub(#window_adapter_tokens.window()).text_input_focused())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue