Commit Graph

544 Commits

Author SHA1 Message Date
ArthurSonzogni
84d6e6b3dd Add additional coverage tests. 2022-04-27 14:00:46 +02:00
ArthurSonzogni
001dd0a8c3 Exclude tests from coverage. 2022-04-27 13:25:43 +02:00
ArthurSonzogni
114cbfcffd Add coverage and remove deprecated WideInput. 2022-04-27 11:33:42 +02:00
ArthurSonzogni
5ba301d316 Add coverage for terminal_input_parser. 2022-04-27 11:11:32 +02:00
Arthur Sonzogni
06ed8567b8 Add coverage for colors (extended) (#385) 2022-04-27 09:28:48 +02:00
Arthur Sonzogni
04b36df567
Coverage decorator (#384)
Add code coverage for colors and decorators.
2022-04-26 17:04:34 +02:00
Arthur Sonzogni
764c24ef40
Add code coverage support. (#378) 2022-04-17 15:47:20 +02:00
Arthur Sonzogni
b2896aba49
Add games from the gamejam 2022-04-12 23:52:35 +02:00
Arthur Sonzogni
9f610a0110
Make the focused button to take the focus inside frame. (#371)
This resolves:
https://github.com/ArthurSonzogni/FTXUI/issues/370
2022-04-03 15:04:33 +02:00
Arthur Sonzogni
aebde94352
Add clang-tidy. (#368) 2022-03-31 02:17:43 +02:00
Arthur Sonzogni
62fb6298be
Bug fixes. (#367)
- Do not draw more frames than what is needed.
- Fix MenuEntry transform state.
- Fix Canvas animated example.
2022-03-26 07:55:52 +01:00
Arthur Sonzogni
548fa51b71
Upgrade version (#363) 2022-03-20 21:14:17 +01:00
Arthur Sonzogni
1a3fcc1bd8
Improvement documentation. (#361) 2022-03-20 18:13:11 +01:00
Kefu Chai
0137d2a9ac
component/collapsible: drop unused member variable (#360)
Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-03-20 16:04:42 +01:00
Arthur Sonzogni
c76612a3c8
Fix error with invalid float in the gauge component. (#356) 2022-03-13 22:30:05 +01:00
Arthur Sonzogni
4da63b9260
Animation (#355) 2022-03-13 18:51:46 +01:00
Kefu Chai
95c766e9e4
Component decorators (#354)
Add decorator variants for decorator components

Add the "pipe" operator for components, similar to what was done for Elements.
We are able to put something like:
```
Button(...) | Maybe(&show_button)
```

Add decorators for:
- `Maybe`
- `CatchEvent`
- `Renderer`

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
2022-03-12 15:18:36 +01:00
Arthur Sonzogni
3e28fd6520
Convert \r into \n (#350)
This resolves:
https://github.com/ArthurSonzogni/FTXUI/issues/337
2022-03-04 13:23:45 +01:00
Kefu Chai
a254e36632
component/catch_event: improve the example for CatchEvent() (#351)
before this change, the example in the doxygen document for CatchEvent()
does not use the documented function. hence the example is not that
useful for developers interested in a typical usage of this function.

after this change, the example is improved to added the call to
CatchEvent(), which allows the application to the Loop() function at
user input.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-03-04 13:23:31 +01:00
IsakTheHacker
9dbc23a7d4
Fix typos in README (#349) 2022-03-01 19:07:50 +01:00
Vladislav Nepogodin
3fe12b8a2f
Add cachyos-cli-installer in README (#347) 2022-02-24 14:38:28 +01:00
Arthur Sonzogni
43dd70979d
Update README.md 2022-02-21 10:27:53 +01:00
Elazar Leibovich
779c2d5b1a
Add conan as a possible packaging system. (#342) 2022-02-21 10:25:05 +01:00
Arthur Sonzogni
20f16b3984
Improve ComponentBase and Container::Tab Focusable implementations (#341)
- Provide better defaults for ComponentBase `Focusable()` and
  `ActiveChild()` methods. This resolves:
  https://github.com/ArthurSonzogni/FTXUI/issues/335

- Implement `Container::Tab` 's  `Focusable()` methods. This prevents
  the users to navigate into a tab with no interactivity.
2022-02-19 11:49:12 +01:00
ericLemanissier
f95ed885bb
Don't override PREFIX target property (#340)
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
2022-02-19 10:48:07 +01:00
Kefu Chai
63e8dadad9
allow passing move-only parameter to Make() (#338)
ftxui::Ref<> is used for passing Options, for instance, MenuOption,
to the corresponding component which is supposed to hold a strong
reference of it. and we can observe the events sent to the component
by setting callback(s) in the option instance passed to the owner
component.

but the callback function is not always copyable, despite that it
might be moveable.

in this change,

* Make<>() is updated to use the perfect forwarding to avoid
  enforcing its parameters to be copyable.
* Ref<> is also updated to take a rvalue reference, so we can
  move away from the contructor parameter when creating an
  instance of Ref<>() from it.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
2022-02-16 14:09:08 +01:00
Arthur Sonzogni
9b83205b3e
Fix vscroll-indicator size and offset. (#334) 2022-02-14 02:44:57 +01:00
Arthur Sonzogni
5da7b8a59a
Fix automerge in tables. (#333) 2022-02-13 11:41:31 +01:00
Arthur Sonzogni
9c4218c2a8
Support SIGTSTP and task posting. (#331)
- Add support for SIGTSTP:
https://github.com/ArthurSonzogni/FTXUI/issues/330
This

- Add support for task posting.
This allows folks to defer function execution, and execute it directly
below the main loop. The task are executed in a FIFO order.
2022-02-13 11:11:34 +01:00
Arthur Sonzogni
62747a49b6
Fix windows warning. (#332) 2022-02-13 10:51:47 +01:00
Arthur Sonzogni
8ba3698437
Gauge direction (#326)
Add `gauge` with all the different directions.

Co-authored-by: Aleksandar Brakmic <13668697+brakmic-aleksandar@users.noreply.github.com>
2022-02-06 19:17:21 +01:00
Arthur Sonzogni
7c3ca1beb5
Update README.md 2022-02-05 15:06:23 +01:00
Nikola Dućak
689d5dd299
Replace std::clamp with util::clamp and reformat the code (#321)
* Replace std::clamp with util::clamp
* Apply clang-format
* Execute ./tools/iwyu.sh

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
2022-02-05 15:03:45 +01:00
Tushar Maheshwari
372d0ace4a
Add tusharpm/tiles in README (#324) 2022-02-04 13:18:34 +01:00
Arthur Sonzogni
81b7207121
Move to v2.0.0 (#315) 2022-01-22 17:58:33 +01:00
Arthur Sonzogni
6039474a26
Automerge feature. (#313)
Add the `automerge` attribute to the Pixel bit field. It controls
whether two pixels must be automerged. Defining this allows two
mergeable characters not to be merged.

This was requested by:
https://github.com/ArthurSonzogni/FTXUI/issues/285
2022-01-22 15:38:01 +01:00
Arthur Sonzogni
4267b40a68
Add collapsible into fuzzer. (#312) 2022-01-22 11:44:52 +01:00
Arthur Sonzogni
3829734fa9
Fix table separator (#311) 2022-01-21 23:02:29 +01:00
Vladislav Nepogodin
b4a655ec65
Introduce WithRestoredIO (#307)
This function allow running a callback with the terminal hooks
temporarily uninstalled.

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
2022-01-19 13:38:39 +01:00
Vladislav Nepogodin
cd82fccde7
Add missing const. (#297)
Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
2022-01-18 19:48:58 +01:00
Arthur Sonzogni
382205c057
Add Table constructor from Elements. (#310) 2022-01-16 16:46:32 +01:00
pezy
feb24b9498
Fix Clamp crash when entries_ size is zero (#306)
Run ftxui_example_homescreen on Windows, then select compiler tab, crash on origin code.

Co-authored-by: chenpeizhe <peizhe.chen@horizon.ai>
2022-01-13 01:46:09 +01:00
pezy
3dc215e6c0
Fix README link (#308)
- [Build using nxxm] is same with [Build using CMake], just remove
- fix [Build using CMake] link

Co-authored-by: chenpeizhe <peizhe.chen@horizon.ai>
2022-01-12 15:31:44 +01:00
Arthur Sonzogni
1888631bec
Main (#303)
* Refresh cursor reporting on resize.

* Fix invalid size write.

This resolves:
https://github.com/ArthurSonzogni/FTXUI/issues/302
2022-01-11 23:06:36 +01:00
Arthur Sonzogni
84299de2e1
Add json-tui as using FTXUI. 2022-01-09 22:00:45 +01:00
Arthur Sonzogni
cdd6339849
Execute IWYU (#299) 2022-01-07 11:03:54 +01:00
Andrey Zimin
358f886fab
Clamp selected_ on list resize for Radiobox/Menu/Toggle (#298)
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>
2022-01-06 22:38:32 +01:00
Arthur Sonzogni
728976bdeb
Fix vscroll indicator (#295)
* Clear vscroll_indicator content before drawing it.
2022-01-05 12:04:03 +01:00
Arthur Sonzogni
fc92f52b4c
The collapsible element. (#294) 2022-01-02 15:48:56 +01:00
Man, Jianting (Meco)
071d2bc92b
improve the window size handle method (#292)
1. the default window size should be 80x24 rather than 80x25 in VT100.
2. the ioctl return value result should be checked. Some operating systems don't support TIOCGWINSZ this command.
2022-01-01 19:24:37 +01:00