Add is_visible to NodeJS and C++ Window types (#1816)

Amends commit 82278a5742
This commit is contained in:
Simon Hausmann 2022-11-04 16:24:24 +01:00 committed by GitHub
parent 405b9deb2d
commit e9db914fb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 104 additions and 2 deletions

View file

@ -113,6 +113,7 @@ public:
void show() const { slint_windowrc_show(&inner); }
void hide() const { slint_windowrc_hide(&inner); }
bool is_visible() const { return slint_windowrc_is_visible(&inner); }
float scale_factor() const { return slint_windowrc_get_scale_factor(&inner); }
void set_scale_factor(float value) const { slint_windowrc_set_scale_factor(&inner, value); }
@ -406,6 +407,10 @@ public:
/// De-registers the window from the windowing system, therefore hiding it.
void hide() { inner.hide(); }
/// Returns the visibility state of the window. This function can return false even if you
/// previously called show() on it, for example if the user minimized the window.
bool is_visible() const { return inner.is_visible(); }
/// This function allows registering a callback that's invoked during the different phases of
/// rendering. This allows custom rendering on top or below of the scene.
/// On success, the function returns a std::optional without value. On error, the function