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

@ -496,6 +496,10 @@ public:
/// a window frame (if present).
void set_size(const slint::PhysicalSize &size) { inner.set_physical_size(size); }
/// This function returns the scale factor that allows converting between logical and
/// physical pixels.
float scale_factor() const { return inner.scale_factor(); }
/// Dispatch a key press event to the scene.
///
/// Use this when you're implementing your own backend and want to forward user input events.