This should solve #766
The original PR was:
#767
Co-authored-by: rbrugo <brugo.riccardo@gmail.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This fixes: https://github.com/ArthurSonzogni/FTXUI/issues/773
Dragging the mouse with the left button pressed now avoids activating multiple
checkboxes.
Add support for detecting mouse press transition. Added:
```cpp
// The previous mouse event.
Mouse Mouse::previous;
// Return whether the mouse transitionned from:
// released to pressed => IsPressed()
// pressed to pressed => IsHeld()
// pressed to released => IsReleased()
bool Mouse::IsPressed(Button button) const;
bool Mouse::IsHeld(Button button) const;
bool Mouse::IsReleased(Button button) const;
```
A couple of components are now activated when the mouse is pressed,
as opposed to released.
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This a proposed MR to fix#754. While building the scroll bar the pixels were completely reseted thus canceling any style previously applied to said pixels. This MR removes this resetting of the pixels and leaves only the drawing of the shape of the scroll bar.
When mouse events are enabled, it is not possible to select text in the
terminal and copy it somewhere else. This could be usefull for some
applications if they don't need to handle mouse events.
Add a function on the ScreenInteractive class to disable grabbing of
mouse events so that it is e.g. possible to select text in the user
interface. The function needs to be called on the screen object before
starting the application loop if such a behaviour is desired.
This yields a ~1% performance improvements, likely
because the smaller types causes less load on memory
when bisearching the WordBreakProperty interval table
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
IsCombining() is a hotpath when rendering the screen.
Most of the time is spent doing bisearch on the word break interval list
to check it characters has the extend property.
Create a seperate table for intervals with the extend property,
so they can just be searched in isCombining().
Also some of the intervals in the word break interval list
were consecutive and could be combined to reduce the
size of the list.
This gives a ~25% performance improvement when running the benchmark
Into ftxui/component/, add:
```
Container::Stacked(...)
Window(...);
```
Together, they can be used to display draggable/resizable windows.
Bug:https://github.com/ArthurSonzogni/FTXUI/issues/682
* Fix typo.
Improve the performance of the functions for searching for codepoints
in a table by passing the table array in as a reference instead of copying
it.
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
1. Stop taking Ref<XxxOption> in Component constructors. Instead, use
the XxxOption directly. Passing by copy avoid problems developers had
where one was shared in between multiple component, causing issues.
2. Add variants of most component constructors taking a struct only.
This replaces:
https://github.com/ArthurSonzogni/FTXUI/pull/670
This fixes:
https://github.com/ArthurSonzogni/FTXUI/issues/426
Using `auto` seems to create a different output on different platforms.
Notably it was observed that aarch64 compiles return a different
value.
Fix the type of the characters iterated through the string.
Fixes#639
Signed-off-by: Henner Zeller <h.zeller@acm.org>
Depending on the Cursor Key Mode (DECCKM), the terminal sends different
escape sequences:
Key Normal Application
----- -------- -----------
Up ESC [ A ESC O A
Down ESC [ B ESC O B
Right ESC [ C ESC O C
Left ESC [ D ESC O D
Home ESC [ H ESC O H
End ESC [ F ESC O F
I decided not to update the current mode to fit what FTXUI parse, but
instead support parsing both. We convert the sequences from the
"application mode" into the "normal mode".
Bug:https://github.com/ArthurSonzogni/FTXUI/issues/626
Fixed:https://github.com/ArthurSonzogni/FTXUI/issues/626
Based on the existing color decorators, create new ones to apply a gradient effect on the DOM.
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>