Refactor Layout Manager
This commit is contained in:
parent
e00dec67ba
commit
96b293d1b5
28 changed files with 408 additions and 123 deletions
|
|
@ -5,14 +5,19 @@
|
|||
namespace tp {
|
||||
|
||||
class BasicLayout : public WidgetLayout {
|
||||
friend class DebugManager;
|
||||
|
||||
public:
|
||||
explicit BasicLayout(Widget* widget) : WidgetLayout(widget) {}
|
||||
|
||||
void pickRect() override;
|
||||
void updateLayout(bool vertical) override;
|
||||
|
||||
void pickRect(bool vertical) override;
|
||||
void clampRect() override;
|
||||
void adjustChildrenRect() override;
|
||||
[[nodiscard]] RectF getAvailableChildArea() const override;
|
||||
|
||||
void setLayoutPolicy(LayoutPolicy layout) { mLayoutPolicy = layout; }
|
||||
|
||||
private:
|
||||
void adjustLayout(bool vertical);
|
||||
static halnf changeChildSize(Widget*, halnf diff, bool vertical);
|
||||
|
|
@ -20,6 +25,6 @@ namespace tp {
|
|||
private:
|
||||
LayoutPolicy mLayoutPolicy = LayoutPolicy::Vertical;
|
||||
halnf mLayoutGap = 5;
|
||||
halnf mLayoutMargin = 10;
|
||||
halnf mLayoutMargin = 9;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue