From 1bfa46f230304cd7898b657fefcf512f1686ecbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 21 Jan 2015 10:03:54 +0100 Subject: [PATCH] BLayoutBuilder::Grid: added spacing setters. --- headers/os/interface/LayoutBuilder.h | 33 +++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/headers/os/interface/LayoutBuilder.h b/headers/os/interface/LayoutBuilder.h index 1de612016e..5f7c721834 100644 --- a/headers/os/interface/LayoutBuilder.h +++ b/headers/os/interface/LayoutBuilder.h @@ -1,5 +1,5 @@ /* - * Copyright 2009-2012, Haiku, Inc. All rights reserved. + * Copyright 2009-2015, Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. */ #ifndef _LAYOUT_BUILDER_H @@ -195,6 +195,10 @@ public: inline ThisBuilder& AddGlue(int32 column, int32 row, int32 columnCount = 1, int32 rowCount = 1); + inline ThisBuilder& SetHorizontalSpacing(float spacing); + inline ThisBuilder& SetVerticalSpacing(float spacing); + inline ThisBuilder& SetSpacing(float horizontal, float vertical); + inline ThisBuilder& SetColumnWeight(int32 column, float weight); inline ThisBuilder& SetRowWeight(int32 row, float weight); @@ -891,6 +895,33 @@ Grid::AddGlue(int32 column, int32 row, int32 columnCount, } +template +typename Grid::ThisBuilder& +Grid::SetHorizontalSpacing(float spacing) +{ + fLayout->SetHorizontalSpacing(spacing); + return *this; +} + + +template +typename Grid::ThisBuilder& +Grid::SetVerticalSpacing(float spacing) +{ + fLayout->SetVerticalSpacing(spacing); + return *this; +} + + +template +typename Grid::ThisBuilder& +Grid::SetSpacing(float horizontal, float vertical) +{ + fLayout->SetSpacing(horizontal, vertical); + return *this; +} + + template typename Grid::ThisBuilder& Grid::SetColumnWeight(int32 column, float weight)