mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-20 02:28:10 +08:00
Add dom::blink and component::Input
This commit is contained in:
@@ -28,4 +28,4 @@
|
||||
* mouse
|
||||
* terminal event
|
||||
|
||||
You can make implement your own.
|
||||
Implement your own!
|
||||
|
@@ -14,8 +14,8 @@ class Input : public Component {
|
||||
~Input() override;
|
||||
|
||||
// State.
|
||||
std::wstring content = L"input";
|
||||
std::wstring placeholder = L"placeholder";
|
||||
std::wstring content;
|
||||
std::wstring placeholder;
|
||||
|
||||
// State update callback.
|
||||
std::function<void()> on_change = [](){};
|
||||
|
@@ -28,6 +28,7 @@ Element bold(Element);
|
||||
Element dim(Element);
|
||||
Element inverted(Element);
|
||||
Element underlined(Element);
|
||||
Element blink(Element);
|
||||
Element color(Color, Element);
|
||||
Element bgcolor(Color, Element);
|
||||
|
||||
@@ -37,6 +38,9 @@ Element vcenter(Element);
|
||||
Element center(Element);
|
||||
Element flex(Element);
|
||||
|
||||
// --- Util ---
|
||||
Element nothing(Element element);
|
||||
|
||||
template <class... Args>
|
||||
Children unpack(Args... args) {
|
||||
Children vec;
|
||||
|
@@ -9,7 +9,7 @@ namespace ftxui {
|
||||
struct Event{
|
||||
public:
|
||||
// --- Character ---
|
||||
static Event Character(char);
|
||||
static Event Character(int);
|
||||
|
||||
// --- Arrow ---
|
||||
static Event ArrowLeft;
|
||||
@@ -27,7 +27,7 @@ struct Event{
|
||||
bool operator==(const Event& other) { return values == other.values; }
|
||||
|
||||
// Internal representation.
|
||||
std::array<char, 5> values = {0, 0, 0, 0, 0};
|
||||
std::array<int, 5> values = {0, 0, 0, 0, 0};
|
||||
};
|
||||
|
||||
|
||||
|
@@ -14,10 +14,11 @@ namespace dom {
|
||||
|
||||
struct Pixel {
|
||||
wchar_t character = U' ';
|
||||
bool blink = false;
|
||||
bool bold = false;
|
||||
bool dim = false;
|
||||
bool inverted = false;
|
||||
bool underlined = false;
|
||||
bool dim = false;
|
||||
Color background_color = Color::Default;
|
||||
Color foreground_color = Color::Default;
|
||||
};
|
||||
|
Reference in New Issue
Block a user