diff --git a/headers/os/interface/LayoutBuilder.h b/headers/os/interface/LayoutBuilder.h index 10e639b6cf..83e8824b16 100644 --- a/headers/os/interface/LayoutBuilder.h +++ b/headers/os/interface/LayoutBuilder.h @@ -61,6 +61,9 @@ public: inline Group(BWindow* window, enum orientation orientation = B_HORIZONTAL, float spacing = B_USE_DEFAULT_SPACING); + inline Group(BView* view, + enum orientation orientation = B_HORIZONTAL, + float spacing = B_USE_DEFAULT_SPACING); inline Group(BGroupLayout* layout); inline Group(BGroupView* view); @@ -127,6 +130,9 @@ public: inline Grid(BWindow* window, float horizontal = B_USE_DEFAULT_SPACING, float vertical = B_USE_DEFAULT_SPACING); + inline Grid(BView* view, + float horizontal = B_USE_DEFAULT_SPACING, + float vertical = B_USE_DEFAULT_SPACING); inline Grid(BGridLayout* layout); inline Grid(BGridView* view); @@ -359,6 +365,18 @@ Group::Group(BWindow* window, enum orientation orientation, } +template +Group::Group(BView* view, enum orientation orientation, + float spacing) + : + fLayout(new BGroupLayout(orientation, spacing)) +{ + view->SetLayout(fLayout); + view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + // TODO: we get a white background if we don't do this +} + + template Group::Group(BGroupLayout* layout) : @@ -617,6 +635,18 @@ Grid::Grid(BWindow* window, float horizontalSpacing, } +template +Grid::Grid(BView* view, float horizontalSpacing, + float verticalSpacing) + : + fLayout(new BGridLayout(horizontalSpacing, verticalSpacing)) +{ + view->SetLayout(fLayout); + view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); + // TODO: we get a white background if we don't do this +} + + template Grid::Grid(BGridLayout* layout) :