diff --git a/headers/libs/alm/Area.h b/headers/libs/alm/Area.h index 1874d5d3a3..dd99241940 100644 --- a/headers/libs/alm/Area.h +++ b/headers/libs/alm/Area.h @@ -65,10 +65,6 @@ public: void SetRightInset(int32 right); void SetBottomInset(int32 bottom); - void SetDefaultBehavior(); - bool AutoPreferredContentSize() const; - void SetAutoPreferredContentSize(bool value); - operator BString() const; void GetString(BString& string) const; @@ -114,7 +110,6 @@ private: Constraint* fMaxContentWidth; Constraint* fMinContentHeight; Constraint* fMaxContentHeight; - bool fAutoPreferredContentSize; Constraint* fPreferredContentWidth; Constraint* fPreferredContentHeight; double fContentAspectRatio; diff --git a/src/libs/alm/ALMLayout.cpp b/src/libs/alm/ALMLayout.cpp index b26fbdb276..cb8adecc78 100644 --- a/src/libs/alm/ALMLayout.cpp +++ b/src/libs/alm/ALMLayout.cpp @@ -310,8 +310,6 @@ BALMLayout::AddItem(BLayoutItem* item, XTab* left, YTab* top, XTab* right, return NULL; area->_Init(&fSolver, left, top, right, bottom); - area->SetDefaultBehavior(); - area->SetAutoPreferredContentSize(false); return area; } @@ -326,8 +324,6 @@ BALMLayout::AddItem(BLayoutItem* item, Row* row, Column* column) return NULL; area->_Init(&fSolver, row, column); - area->SetDefaultBehavior(); - area->SetAutoPreferredContentSize(false); return area; } @@ -631,14 +627,6 @@ BALMLayout::_CreateLayoutItem(BView* view) void BALMLayout::_SolveLayout() { - // if autoPreferredContentSize is set on an area, - // readjust its preferredContentSize and penalties settings - for (int32 i = 0; i < CountItems(); i++) { - Area* currentArea = _AreaForItem(ItemAt(i)); - if (currentArea && currentArea->AutoPreferredContentSize()) - currentArea->SetDefaultBehavior(); - } - // Try to solve the layout until the result is OPTIMAL or INFEASIBLE, // maximally 15 tries sometimes the solving algorithm encounters numerical // problems (NUMFAILURE), and repeating the solving often helps to overcome diff --git a/src/libs/alm/Area.cpp b/src/libs/alm/Area.cpp index 49b2994429..e65b6894c0 100644 --- a/src/libs/alm/Area.cpp +++ b/src/libs/alm/Area.cpp @@ -29,30 +29,6 @@ Area::View() } -/** - * Gets the auto preferred content size. - * - * @return the auto preferred content size - */ -bool -Area::AutoPreferredContentSize() const -{ - return fAutoPreferredContentSize; -} - - -/** - * Sets the auto preferred content size true or false. - * - * @param value the auto preferred content size - */ -void -Area::SetAutoPreferredContentSize(bool value) -{ - fAutoPreferredContentSize = value; -} - - /** * Gets the left tab of the area. * @@ -407,34 +383,6 @@ Area::SetBottomInset(int32 bottom) } -/** - * Sets the preferred size according to the content's PreferredSize method, - * and the penalties according to heuristics. - */ -void -Area::SetDefaultBehavior() -{ - if (View() == NULL) { - SetShrinkPenalties(BSize(0, 0)); - SetGrowPenalties(BSize(0, 0)); - return; - } - - if (dynamic_cast(View()) != NULL - || dynamic_cast(View()) != NULL - || dynamic_cast(View()) != NULL - || dynamic_cast(View()) != NULL - || dynamic_cast(View()) != NULL - || dynamic_cast(View()) != NULL) { - fShrinkPenalties = BSize(4, 4); - fGrowPenalties = BSize(3, 3); - } else { - fShrinkPenalties = BSize(2, 2); - fGrowPenalties = BSize(1, 1); - } -} - - Area::operator BString() const { BString string; @@ -533,12 +481,17 @@ Area::Area(BLayoutItem* item) fRow(NULL), fColumn(NULL), + fShrinkPenalties(2, 2), + fGrowPenalties(1, 1), + fMinContentWidth(NULL), fMaxContentWidth(NULL), fMinContentHeight(NULL), fMaxContentHeight(NULL), fPreferredContentWidth(NULL), fPreferredContentHeight(NULL), + + fContentAspectRatio(0), fContentAspectRatioC(NULL) { @@ -551,12 +504,6 @@ Area::Area(BLayoutItem* item) void Area::_Init(LinearSpec* ls, XTab* left, YTab* top, XTab* right, YTab* bottom) { - fShrinkPenalties = BSize(2, 2); - fGrowPenalties = BSize(1, 1); - fContentAspectRatio = 0; - - fAutoPreferredContentSize = false; - fLS = ls; fLeft = left; fRight = right;