feat(ui): handle window resize in ScreenshotUI

This commit is contained in:
2026-08-07 14:37:19 +08:00
parent ef0fc7c5c0
commit 4e5a8d7dea
2 changed files with 9 additions and 1 deletions

View File

@@ -13,11 +13,13 @@ public:
ScreenshotUI& operator=(const ScreenshotUI&) = delete; ScreenshotUI& operator=(const ScreenshotUI&) = delete;
ScreenshotUI& operator=(ScreenshotUI&&) = delete; ScreenshotUI& operator=(ScreenshotUI&&) = delete;
void init(); void init() override;
void update_layout(int width, int height); void update_layout(int width, int height);
private: private:
bool handle_window_resize_event(const WindowResizeEvent& e) override;
ScreenshotScene& m_scene; ScreenshotScene& m_scene;
}; };
} // namespace Cubed } // namespace Cubed

View File

@@ -114,4 +114,10 @@ void ScreenshotUI::update_layout(int width, int height) {
m_root_widget = std::move(bg); m_root_widget = std::move(bg);
} }
bool ScreenshotUI::handle_window_resize_event(const WindowResizeEvent& e) {
update_layout(e.width, e.height);
return UIManager::handle_window_resize_event(e);
}
} // namespace Cubed } // namespace Cubed