Commit Graph

171 Commits

Author SHA1 Message Date
Alexandre Bury
14fe6f3b36 Cargo fmt 2018-06-16 13:23:09 -07:00
Alexandre Bury
83bcf4fb72 Merge branch 'master' into callback_preemption 2018-06-16 11:03:39 -07:00
Alexandre Bury
5e1956b737 Merge branch 'master' into scroll 2018-06-15 23:21:10 -07:00
Alexandre Bury
8acc08f340 Rustfmt 2018-06-10 23:29:19 -07:00
Alexandre Bury
8edc0e20c9 Cargo fmt 2018-05-21 19:21:27 -07:00
Alexandre Bury
3bc07661d0 Add scroll example 2018-05-21 17:56:20 -07:00
Alexandre Bury
05e1212a50 Refactor Backend input model
Backends now have to send input to the given `chan::Sender<Event>`.
They send these events from a separate thread, allowing selection
between input and callbacks.

This currently breaks the BearLibTerminal backend, which requires all
calls to come from the UI thread.

This might not be super-safe for the ncurses backend also. We hope that
input and output are separate enough that they can run concurrently without
problem.
2018-05-20 09:59:35 -07:00
Alexandre Bury
4a3bbbb998 lorem example: remove unnecessary full_screen() 2018-05-07 23:18:22 -07:00
Alexandre Bury
a8326aef28 Fix key_codes example 2018-04-16 22:54:54 -07:00
Alexandre Bury
f0b3287d73 Merge branch 'master' into scroll 2018-04-16 22:42:42 -07:00
Alexandre Bury
ff9f669d73 Fix tests & examples 2018-04-10 12:51:40 -07:00
Alexandre Bury
b1e9afe0ff Add vpv example 2018-04-10 11:46:02 -07:00
Alexandre Bury
126530b9a9 Cursive::new now takes the backend as argument 2018-04-01 16:39:03 -07:00
Alexandre Bury
1ad515e5f0 rustfmt 2018-03-22 11:04:58 -07:00
Alexandre Bury
9bc723ab4a Do not accept any return value for callbacks
It got added so we could keep using `s.pop_layer()` in single-line callbacks.
It was confusing, and the return value was ignored anyway.
2018-03-16 15:50:56 -07:00
Alexandre Bury
8ecd4fdb62 Revert colors in mines example 2018-03-14 15:48:08 -07:00
Alexandre Bury
2cae042a85 Add title to lorem example 2018-02-20 11:09:45 -08:00
Alexandre Bury
62260a025e Rustfmt 2018-02-16 17:21:24 -08:00
Alexandre Bury
daac2d67b4 Add Vec2::saturating_add(XY<isize>)
And uses it to fix crash in position example
2018-02-07 16:44:22 -08:00
SEGFAULT
9e591ef635 Moving Windows in StackView (#200)
* Inital draft of reposition code.

* throwing it all in git so I can show @gycos the mess I made

* Cleaning up the example and removing that garbage getter function from StackView. More thought needs to be applied to that API.

* modified stackview to locally draw background, currently every frame. Adjusted surrounding elements to mirror this change.

* fixed dirty flag on stackView to use a cell. Also added dirty events on window resize.

* Final code cleanup.

* Fixed all highlighted issues in PR #200
2018-02-07 16:25:00 -08:00
Alexandre Bury
5dfdeab6ae Fix clippy warnings 2018-01-22 14:47:56 -08:00
Alexandre Bury
da8310b076 Rustfmt 2018-01-22 14:37:27 -08:00
Alexandre Bury
06086fdeb0 Dialog::get_content now returns &AnyView 2018-01-22 13:45:00 -08:00
Alexandre Bury
98aff39904 Move View::as_any to separate trait AnyView 2018-01-22 11:50:25 -08:00
Alexandre Bury
1551fbb543 Add View::as_any and View::as_any_mut 2018-01-22 09:20:45 -08:00
Alexandre Bury
431285135f Make Palette directly an EnumMap
Removes the "colors" intermediate member.
2018-01-21 11:17:22 -08:00
Alexandre Bury
0097789d46 Add examples descriptions 2018-01-18 10:32:08 -08:00
Alexandre Bury
5ac0fce363 Refactor ColorStyle
Add the notion of PaletteColor to use a color from the palette.

Breaking change: most color styles are now methods rather than enum
variants.
2018-01-17 10:22:06 -08:00
Alexandre Bury
868e59a4fa Add comments to examples 2018-01-15 18:55:27 -08:00
Alexandre Bury
39405ba1ec Refactor spans and markup
We now use mostly indexed spans into a source string.
Indexed Spans can still be resolved to a string slice when needed.
2018-01-15 13:53:27 -08:00
Alexandre Bury
5dcce6a965 Fix example without markdown feature 2018-01-11 00:03:42 +01:00
Alexandre Bury
890b3f13e1 TextView: print styled spans of text 2018-01-10 23:58:29 +01:00
Alexandre Bury
f8588e74c1 Rustfmt 2018-01-09 15:17:49 +01:00
Alexandre Bury
d384cbdaf1 Allow menu leaves and delimiter in menubar 2018-01-09 14:37:40 +01:00
Alexandre Bury
e4cd68a4eb Rustfmt 2017-12-30 23:03:42 +01:00
Alexandre Bury
799ec812e4 Add TextContent and TextContentRef
To manage the model separately from the view.
2017-12-30 23:00:48 +01:00
Alexandre Bury
fd259bf32c Mines example: add help message 2017-12-16 14:41:15 +01:00
Alexandre Bury
7ae754ce8f Extended text_area example 2017-12-07 15:49:12 -08:00
Alexandre Bury
70906aa5de Add mines example 2017-11-29 02:11:11 -08:00
Alexandre Bury
0b5b6ceace Add mouse support to pancurses 2017-11-19 00:40:56 -08:00
Alexandre Bury
e3b0ecbbd9 Add links to example Readme 2017-11-17 14:28:18 -08:00
Alexandre Bury
6e56dc427c Add example Readme 2017-11-17 11:27:24 -08:00
Alexandre Bury
420454cc0f Better mouse scroll drag
Now saturates when to the top or left.
2017-10-14 21:50:08 -07:00
Alexandre Bury
f90621811c More rustfmt 2017-10-14 21:18:50 -07:00
Alexandre Bury
a5952d0741 Fix some mouse/scroll issues with SelectView and TextView 2017-10-13 17:53:39 -07:00
Alexandre Bury
111d593f55 Merge branch 'master' 2017-10-13 11:01:39 -07:00
Alexandre Bury
a4ca7bbf1e Rustfmt 2017-10-12 16:43:59 -07:00
Peter Kloss
759f57f1f8 fix some clippy warnings 2017-10-11 18:09:49 +02:00
Alexandre Bury
976728fd25 Use full-width window for key_codes example 2017-10-10 17:50:06 -07:00
Alexandre Bury
c7f995fd72 Larger window for key_codes example 2017-10-08 16:01:04 -07:00