Added convenience methods to allow a group or grid layout's insets to be set
while it is being built. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20026 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
d09c0ef980
commit
e3e76a3af9
@ -28,6 +28,9 @@ public:
|
||||
BGridLayoutBuilder& SetColumnWeight(int32 column, float weight);
|
||||
BGridLayoutBuilder& SetRowWeight(int32 row, float weight);
|
||||
|
||||
BGridLayoutBuilder& SetInsets(float left, float top, float right,
|
||||
float bottom);
|
||||
|
||||
operator BGridLayout*();
|
||||
operator BView*();
|
||||
|
||||
|
@ -34,6 +34,9 @@ public:
|
||||
BGroupLayoutBuilder& AddGlue(float weight = 1.0f);
|
||||
BGroupLayoutBuilder& AddStrut(float size);
|
||||
|
||||
BGroupLayoutBuilder& SetInsets(float left, float top, float right,
|
||||
float bottom);
|
||||
|
||||
operator BGroupLayout*();
|
||||
operator BView*();
|
||||
|
||||
|
@ -98,6 +98,14 @@ BGridLayoutBuilder::SetRowWeight(int32 row, float weight)
|
||||
return *this;
|
||||
}
|
||||
|
||||
// SetInsets
|
||||
BGridLayoutBuilder&
|
||||
BGridLayoutBuilder::SetInsets(float left, float top, float right, float bottom)
|
||||
{
|
||||
fLayout->SetInsets(left, top, right, bottom);
|
||||
return *this;
|
||||
}
|
||||
|
||||
// cast operator BGridLayout*
|
||||
BGridLayoutBuilder::operator BGridLayout*()
|
||||
{
|
||||
|
@ -158,6 +158,16 @@ BGroupLayoutBuilder::AddStrut(float size)
|
||||
return *this;
|
||||
}
|
||||
|
||||
// SetInsets
|
||||
BGroupLayoutBuilder&
|
||||
BGroupLayoutBuilder::SetInsets(float left, float top, float right, float bottom)
|
||||
{
|
||||
if (BGroupLayout* layout = TopLayout())
|
||||
layout->SetInsets(left, top, right, bottom);
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// cast operator BGroupLayout*
|
||||
BGroupLayoutBuilder::operator BGroupLayout*()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user