C++: Add slint::Window::scale_factor() getter (#3004)

Fixes #3003
This commit is contained in:
Simon Hausmann 2023-06-28 13:24:40 +02:00 committed by GitHub
parent a0dd643d83
commit 83ccd07a88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View file

@ -28,3 +28,19 @@ TEST_CASE("Basic Window Visibility")
instance->hide();
REQUIRE(instance->window().is_visible() == false);
}
TEST_CASE("Window Scale Factory Existence")
{
using namespace slint::interpreter;
using namespace slint;
ComponentCompiler compiler;
auto comp_def = compiler.build_from_source(R"(
export App := Window {
}
)",
"");
REQUIRE(comp_def.has_value());
auto instance = comp_def->create();
REQUIRE(instance->window().scale_factor() > 0);
}