mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 07:37:24 +00:00
Simplify FemtoVG and Skia renderer API (#3153)
Fold show() into the first time render() is invoked, and hide() into the Drop implementation.
This commit is contained in:
parent
2a56e25788
commit
507428b03e
11 changed files with 59 additions and 116 deletions
|
@ -71,16 +71,11 @@ struct MyWindowAdapter : public slint_platform::WindowAdapter
|
|||
return slint::PhysicalSize({ uint32_t(r.right - r.left), uint32_t(r.bottom - r.top) });
|
||||
}
|
||||
|
||||
void show() const override
|
||||
{
|
||||
ShowWindow(hwnd, SW_SHOWNORMAL);
|
||||
m_renderer->show();
|
||||
}
|
||||
void show() const override { ShowWindow(hwnd, SW_SHOWNORMAL); }
|
||||
|
||||
void hide() const override
|
||||
{
|
||||
// TODO: destroy window
|
||||
m_renderer->hide();
|
||||
}
|
||||
|
||||
void request_redraw() const override { InvalidateRect(hwnd, nullptr, false); }
|
||||
|
|
|
@ -106,13 +106,8 @@ public:
|
|||
->dispatch_scale_factor_change_event(devicePixelRatio());
|
||||
auto window = const_cast<QWindow *>(static_cast<const QWindow *>(this));
|
||||
window->QWindow::show();
|
||||
m_renderer->show();
|
||||
}
|
||||
void hide() const override
|
||||
{
|
||||
m_renderer->hide();
|
||||
const_cast<MyWindow *>(this)->QWindow::hide();
|
||||
}
|
||||
void hide() const override { const_cast<MyWindow *>(this)->QWindow::hide(); }
|
||||
slint::PhysicalSize physical_size() const override
|
||||
{
|
||||
auto windowSize = slint::LogicalSize({ float(width()), float(height()) });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue