mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
Add C++ Value Brush support
This commit is contained in:
parent
a4837207e6
commit
e539d03007
3 changed files with 41 additions and 2 deletions
|
@ -101,4 +101,16 @@ SCENARIO("Value API")
|
|||
REQUIRE(extracted_array[0].to_number().value() == 42);
|
||||
REQUIRE(extracted_array[1].to_bool().value());
|
||||
}
|
||||
|
||||
SECTION("Construct a brush")
|
||||
{
|
||||
REQUIRE(!value.to_brush().has_value());
|
||||
sixtyfps::Brush brush(sixtyfps::Color::from_rgb_uint8(255, 0, 255));
|
||||
value = Value(brush);
|
||||
REQUIRE(value.type() == Value::Type::Brush);
|
||||
|
||||
auto brush_opt = value.to_brush();
|
||||
REQUIRE(brush_opt.has_value());
|
||||
REQUIRE(brush_opt.value() == brush);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue