The BButton's have a max and min size which were previously ignore by ALM. Set an expicite button size to make the tests work after the last BALMLayout changes.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38770 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -17,6 +17,9 @@ public:
|
|||||||
button3 = new BButton("3");
|
button3 = new BButton("3");
|
||||||
button4 = new BButton("4");
|
button4 = new BButton("4");
|
||||||
|
|
||||||
|
button1->SetExplicitMinSize(BSize(0, 0));
|
||||||
|
button1->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
|
||||||
|
|
||||||
// create a new BALMLayout and use it for this window
|
// create a new BALMLayout and use it for this window
|
||||||
BALMLayout* layout = new BALMLayout();
|
BALMLayout* layout = new BALMLayout();
|
||||||
SetLayout(layout);
|
SetLayout(layout);
|
||||||
@@ -45,6 +48,7 @@ public:
|
|||||||
layout->Right(), y3,
|
layout->Right(), y3,
|
||||||
button3);
|
button3);
|
||||||
a3->SetHorizontalAlignment(B_ALIGN_HORIZONTAL_CENTER);
|
a3->SetHorizontalAlignment(B_ALIGN_HORIZONTAL_CENTER);
|
||||||
|
a3->SetVerticalAlignment(B_ALIGN_VERTICAL_CENTER);
|
||||||
a3->HasSameHeightAs(a1);
|
a3->HasSameHeightAs(a1);
|
||||||
|
|
||||||
Area* a4 = layout->AddArea(
|
Area* a4 = layout->AddArea(
|
||||||
|
|||||||
@@ -28,6 +28,13 @@ public:
|
|||||||
fLayout->Left(), fLayout->Top(),
|
fLayout->Left(), fLayout->Top(),
|
||||||
fLayout->Right(), fLayout->Bottom(),
|
fLayout->Right(), fLayout->Bottom(),
|
||||||
button1);
|
button1);
|
||||||
|
button1->SetExplicitMinSize(BSize(0, 50));
|
||||||
|
button1->SetExplicitMaxSize(BSize(500, 500));
|
||||||
|
|
||||||
|
// test size limits
|
||||||
|
BSize min = fLayout->MinSize();
|
||||||
|
BSize max = fLayout->MaxSize();
|
||||||
|
SetSizeLimits(min.Width(), max.Width(), min.Height(), max.Height());
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -24,6 +24,15 @@ public:
|
|||||||
textView1 = new BTextView("textView1");
|
textView1 = new BTextView("textView1");
|
||||||
textView1->SetText("5");
|
textView1->SetText("5");
|
||||||
|
|
||||||
|
button1->SetExplicitMinSize(BSize(0, 0));
|
||||||
|
button1->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
|
||||||
|
button2->SetExplicitMinSize(BSize(0, 0));
|
||||||
|
button2->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
|
||||||
|
button3->SetExplicitMinSize(BSize(0, 0));
|
||||||
|
button3->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
|
||||||
|
button4->SetExplicitMinSize(BSize(0, 0));
|
||||||
|
button4->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
|
||||||
|
|
||||||
// create a new BALMLayout and use it for this window
|
// create a new BALMLayout and use it for this window
|
||||||
BALMLayout* layout = new BALMLayout();
|
BALMLayout* layout = new BALMLayout();
|
||||||
SetLayout(layout);
|
SetLayout(layout);
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ public:
|
|||||||
BWindow(frame, "ALM Two Views", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE)
|
BWindow(frame, "ALM Two Views", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE)
|
||||||
{
|
{
|
||||||
button1 = new BButton("View 1");
|
button1 = new BButton("View 1");
|
||||||
|
button1->SetExplicitMinSize(BSize(0, 0));
|
||||||
|
button1->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
|
||||||
|
|
||||||
textView1 = new BTextView("textView1");
|
textView1 = new BTextView("textView1");
|
||||||
textView1->SetText("View 2");
|
textView1->SetText("View 2");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user