Commit Graph

476 Commits

Author SHA1 Message Date
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
Vladislav Nepogodin
d549cdabb0
Reduce amount of warnings with pedantic compiler (#291) 2022-01-01 11:40:18 +01:00
Arthur Sonzogni
aea67743d4
Canvas bug fix and documentation. (#289) 2021-12-29 16:31:27 +01:00
Arthur Sonzogni
7614bf04a6
Address felixjulianheitmann suggestions. (#288)
- Remove unused examples/dom/flexbox.cpp
- Add canvas(width, height, void(Canvas&)) method
2021-12-24 17:29:39 +01:00
Arthur Sonzogni
188cffc5f6
Add example in the README.md 2021-12-23 15:12:22 +01:00
Arthur Sonzogni
0d47dd19ab
Feature: Canvas (#287)
Draw using braille and block characters on a grid.
2021-12-23 14:17:33 +01:00
Arthur Sonzogni
7e5cd23b4c
Add focusPosition[relative](x,y) (#280)
It allows when using inside a frame, to scroll the view toward a
particular position.

This resolves:
https://github.com/ArthurSonzogni/FTXUI/issues/125
2021-12-13 11:38:31 +01:00
Arthur Sonzogni
52276c8a2b
Bugfix Input use std::string (#279)
Use std::string by default for the implementation of FTXUI's input
component.

Along the way:
- Give a correct implementation for fullwidth characters.
- Add tests
- Modify the way the cursor is drawn.
2021-12-12 21:31:54 +01:00
Arthur Sonzogni
602392c43d
Implement flexbox (#277)
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.
2021-12-11 17:58:25 +01:00
Hassan Farooq
f7c6bf91a7
adding to projects using FTXUI list (#274)
Co-authored-by: hfarooq <hfarooq@tenstorrent.com>
2021-12-06 20:18:09 +01:00
Nikola Dućak
cecd54df42
Fix gridbox segfault (#260)
The problem was about
2021-11-17 10:16:09 +01:00
Gokulakrishnan D P
0186f8a463
added vantage in project section (#258) 2021-11-10 13:06:15 +01:00
Arthur Sonzogni
ebfb5ef3a1
Input shouldn't take focus. (#257)
This fixes:
https://github.com/ArthurSonzogni/FTXUI/issues/252
2021-11-09 20:30:27 +01:00
bogdasar1985
8f405f5054
Fix a typo (#256) 2021-11-09 12:11:45 +01:00
Arthur Sonzogni
8652280c85
Input shouldn't take focus. (#253)
This fixes:
https://github.com/ArthurSonzogni/FTXUI/issues/252
2021-11-07 12:01:17 +01:00
Arthur Sonzogni
aa6b78b8ad
Upgrade version to 0.11.1 (#246)
A minor new version. Mostly for packaging the library in Release mode.
2021-10-23 21:13:23 +02:00
Arthur Sonzogni
c0e47aecb2
Remove unused file. (#244)
It was added mistakenly in:
https://github.com/ArthurSonzogni/FTXUI/pull/214#pullrequestreview-786773967
but @robinlinden found it.
2021-10-22 18:10:11 +02:00
Kevin Brennan
cba11151b5
Fix Windows builds not being in Release mode (#245) 2021-10-22 18:06:19 +02:00
Arthur Sonzogni
f80d9b5cfd
Fix dropdown fuzzer. (#243) 2021-10-22 14:04:07 +02:00