Commit Graph

227 Commits

Author SHA1 Message Date
Arthur Sonzogni
30a85c4c5b Clear terminal on resize. (#99) 2021-05-17 00:44:37 +02:00
Arthur Sonzogni
a574a6c3ee Pass -Wshadow (#97)
Requested from:
https://github.com/robinlinden/hastur/pull/12
2021-05-16 17:18:11 +02:00
Arthur Sonzogni
01f5d9f7bc Remove flickering. (#95)
For some reason, ResetPosition() was also clearing the content. On very
slow terminal emulator like the one on Windows, flickering was visible.

This fixes:
https://github.com/ArthurSonzogni/FTXUI/issues/86
2021-05-16 10:59:19 +02:00
Arthur Sonzogni
ca0d74ac01 Warn for deprecated. (#94) 2021-05-16 09:57:55 +02:00
Arthur Sonzogni
69047ac1e4 Add warning for sign comparison. (#93) 2021-05-16 09:38:24 +02:00
Arthur Sonzogni
7daeac25c0 Modify signature of Container::Tab(...) (#92)
Take selector at the end to get more pleasing results with clang-format.
2021-05-15 02:32:42 +02:00
Arthur Sonzogni
2723616dc8 Make StringRef borrow reference only when taking a pointer. (#91) 2021-05-15 01:34:37 +02:00
ArthurSonzogni
fcc49fdce7 Format using iwyu. 2021-05-15 00:19:19 +02:00
ArthurSonzogni
048efb6912 Add {Const,}StringRef to simplify components. 2021-05-14 21:47:51 +02:00
ArthurSonzogni
9fdf235836 Improve the documentation. 2021-05-14 20:56:37 +02:00
ArthurSonzogni
c9aa1805eb Add the Renderer component. 2021-05-13 11:44:47 +02:00
ArthurSonzogni
6d75cb2748 Make component more functionnal 2021-05-09 22:35:34 +02:00
ArthurSonzogni
be219633e3 Merge remote-tracking branch 'origin' into feature/mouse-support 2021-05-01 23:45:13 +02:00
ArthurSonzogni
155758c073 Use IWYU. 2021-05-01 23:19:07 +02:00
ArthurSonzogni
eb399d20c5 Capture mouse for the slider component. 2021-05-01 18:13:56 +02:00
ArthurSonzogni
0af8201023 Add the slider component. 2021-04-29 00:18:58 +02:00
ArthurSonzogni
f062634226 Fix compilation errors on WebAssembly and Windows. 2021-04-25 17:28:16 +02:00
ArthurSonzogni
a27c878a3f Mouse support. Fix & verify Webassembly support.
There was some undefined behavior to be fixed in the terminal input
parser.

The behavior of flush seems to have change. The fix was to invert '\0'
and std::flush.
2021-04-25 16:58:16 +02:00
ArthurSonzogni
0b9b6c692a Improve mouse support 2021-04-25 15:22:38 +02:00
ArthurSonzogni
8037a5fa5f Improve mouse support for menu and toggle. 2021-04-24 18:16:13 +02:00
ArthurSonzogni
890a41a64c Add mouse implementation of most components. 2021-04-18 22:33:41 +02:00
ArthurSonzogni
d685a8655e Parse mouse middle 2021-04-18 18:42:42 +02:00
ArthurSonzogni
cbd13499ae Parse mouse events. 2021-04-18 18:32:38 +02:00
柚木鉉
e54d4643f5 Update terminal.cpp 2021-04-10 22:35:51 +02:00
ArthurSonzogni
476b9deaf8 Enable mouse tracking.
Request terminal to send mouse position.

See:
https://github.com/ArthurSonzogni/FTXUI/issues/7
2021-04-05 22:03:37 +02:00
ArthurSonzogni
386a0f9eac Add tests for the input component. 2021-03-28 18:25:16 +02:00
d
160b1c8bbc Added Home, End, PageUp, PageDown events.
Added handling for Home and End for input component
2021-03-28 18:25:16 +02:00
Arthur Sonzogni
373b016ca9 Add webassembly support (#79) 2021-03-22 00:26:52 +01:00
ArthurSonzogni
cac94439ff Add webassembly support 2021-03-21 23:30:46 +01:00
Arthur Sonzogni
a6a7f0a354 Add CI on github action. (#76) 2021-03-20 22:45:21 +01:00
jdfa
af4bf379bc Swapped order of hidding cursor and setting alternative screen (#75)
On some terminal, going to the alternative screen disable cursor hiding.
 Swap of those commands fixed that issue.

Co-authored-by: d <d>
2021-03-16 09:46:02 +01:00
jdfa
9cc3779145 [Win] Fixed usage of ReadConsoleInput (#74)
ReadConsoleInput params: |nLength| is the size in array elements, not in byte.

Co-authored-by: d <d>
2021-03-13 21:02:01 +01:00
Robin Lindén
73a3c24394 Build with -Wmissing-declarations (#71)
This flag is used to find global functions defined without a previous
declaration. Usually it spots accidental globals, but in this case it
was just missing headers.
2021-02-11 00:45:42 +01:00
robobuggy
d0eab41344 Fixed infinite loop in Screen::ToString() for non-printable chars (#69) 2021-02-04 09:32:05 +01:00
Arthur Sonzogni
92ec5ab4ca Support for color fallback. (#66)
On terminal not supporting some color palette, fallback toward the
closest one.
2020-12-23 14:45:57 +01:00
Arthur Sonzogni
305346542a Fix terminal color detection support. (#65)
There was many obvious bugs, discovered here:
ad2a085469/Open-Source-Project-Anatomy/FTXUI.md
2020-12-23 12:20:01 +01:00
Arthur Sonzogni
406355df8c Fix parsing of keys that are prefix of others. (#58)
The ESC key generates sequences that are prefix of others. For instance:
- ESC => [27]
- F1 =>  [27, 79, 8]

As a result, we can't generate the ESC event when receiving [27],
because it might be the start of the [27, 79, 8] sequence (or not).

Application usually applies a timeout to help detecting the ESC key.
This patch introduce a timeout. It is set to 50ms.

Bug: https://github.com/ArthurSonzogni/FTXUI/issues/55
2020-10-25 01:57:56 +02:00
Mike Wallio
1cb08fd606 Fix event const correctness (#56) 2020-10-24 16:47:03 +02:00
Arthur Sonzogni
d969c74341 Improve color handling. (#49) 2020-10-16 22:31:24 +02:00
Stephan Roslen
cfd0981a58 reset pixel style for newline (#54) 2020-10-16 21:26:59 +02:00
Stephan Roslen
e34dc1606e Fix crash on unset environment variable. 2020-10-15 21:57:14 +02:00
ArthurSonzogni
606e0efdfe Implement Input::on_change. 2020-09-20 11:47:06 +02:00
ArthurSonzogni
5291f660ca Automatically fix style. 2020-09-07 11:25:50 +02:00
ArthurSonzogni
d09996a6c7 Add more example for colors. 2020-09-07 11:25:50 +02:00
Damien D
dc8c090753 Add support for full RGB colors.
FTXUI supported only the 16 colors palette.
This patch adds support for the 256 palette and the TrueColor(8×8×8)
mode.

This was made by kerdelos@ and fixes issue:
https://github.com/ArthurSonzogni/FTXUI/issues/45

Co-authored-by: Damien D <kerdelos@gmail.com>
Co-authored-by: Arthur Sonzogni <sonzogniarthur@gmail.com>
2020-09-07 11:25:50 +02:00
ArthurSonzogni
6b70967c6d Add <algorithm> to border.cpp.
This fies an issue with Windows.
2020-08-28 23:54:25 +02:00
ArthurSonzogni
4ad4946de3 Add the modal dialog example.
New component: clear_under.
2020-08-28 23:54:25 +02:00
ArthurSonzogni
5a8ed208da Add the Button component. 2020-08-28 23:54:25 +02:00
ArthurSonzogni
81d79d311d Add TakeFocus and SetActiveChild.
This allows developers to set child children component must be the
currently active/focused one.

This can be used to "control" where the focus is, without user
interactions.
2020-08-28 23:54:25 +02:00
ArthurSonzogni
114ab4ae2a Add more documentation. 2020-08-28 23:54:25 +02:00