mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
feat(ui): handle window resize in ScreenshotUI
This commit is contained in:
@@ -13,11 +13,13 @@ public:
|
||||
ScreenshotUI& operator=(const ScreenshotUI&) = delete;
|
||||
ScreenshotUI& operator=(ScreenshotUI&&) = delete;
|
||||
|
||||
void init();
|
||||
void init() override;
|
||||
|
||||
void update_layout(int width, int height);
|
||||
|
||||
private:
|
||||
bool handle_window_resize_event(const WindowResizeEvent& e) override;
|
||||
|
||||
ScreenshotScene& m_scene;
|
||||
};
|
||||
} // namespace Cubed
|
||||
@@ -114,4 +114,10 @@ void ScreenshotUI::update_layout(int width, int height) {
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user