mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Allow .darker and .brighter on Brush
This commit is contained in:
parent
c825eee228
commit
54a6cb22ee
8 changed files with 113 additions and 15 deletions
|
@ -109,12 +109,12 @@ impl BuiltinFunction {
|
|||
args: vec![Type::ElementReference],
|
||||
},
|
||||
BuiltinFunction::ColorBrighter => Type::Function {
|
||||
return_type: Box::new(Type::Color),
|
||||
args: vec![Type::Color, Type::Float32],
|
||||
return_type: Box::new(Type::Brush),
|
||||
args: vec![Type::Brush, Type::Float32],
|
||||
},
|
||||
BuiltinFunction::ColorDarker => Type::Function {
|
||||
return_type: Box::new(Type::Color),
|
||||
args: vec![Type::Color, Type::Float32],
|
||||
return_type: Box::new(Type::Brush),
|
||||
args: vec![Type::Brush, Type::Float32],
|
||||
},
|
||||
BuiltinFunction::ImageSize => Type::Function {
|
||||
return_type: Box::new(Type::Struct {
|
||||
|
|
|
@ -635,7 +635,7 @@ impl LookupObject for Expression {
|
|||
}
|
||||
Type::Component(c) => c.root_element.for_each_entry(ctx, f),
|
||||
Type::String => StringExpression(self).for_each_entry(ctx, f),
|
||||
Type::Color => ColorExpression(self).for_each_entry(ctx, f),
|
||||
Type::Brush | Type::Color => ColorExpression(self).for_each_entry(ctx, f),
|
||||
Type::Image => ImageExpression(self).for_each_entry(ctx, f),
|
||||
Type::Array(_) => ArrayExpression(self).for_each_entry(ctx, f),
|
||||
_ => None,
|
||||
|
@ -655,7 +655,7 @@ impl LookupObject for Expression {
|
|||
}),
|
||||
Type::Component(c) => c.root_element.lookup(ctx, name),
|
||||
Type::String => StringExpression(self).lookup(ctx, name),
|
||||
Type::Color => ColorExpression(self).lookup(ctx, name),
|
||||
Type::Brush | Type::Color => ColorExpression(self).lookup(ctx, name),
|
||||
Type::Image => ImageExpression(self).lookup(ctx, name),
|
||||
Type::Array(_) => ArrayExpression(self).lookup(ctx, name),
|
||||
_ => None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue