Commit Graph

703 Commits

Author SHA1 Message Date
Arthur Sonzogni
a6e04b4346
Table: reset dimensions. (#396)
The table is not meant to be used to render more than once. Reset the
dimensions so that, even if it is used wrongly, this is not memory
unsafe.

This was raised by:
https://github.com/ArthurSonzogni/FTXUI/issues/381
2022-05-08 08:34:51 +02:00
SColibri
09a2c077eb
windows.h defines DrawText and shadows the function Canvas.DrawText, fix based on the solution #70 (#394)
Co-authored-by: Sebastian Carrion Ständer <sebastian.carrion@tum.de>
2022-05-04 23:39:03 +02:00
ArthurSonzogni
bc206f85da
Fix compilation error on Windows for Color::Print 2022-05-02 20:50:15 +02:00
ArthurSonzogni
e9772a0116 Update gcov options. 2022-04-28 11:32:30 +02:00
ArthurSonzogni
e4c5c7b43b Fix ButtonTest.Animate 2022-04-28 11:03:39 +02:00
ArthurSonzogni
c2e1920449 Execute IWYU. 2022-04-28 10:43:31 +02:00
ArthurSonzogni
3d56146447 Add test coverage for button, collapsible and menu. 2022-04-28 10:08:33 +02:00
ArthurSonzogni
c33e805a76 Add coverage for menu and resizable_split. 2022-04-27 23:00:29 +02:00
ArthurSonzogni
d0890f94d1 execute IWYU and add some coverage tests. 2022-04-27 18:57:48 +02:00
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