Refactor of layout manager to add support for all menus (dirty unstable)

This commit is contained in:
IlyaShurupov 2024-10-20 12:07:16 +03:00
parent 23fe07d3d3
commit c57041a48e
21 changed files with 274 additions and 167 deletions

View file

@ -13,10 +13,8 @@ namespace tp {
}
void process(const EventHandler& events) override;
void draw(Canvas& canvas) override;
[[nodiscard]] bool needsNextFrame() const override;
[[nodiscard]] bool propagateEventsToChildren() const override;
@ -28,35 +26,4 @@ namespace tp {
FloatingLayout* layout();
[[nodiscard]] const FloatingLayout* layout() const;
};
class FloatingMenu : public FloatingWidget {
public:
FloatingMenu();
public:
void addToMenu(Widget* widget) {
widget->setSizePolicy(SizePolicy::Expanding, SizePolicy::Minimal);
mContentWidget.addChild(widget);
}
const List<Widget*>& getContent() {
return mContentWidget.getChildren();
}
void clearChildren() {
mContentWidget.clear();
}
void setText(const std::string& text);
private:
// VerticalLayout mMenuLayout;
Widget mBodyLayout;
Widget mContentWidget;
ScrollableBarWidget mScrollBar;
LabelWidget mHeader;
// ButtonWidget mTestButton;
};
}