* Add new SetInsets() methods to BTwoDimensionalLayout, BSplitView
* Also add equivalent methods to the layout builders in LayoutBuilder.h * BSplitView now calls BControlLook::ComposeSpacing(), instead of BSplitLayout * part of #7447 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42077 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
cd511790d7
commit
813147df83
|
@ -102,6 +102,8 @@ public:
|
|||
|
||||
inline ThisBuilder& SetInsets(float left, float top, float right,
|
||||
float bottom);
|
||||
inline ThisBuilder& SetInsets(float horizontal, float vertical);
|
||||
inline ThisBuilder& SetInsets(float insets);
|
||||
|
||||
inline operator BGroupLayout*();
|
||||
|
||||
|
@ -185,6 +187,8 @@ public:
|
|||
|
||||
inline ThisBuilder& SetInsets(float left, float top, float right,
|
||||
float bottom);
|
||||
inline ThisBuilder& SetInsets(float horizontal, float vertical);
|
||||
inline ThisBuilder& SetInsets(float insets);
|
||||
|
||||
inline operator BGridLayout*();
|
||||
|
||||
|
@ -246,6 +250,8 @@ public:
|
|||
|
||||
inline ThisBuilder& SetInsets(float left, float top, float right,
|
||||
float bottom);
|
||||
inline ThisBuilder& SetInsets(float horizontal, float vertical);
|
||||
inline ThisBuilder& SetInsets(float insets);
|
||||
|
||||
inline operator BSplitView*();
|
||||
|
||||
|
@ -562,6 +568,24 @@ Group<ParentBuilder>::SetInsets(float left, float top, float right,
|
|||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
typename Group<ParentBuilder>::ThisBuilder&
|
||||
Group<ParentBuilder>::SetInsets(float horizontal, float vertical)
|
||||
{
|
||||
fLayout->SetInsets(horizontal, vertical);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
typename Group<ParentBuilder>::ThisBuilder&
|
||||
Group<ParentBuilder>::SetInsets(float insets)
|
||||
{
|
||||
fLayout->SetInsets(insets);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
Group<ParentBuilder>::operator BGroupLayout*()
|
||||
{
|
||||
|
@ -807,6 +831,24 @@ Grid<ParentBuilder>::SetInsets(float left, float top, float right,
|
|||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
typename Grid<ParentBuilder>::ThisBuilder&
|
||||
Grid<ParentBuilder>::SetInsets(float horizontal, float vertical)
|
||||
{
|
||||
fLayout->SetInsets(horizontal, vertical);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
typename Grid<ParentBuilder>::ThisBuilder&
|
||||
Grid<ParentBuilder>::SetInsets(float insets)
|
||||
{
|
||||
fLayout->SetInsets(insets);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
Grid<ParentBuilder>::operator BGridLayout*()
|
||||
{
|
||||
|
@ -1012,6 +1054,24 @@ Split<ParentBuilder>::SetInsets(float left, float top, float right,
|
|||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
typename Split<ParentBuilder>::ThisBuilder&
|
||||
Split<ParentBuilder>::SetInsets(float horizontal, float vertical)
|
||||
{
|
||||
fView->SetInsets(horizontal, vertical);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
typename Split<ParentBuilder>::ThisBuilder&
|
||||
Split<ParentBuilder>::SetInsets(float insets)
|
||||
{
|
||||
fView->SetInsets(insets);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
template<typename ParentBuilder>
|
||||
Split<ParentBuilder>::operator BSplitView*()
|
||||
{
|
||||
|
|
|
@ -21,6 +21,8 @@ public:
|
|||
|
||||
void SetInsets(float left, float top, float right,
|
||||
float bottom);
|
||||
void SetInsets(float horizontal, float vertical);
|
||||
void SetInsets(float insets);
|
||||
void GetInsets(float* left, float* top,
|
||||
float* right, float* bottom) const;
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@ public:
|
|||
|
||||
void SetInsets(float left, float top, float right,
|
||||
float bottom);
|
||||
void SetInsets(float horizontal, float vertical);
|
||||
void SetInsets(float insets);
|
||||
void GetInsets(float* left, float* top, float* right,
|
||||
float* bottom) const;
|
||||
|
||||
|
|
|
@ -268,10 +268,10 @@ BSplitLayout::~BSplitLayout()
|
|||
void
|
||||
BSplitLayout::SetInsets(float left, float top, float right, float bottom)
|
||||
{
|
||||
fLeftInset = BControlLook::ComposeSpacing(left);
|
||||
fTopInset = BControlLook::ComposeSpacing(top);
|
||||
fRightInset = BControlLook::ComposeSpacing(right);
|
||||
fBottomInset = BControlLook::ComposeSpacing(bottom);
|
||||
fLeftInset = left;
|
||||
fTopInset = top;
|
||||
fRightInset = right;
|
||||
fBottomInset = bottom;
|
||||
|
||||
InvalidateLayout();
|
||||
}
|
||||
|
|
|
@ -41,10 +41,32 @@ BSplitView::~BSplitView()
|
|||
void
|
||||
BSplitView::SetInsets(float left, float top, float right, float bottom)
|
||||
{
|
||||
left = BControlLook::ComposeSpacing(left);
|
||||
top = BControlLook::ComposeSpacing(top);
|
||||
right = BControlLook::ComposeSpacing(right);
|
||||
bottom = BControlLook::ComposeSpacing(bottom);
|
||||
|
||||
fSplitLayout->SetInsets(left, top, right, bottom);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BSplitView::SetInsets(float horizontal, float vertical)
|
||||
{
|
||||
horizontal = BControlLook::ComposeSpacing(horizontal);
|
||||
vertical = BControlLook::ComposeSpacing(vertical);
|
||||
fSplitLayout->SetInsets(horizontal, vertical, horizontal, vertical);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BSplitView::SetInsets(float insets)
|
||||
{
|
||||
insets = BControlLook::ComposeSpacing(insets);
|
||||
fSplitLayout->SetInsets(insets, insets, insets, insets);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BSplitView::GetInsets(float* left, float* top, float* right,
|
||||
float* bottom) const
|
||||
|
|
|
@ -294,6 +294,31 @@ BTwoDimensionalLayout::SetInsets(float left, float top, float right,
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
BTwoDimensionalLayout::SetInsets(float horizontal, float vertical)
|
||||
{
|
||||
fLeftInset = BControlLook::ComposeSpacing(horizontal);
|
||||
fRightInset = fLeftInset;
|
||||
|
||||
fTopInset = BControlLook::ComposeSpacing(vertical);
|
||||
fBottomInset = fTopInset;
|
||||
|
||||
InvalidateLayout();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BTwoDimensionalLayout::SetInsets(float insets)
|
||||
{
|
||||
fLeftInset = BControlLook::ComposeSpacing(insets);
|
||||
fRightInset = fLeftInset;
|
||||
fTopInset = fLeftInset;
|
||||
fBottomInset = fLeftInset;
|
||||
|
||||
InvalidateLayout();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BTwoDimensionalLayout::GetInsets(float* left, float* top, float* right,
|
||||
float* bottom) const
|
||||
|
|
Loading…
Reference in New Issue