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>
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.
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.
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
Based on the existing color decorators, create new ones to apply a gradient effect on the DOM.
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
It can be used to give developers a better control on the loop. Users
can use it not to take full control of the thread, and poll FTXUI from
time to time as part of an external loop.
This resolves: https://github.com/ArthurSonzogni/FTXUI/issues/474
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.
- Fix focus in flexbox. This required resetting the focus state at the
beginning of the ComputeRequirement(), because it can now run several
times.
This resolves:https://github.com/ArthurSonzogni/FTXUI/issues/399
- Add Box::Union.
- Add a preliminary implementation of forwarding selected_box from
within the flexbox.