2023-08-19 19:56:36 +08:00
|
|
|
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
|
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
|
|
// the LICENSE file.
|
2021-12-12 00:58:25 +08:00
|
|
|
#include "ftxui/dom/flexbox_config.hpp"
|
|
|
|
|
|
|
|
namespace ftxui {
|
|
|
|
|
2023-08-19 20:56:28 +08:00
|
|
|
/// @brief Set the flexbox direction.
|
2021-12-12 00:58:25 +08:00
|
|
|
FlexboxConfig& FlexboxConfig::Set(FlexboxConfig::Direction d) {
|
|
|
|
this->direction = d;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2023-08-19 20:56:28 +08:00
|
|
|
/// @brief Set the flexbox wrap.
|
2021-12-12 00:58:25 +08:00
|
|
|
FlexboxConfig& FlexboxConfig::Set(FlexboxConfig::Wrap w) {
|
|
|
|
this->wrap = w;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2023-08-19 20:56:28 +08:00
|
|
|
/// @brief Set the flexbox justify content.
|
2021-12-12 00:58:25 +08:00
|
|
|
FlexboxConfig& FlexboxConfig::Set(FlexboxConfig::JustifyContent j) {
|
|
|
|
this->justify_content = j;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2023-08-19 20:56:28 +08:00
|
|
|
/// @brief Set the flexbox align items.
|
2021-12-12 00:58:25 +08:00
|
|
|
FlexboxConfig& FlexboxConfig::Set(FlexboxConfig::AlignItems a) {
|
|
|
|
this->align_items = a;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2023-08-19 20:56:28 +08:00
|
|
|
/// @brief Set the flexbox align content.
|
2021-12-12 00:58:25 +08:00
|
|
|
FlexboxConfig& FlexboxConfig::Set(FlexboxConfig::AlignContent a) {
|
|
|
|
this->align_content = a;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
2023-08-19 20:56:28 +08:00
|
|
|
/// @brief Set the flexbox flex direction.
|
2021-12-12 00:58:25 +08:00
|
|
|
FlexboxConfig& FlexboxConfig::SetGap(int x, int y) {
|
|
|
|
this->gap_x = x;
|
|
|
|
this->gap_y = y;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace ftxui
|