forked from ArthurSonzogni/FTXUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add colored border. (ArthurSonzogni#595)
This resolves: ArthurSonzogni#564
- Loading branch information
1 parent
9efa0f7
commit 2991b03
Showing
5 changed files
with
94 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox | ||
#include <ftxui/screen/screen.hpp> // for Screen | ||
#include <iostream> // for endl, cout, ostream | ||
#include <memory> // for allocator | ||
|
||
#include "ftxui/dom/node.hpp" // for Render | ||
#include "ftxui/screen/color.hpp" // for ftxui | ||
|
||
int main(int argc, const char* argv[]) { | ||
using namespace ftxui; | ||
|
||
auto make_boxed = [] { | ||
return vbox({ | ||
text("borderLight") | borderStyled(LIGHT, Color::Red), | ||
text("borderDashed") | borderStyled(DASHED, Color::Green), | ||
text("borderHeavy") | borderStyled(HEAVY, Color::Blue), | ||
text("borderDouble") | borderStyled(DOUBLE, Color::Yellow), | ||
text("borderRounded") | borderStyled(ROUNDED, Color::Cyan), | ||
}); | ||
}; | ||
|
||
auto document = hbox({ | ||
make_boxed(), | ||
separator() | color(Color::Red), | ||
make_boxed(), | ||
separator() | color(Color::Red), | ||
make_boxed(), | ||
}) | | ||
borderStyled(ROUNDED, Color::Red); | ||
|
||
auto screen = | ||
Screen::Create(Dimension::Fit(document), Dimension::Fit(document)); | ||
Render(screen, document); | ||
screen.Print(); | ||
std::cout << std::endl; | ||
} | ||
|
||
// 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters