From 85837167feba94005a39d90d7241dfe53e537748 Mon Sep 17 00:00:00 2001 From: Andrea Blankenstijn Date: Thu, 12 Aug 2021 16:06:33 +0200 Subject: [PATCH] fix: layout didn't call Widget constructor. --- inc/basic_widgets/w/aligned_layout.hpp | 2 +- inc/basic_widgets/w/base/layout.hpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/inc/basic_widgets/w/aligned_layout.hpp b/inc/basic_widgets/w/aligned_layout.hpp index cae76dd..47b461e 100644 --- a/inc/basic_widgets/w/aligned_layout.hpp +++ b/inc/basic_widgets/w/aligned_layout.hpp @@ -17,7 +17,7 @@ namespace bwidgets VERTICAL } alignment; - AlignedLayout(Alignment align) noexcept : alignment(align) {} + AlignedLayout(Alignment align, Widget* p = nullptr) noexcept : Layout(p), alignment(align) {} [[nodiscard]] auto size() const noexcept -> Size override; }; diff --git a/inc/basic_widgets/w/base/layout.hpp b/inc/basic_widgets/w/base/layout.hpp index 9509a9b..bcfc878 100644 --- a/inc/basic_widgets/w/base/layout.hpp +++ b/inc/basic_widgets/w/base/layout.hpp @@ -30,6 +30,8 @@ namespace bwidgets Size margins = default_margins; + Layout(Widget* p = nullptr) : Widget(p) {} + auto handle_event(const SDL_Event&) -> Layout* override; [[nodiscard]] auto size() const noexcept -> Size override = 0;