fix container inside resizablesplit

This commit is contained in:
na-trium-144 2024-04-16 18:57:31 +09:00 committed by ArthurSonzogni
parent e03a0797be
commit 66cff103bd
No known key found for this signature in database
GPG Key ID: 41D98248C074CD6C

View File

@ -23,10 +23,32 @@ class ResizableSplitBase : public ComponentBase {
public: public:
explicit ResizableSplitBase(ResizableSplitOption options) explicit ResizableSplitBase(ResizableSplitOption options)
: options_(std::move(options)) { : options_(std::move(options)) {
Add(Container::Horizontal({ switch (options_->direction()) {
options_->main, case Direction::Left:
options_->back, Add(Container::Horizontal({
})); options_->main,
options_->back,
}));
break;
case Direction::Right:
Add(Container::Horizontal({
options_->back,
options_->main,
}));
break;
case Direction::Up:
Add(Container::Vertical({
options_->main,
options_->back,
}));
break;
case Direction::Down:
Add(Container::Vertical({
options_->back,
options_->main,
}));
break;
}
} }
bool OnEvent(Event event) final { bool OnEvent(Event event) final {