Some developers would be happier with the gtest version provided from
their package manager. Use it if it is installed the package provide
cmake support.
Fixed: https://github.com/ArthurSonzogni/FTXUI/issues/551
Add the `SliderOption` option supporting:
```cpp
{
Ref<T> value;
ConstRef<T> min = T(0);
ConstRef<T> max = T(100);
ConstRef<T> increment = (max() - min()) / 20;
GaugeDirection direction = GaugeDirection::Right;
Color color_active = Color::White;
Color color_inactive = Color::GrayDark;
};
```
In particular, this supports multiple direction. This resolves:
https://github.com/ArthurSonzogni/FTXUI/issues/467
This one do not support adding a label. The old constructors can still
be used to have a label.
PREFIX is by default "lib", which most of the libraries use.
this changes makes the library files libftxui-foo.a
as ArthurSonzogni/FTXUI#140 intended originally
fix: https://github.com/ArthurSonzogni/FTXUI/issues/296#issue-1092343846
When the list in Radiobox/Menu/Toggle is resized, clamp the |selected_| values so that it stays within bounds.
Clamping is executed in Render() and in OnEvent()
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
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.
In the past, FTXUI switched from std::string to std::wstring to support
fullwidth characters. The reasons was that fullwidth characters can be
stored inside a single wchar_t.
Then FTXUI added support for combining characters. A single glygh
doesn't even fit a wchar_t. Instead, a glyph can be arbitrary large.
The usage of wstring doesn't really fit the new model and have several
drawbacks:
1. It doesn't simplify the implementation of FTXUI, because of combining
characters.
2. It reduces drawing performance by 2x.
3. It increase Screen's memory allocation by 2x.
This patch converts FTXUI to use std::string internally. It now exposes
std::string based API. The std::wstring API remains, but is now
deprecated.
Tests and examples haven't been update to show the breakage is limited.
They will be updated in a second set of patches.
Bug: https://github.com/ArthurSonzogni/FTXUI/issues/153
Co-authored-by: Tushar Maheshwari <tushar27192@gmail.com>
The target_compile_features command allows setting PUBLIC compile features for the library, making it implicit for the applications linking it. This reduces the CMake boilerplate required to set up a dependent project (eg. ftxui-starter).
Instead of putting the archive as:
- <lib_dir>/ftxui/libcomponent.a
- <lib_dir>/ftxui/libdom.a
- <lib_dir>/ftxui/libscreen.a
Use:
- <lib_dir>/libftxui-component.a
- <lib_dir>/libftxui-dom.a
- <lib_dir>/libftxui-screen.a
This fixes an issue users have with VCPKG.
See:
https://github.com/microsoft/vcpkg/issues/16327#issuecomment-868942370
I finally got access to a computer using the Microsoft's Windows OS.
That's the opportunity to find and mitigate all the problems
encountered. This patch:
1. Introduce an option and a C++ definition to enable fallback for
Microsoft's terminal emulators. This allows me to see/test the
Microsoft output from Linux. This also allows Windows users to remove
the fallback and target non Microsoft terminals on Windows if needed.
2. Microsoft's terminal suffer from a race condition bug when reporting
the cursor position:
https://github.com/microsoft/terminal/pull/7583.
The mitigation is not to ask for the cursor position in fullscreen
mode where it isn't really needed and request it less often.
This fixes: https://github.com/ArthurSonzogni/FTXUI/issues/136
3. Microsoft's terminal do not handle properly hidding the cursor. Instead
the character under the cursor is hidden, which is a big problem. As
a result, we don't enable setting the cursor to the best position for
[input method editors](https://en.wikipedia.org/wiki/Input_method),
It will be displayed at the bottom right corner.
See:
- https://github.com/microsoft/terminal/issues/1203
- https://github.com/microsoft/terminal/issues/3093
4. Microsoft's terminals do not provide a way to query if they support
colors. As a fallback, assume true colors is supported.
See issue:
- https://github.com/microsoft/terminal/issues/1040
This mitigates:
- https://github.com/ArthurSonzogni/FTXUI/issues/135
5. The "cmd" on Windows do not properly report its dimension. Powershell
works correctly. As a fallback, use a 80x80 size instead of 0x0.
6. There are several dom elements and component displayed incorrectly,
because the font used is missing several unicode glyph. Use
alternatives or less detailled one as a fallback.