mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-22 04:38:09 +08:00
Add Blink. Refactor examples.
This commit is contained in:
@@ -7,6 +7,7 @@ namespace ftxui {
|
||||
namespace component {
|
||||
|
||||
// A component where focus and events are automatically handled for you.
|
||||
// Please use ComponentVertical or ComponentHorizontal.
|
||||
class ComponentDirection : public Component {
|
||||
public:
|
||||
ComponentDirection(Delegate* delegate);
|
||||
|
@@ -15,6 +15,7 @@ using Children = std::vector<Child>;
|
||||
Element vbox(Children);
|
||||
Element hbox(Children);
|
||||
Element flex();
|
||||
Element flex(Element);
|
||||
|
||||
// --- Widget --
|
||||
Element text(std::wstring text);
|
||||
@@ -23,7 +24,7 @@ Element gauge(float ratio);
|
||||
Element frame(Child);
|
||||
Element frame(Child title, Child content);
|
||||
|
||||
// -- Decorator (Style) ---
|
||||
// -- Style ---
|
||||
Element bold(Element);
|
||||
Element dim(Element);
|
||||
Element inverted(Element);
|
||||
@@ -32,11 +33,10 @@ Element blink(Element);
|
||||
Element color(Color, Element);
|
||||
Element bgcolor(Color, Element);
|
||||
|
||||
// --- Decorator ---
|
||||
// --- Util ---
|
||||
Element hcenter(Element);
|
||||
Element vcenter(Element);
|
||||
Element center(Element);
|
||||
Element flex(Element);
|
||||
|
||||
// --- Util ---
|
||||
Element nothing(Element element);
|
||||
|
@@ -17,14 +17,14 @@ class Node {
|
||||
Node(std::vector<std::unique_ptr<Node>> children);
|
||||
virtual ~Node();
|
||||
|
||||
// Step 1: Direction parent <= children.
|
||||
// Compute layout requirement. Tell parent what dimensions this
|
||||
// Step 1: Compute layout requirement. Tell parent what dimensions this
|
||||
// element wants to be.
|
||||
// Propagated from Children to Parents.
|
||||
virtual void ComputeRequirement();
|
||||
Requirement requirement() { return requirement_; }
|
||||
|
||||
// Step 2: Direction parent => children.
|
||||
// Assign this element its final dimensions.
|
||||
// Step 2: Assign this element its final dimensions.
|
||||
// Propagated from Parents to Children.
|
||||
virtual void SetBox(Box box);
|
||||
|
||||
// Step 3: Draw this element.
|
||||
|
Reference in New Issue
Block a user