From 9f7de7f0775b86e3c82d4c5e3427a6f2fd98810b Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 7 Nov 2018 17:23:43 +0800 Subject: Improve layout system. --- src/main.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index ab641075..a15fa4da 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,7 +84,7 @@ int APIENTRY wWinMain( }); */ - /* + //test 2 const auto layout = CreateWithLayout(LayoutSideParams::Exactly(500), LayoutSideParams::Content()); @@ -112,7 +112,8 @@ int APIENTRY wWinMain( { const auto button = Button::Create(); - button->AddChild(MarginContainer::Create(Thickness(20, 5), { TextBlock::Create(L"button") })); + button->GetLayoutParams()->padding = Thickness(20, 5); + button->AddChild(TextBlock::Create(L"button")); layout->AddChild(button); } @@ -138,7 +139,6 @@ int APIENTRY wWinMain( window.AddChild(layout); - */ /* window.AddChild( @@ -149,6 +149,7 @@ int APIENTRY wWinMain( )); */ + /* test 3 const auto linear_layout = CreateWithLayout(Thickness(50, 50), Thickness(50, 50), LinearLayout::Orientation::Vertical, ControlList{ Button::Create({ TextBlock::Create(L"Button") @@ -159,6 +160,7 @@ int APIENTRY wWinMain( linear_layout->SetBordered(true); window.AddChild(linear_layout); + */ window.Show(); -- cgit v1.2.3