mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-23 11:17:06 +08:00
602392c43d
This implement the flexbox elements, following the HTML one. Built from them, there is also the following elements: - `paragraph` - `paragraphAlignLeft` - `paragraphAlignRight` - `paragraphAlignCenter` - `paragraphAlignJustify` This is a breaking change.
36 lines
814 B
C++
36 lines
814 B
C++
#ifndef FTXUI_DOM_REQUIREMENT_HPP
|
|
#define FTXUI_DOM_REQUIREMENT_HPP
|
|
|
|
#include "ftxui/screen/box.hpp"
|
|
|
|
namespace ftxui {
|
|
|
|
struct Requirement {
|
|
// The required size to fully draw the element.
|
|
int min_x = 0;
|
|
int min_y = 0;
|
|
|
|
// How much flexibility is given to the component.
|
|
int flex_grow_x = 0;
|
|
int flex_grow_y = 0;
|
|
int flex_shrink_x = 0;
|
|
int flex_shrink_y = 0;
|
|
|
|
// Focus management to support the frame/focus/select element.
|
|
enum Selection {
|
|
NORMAL = 0,
|
|
SELECTED = 1,
|
|
FOCUSED = 2,
|
|
};
|
|
Selection selection = NORMAL;
|
|
Box selected_box;
|
|
};
|
|
|
|
} // namespace ftxui
|
|
|
|
#endif /* end of include guard: FTXUI_DOM_REQUIREMENT_HPP */
|
|
|
|
// 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.
|