mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
Add a clear-focus()
function on all elements that have a focus()
function
This is the counter-part, which removes focus from the element if it's currently focused. The window - if focused - may still be focused towards the windowing system.
This commit is contained in:
parent
e10e97c944
commit
31767eb6ab
21 changed files with 268 additions and 23 deletions
|
@ -38,6 +38,7 @@ pub enum BuiltinFunction {
|
|||
Log,
|
||||
Pow,
|
||||
SetFocusItem,
|
||||
ClearFocusItem,
|
||||
ShowPopupWindow,
|
||||
ClosePopupWindow,
|
||||
SetSelectionOffsets,
|
||||
|
@ -133,6 +134,10 @@ impl BuiltinFunction {
|
|||
return_type: Box::new(Type::Void),
|
||||
args: vec![Type::ElementReference],
|
||||
},
|
||||
BuiltinFunction::ClearFocusItem => Type::Function {
|
||||
return_type: Box::new(Type::Void),
|
||||
args: vec![Type::ElementReference],
|
||||
},
|
||||
BuiltinFunction::ShowPopupWindow | BuiltinFunction::ClosePopupWindow => {
|
||||
Type::Function {
|
||||
return_type: Box::new(Type::Void),
|
||||
|
@ -292,7 +297,7 @@ impl BuiltinFunction {
|
|||
| BuiltinFunction::Log
|
||||
| BuiltinFunction::Pow
|
||||
| BuiltinFunction::ATan => true,
|
||||
BuiltinFunction::SetFocusItem => false,
|
||||
BuiltinFunction::SetFocusItem | BuiltinFunction::ClearFocusItem => false,
|
||||
BuiltinFunction::ShowPopupWindow | BuiltinFunction::ClosePopupWindow => false,
|
||||
BuiltinFunction::SetSelectionOffsets => false,
|
||||
BuiltinFunction::ItemMemberFunction(..) => false,
|
||||
|
@ -349,7 +354,7 @@ impl BuiltinFunction {
|
|||
| BuiltinFunction::Log
|
||||
| BuiltinFunction::Pow
|
||||
| BuiltinFunction::ATan => true,
|
||||
BuiltinFunction::SetFocusItem => false,
|
||||
BuiltinFunction::SetFocusItem | BuiltinFunction::ClearFocusItem => false,
|
||||
BuiltinFunction::ShowPopupWindow | BuiltinFunction::ClosePopupWindow => false,
|
||||
BuiltinFunction::SetSelectionOffsets => false,
|
||||
BuiltinFunction::ItemMemberFunction(..) => false,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue