Use the AlignInFrame BLayoutItem function to do the item alignment. The child area is not needed any more.
Don't leak the fConstraints list. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38775 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -60,10 +60,10 @@ public:
|
||||
LayoutStyleType LayoutStyle() const;
|
||||
void SetLayoutStyle(LayoutStyleType style);
|
||||
|
||||
BSize BaseMinSize();
|
||||
BSize BaseMaxSize();
|
||||
BSize BasePreferredSize();
|
||||
BAlignment BaseAlignment();
|
||||
virtual BSize BaseMinSize();
|
||||
virtual BSize BaseMaxSize();
|
||||
virtual BSize BasePreferredSize();
|
||||
virtual BAlignment BaseAlignment();
|
||||
|
||||
virtual void InvalidateLayout(bool children = false);
|
||||
|
||||
|
||||
+26
-34
@@ -56,12 +56,6 @@ public:
|
||||
double ContentAspectRatio() const;
|
||||
void SetContentAspectRatio(double ratio);
|
||||
|
||||
void SetExplicitAlignment(BAlignment alignment);
|
||||
|
||||
void SetHorizontalAlignment(alignment horizontal);
|
||||
void SetVerticalAlignment(
|
||||
vertical_alignment vertical);
|
||||
|
||||
BSize ShrinkPenalties() const;
|
||||
void SetShrinkPenalties(BSize shrink);
|
||||
BSize GrowPenalties() const;
|
||||
@@ -90,7 +84,7 @@ public:
|
||||
void InvalidateSizeConstraints();
|
||||
|
||||
protected:
|
||||
Area(BALMLayout* layout, BLayoutItem* item);
|
||||
Area(BLayoutItem* item);
|
||||
|
||||
void Init(LinearSpec* ls, XTab* left, YTab* top,
|
||||
XTab* right, YTab* bottom, BView* content,
|
||||
@@ -101,53 +95,51 @@ protected:
|
||||
void DoLayout();
|
||||
|
||||
private:
|
||||
void _InitChildArea();
|
||||
void _UpdateHorizontal();
|
||||
void _UpdateVertical();
|
||||
|
||||
void _UpdateMinSizeConstraint(BSize min);
|
||||
void _UpdateMaxSizeConstraint(BSize max);
|
||||
void _UpdatePreferredConstraint(BSize preferred);
|
||||
|
||||
protected:
|
||||
BList* fConstraints;
|
||||
BList fConstraints;
|
||||
|
||||
private:
|
||||
// TODO remove the layout pointer when making Area a LayoutItem
|
||||
BALMLayout* fALMLayout;
|
||||
BLayoutItem* fLayoutItem;
|
||||
|
||||
LinearSpec* fLS;
|
||||
|
||||
XTab* fLeft;
|
||||
XTab* fRight;
|
||||
YTab* fTop;
|
||||
YTab* fBottom;
|
||||
Row* fRow;
|
||||
Column* fColumn;
|
||||
Constraint* fMinContentWidth;
|
||||
Constraint* fMaxContentWidth;
|
||||
Constraint* fMinContentHeight;
|
||||
Constraint* fMaxContentHeight;
|
||||
BSize fShrinkPenalties;
|
||||
BSize fGrowPenalties;
|
||||
double fContentAspectRatio;
|
||||
Constraint* fContentAspectRatioC;
|
||||
bool fAutoPreferredContentSize;
|
||||
Constraint* fPreferredContentWidth;
|
||||
Constraint* fPreferredContentHeight;
|
||||
Area* fChildArea;
|
||||
BAlignment fAlignment;
|
||||
int32 fLeftInset;
|
||||
int32 fTopInset;
|
||||
int32 fRightInset;
|
||||
int32 fBottomInset;
|
||||
Constraint* fLeftConstraint;
|
||||
Constraint* fTopConstraint;
|
||||
Constraint* fRightConstraint;
|
||||
Constraint* fBottomConstraint;
|
||||
|
||||
Constraint* fMinContentWidth;
|
||||
Constraint* fMaxContentWidth;
|
||||
Constraint* fMinContentHeight;
|
||||
Constraint* fMaxContentHeight;
|
||||
bool fAutoPreferredContentSize;
|
||||
Constraint* fPreferredContentWidth;
|
||||
Constraint* fPreferredContentHeight;
|
||||
|
||||
double fContentAspectRatio;
|
||||
Constraint* fContentAspectRatioC;
|
||||
|
||||
Row* fRow;
|
||||
Column* fColumn;
|
||||
|
||||
BSize fShrinkPenalties;
|
||||
BSize fGrowPenalties;
|
||||
|
||||
int32 fLeftInset;
|
||||
int32 fTopInset;
|
||||
int32 fRightInset;
|
||||
int32 fBottomInset;
|
||||
|
||||
public:
|
||||
//friend class BALMLayout;
|
||||
friend class BALMLayout;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user