mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Add getter/setter for the style
This commit is contained in:
parent
59d6866b13
commit
fd9d154b27
3 changed files with 44 additions and 0 deletions
|
@ -469,6 +469,19 @@ public:
|
|||
cbindgen_private::sixtyfps_interpreter_component_compiler_set_include_paths(&inner, &paths);
|
||||
}
|
||||
|
||||
void set_style(std::string_view style)
|
||||
{
|
||||
cbindgen_private::sixtyfps_interpreter_component_compiler_set_style(
|
||||
&inner, sixtyfps::private_api::string_to_slice(style));
|
||||
}
|
||||
|
||||
sixtyfps::SharedString style() const
|
||||
{
|
||||
sixtyfps::SharedString s;
|
||||
cbindgen_private::sixtyfps_interpreter_component_compiler_get_style(&inner, &s);
|
||||
return s;
|
||||
}
|
||||
|
||||
sixtyfps::SharedVector<sixtyfps::SharedString> include_paths() const
|
||||
{
|
||||
sixtyfps::SharedVector<sixtyfps::SharedString> paths;
|
||||
|
|
|
@ -259,6 +259,13 @@ SCENARIO("Component Compiler")
|
|||
REQUIRE(out_paths[1] == "path2");
|
||||
}
|
||||
|
||||
SECTION("configure style")
|
||||
{
|
||||
REQUIRE(compiler.style() == "");
|
||||
compiler.set_style("ugly");
|
||||
REQUIRE(compiler.style() == "ugly");
|
||||
}
|
||||
|
||||
SECTION("Compile failure from source")
|
||||
{
|
||||
auto result = compiler.build_from_source("Syntax Error!!", "");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue