* Fixed Group(BWindow*, ...) and Grid(BWindow*, ...) constructors to no longer
leak a view. * Also set the view's background color to B_PANEL_BACKGROUND_COLOR to make this better usable in applications. * Removed the admittedly useless Group(BView*, ...) constructor I introduced earlier. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36723 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2009, Haiku, Inc. All rights reserved.
|
* Copyright 2009-2010, Haiku, Inc. All rights reserved.
|
||||||
* Distributed under the terms of the MIT License.
|
* Distributed under the terms of the MIT License.
|
||||||
*/
|
*/
|
||||||
#ifndef _LAYOUT_BUILDER_H
|
#ifndef _LAYOUT_BUILDER_H
|
||||||
@@ -56,9 +56,6 @@ public:
|
|||||||
inline Group(BWindow* window,
|
inline Group(BWindow* window,
|
||||||
enum orientation orientation = B_HORIZONTAL,
|
enum orientation orientation = B_HORIZONTAL,
|
||||||
float spacing = 0.0f);
|
float spacing = 0.0f);
|
||||||
inline Group(BView* window,
|
|
||||||
enum orientation orientation = B_HORIZONTAL,
|
|
||||||
float spacing = 0.0f);
|
|
||||||
inline Group(BGroupLayout* layout);
|
inline Group(BGroupLayout* layout);
|
||||||
inline Group(BGroupView* view);
|
inline Group(BGroupView* view);
|
||||||
|
|
||||||
@@ -243,19 +240,12 @@ template<typename ParentBuilder>
|
|||||||
Group<ParentBuilder>::Group(BWindow* window, enum orientation orientation,
|
Group<ParentBuilder>::Group(BWindow* window, enum orientation orientation,
|
||||||
float spacing)
|
float spacing)
|
||||||
:
|
:
|
||||||
fLayout((new BGroupView(orientation, spacing))->GroupLayout())
|
fLayout(new BGroupLayout(orientation, spacing))
|
||||||
{
|
{
|
||||||
window->SetLayout(fLayout);
|
window->SetLayout(fLayout);
|
||||||
}
|
|
||||||
|
|
||||||
|
fLayout->View()->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
template<typename ParentBuilder>
|
// TODO: we get a white background if we don't do this
|
||||||
Group<ParentBuilder>::Group(BView* view, enum orientation orientation,
|
|
||||||
float spacing)
|
|
||||||
:
|
|
||||||
fLayout((new BGroupView(orientation, spacing))->GroupLayout())
|
|
||||||
{
|
|
||||||
view->SetLayout(fLayout);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -442,9 +432,12 @@ template<typename ParentBuilder>
|
|||||||
Grid<ParentBuilder>::Grid(BWindow* window, float horizontalSpacing,
|
Grid<ParentBuilder>::Grid(BWindow* window, float horizontalSpacing,
|
||||||
float verticalSpacing)
|
float verticalSpacing)
|
||||||
:
|
:
|
||||||
fLayout((new BGridView(horizontalSpacing, verticalSpacing))->GridLayout())
|
fLayout(new BGridLayout(horizontalSpacing, verticalSpacing))
|
||||||
{
|
{
|
||||||
window->SetLayout(fLayout);
|
window->SetLayout(fLayout);
|
||||||
|
|
||||||
|
fLayout->View()->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
// TODO: we get a white background if we don't do this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user