Commit Graph

82 Commits

Author SHA1 Message Date
Alexandre Bury
b53e2a42bd Use better type for new_default macro
Again, `ty` is a better fit
2016-09-24 17:06:33 -07:00
Alexandre Bury
fa2ad3261b Make Backend methods not static anymore 2016-09-24 16:51:42 -07:00
Alexandre Bury
2e06dd70cb Apply rustfmt 2016-09-22 22:11:13 -07:00
Alexandre Bury
829dd77deb Add &Backend to Printer struct
Makes `::B` public but undocumented.
Backend is currently an immutable ref, may need to become
mutable to be more useful (will need to change the View trait)
2016-09-22 22:00:58 -07:00
Alexandre Bury
a5135a7aff Better documentation for view::Finder
Also adds `Finder::find_id`
2016-09-21 14:57:03 -07:00
Alexandre Bury
93980a7d0c Rename View::find -> View::find_any
And add the `Finder` trait on Views to provide a true `find`.
2016-09-21 11:33:44 -07:00
Alexandre Bury
d51772f714 EditView: move cursor on content change
To the end of the content.
2016-09-01 11:42:16 -07:00
Alexandre Bury
f7a3d821d1 Actually use Theme::{shadow,borders} when drawing
Also add the 8 light base colors
2016-08-04 17:27:04 -07:00
Alexandre Bury
9db3c87851 Add Cursive::set_theme method
Allow setting a theme without having to load a toml file.
2016-08-04 00:11:16 -07:00
Alexandre Bury
75c365451f Add initial TextArea 2016-08-02 00:32:16 -07:00
Alexandre Bury
fb10e58188 Move LinesIterator to utils module 2016-07-28 23:05:33 -07:00
Alexandre Bury
f87d0e7c5b Move views to new views module 2016-07-28 16:36:01 -07:00
Alexandre Bury
0643c50bd5 Add async-callback channel to Cursive
And remove it from ProgressBar
2016-07-26 10:13:36 -07:00
Alexandre Bury
6e021867ab ProgressBar now shows a percentage status
The label can be customized though `ProgressBar::with_label`.
2016-07-25 23:54:33 -07:00
Alexandre Bury
7283e7f3af Rustfmt 2016-07-25 13:39:10 -07:00
Alexandre Bury
e29511e757 Add ProgressBar
Also make Callback its own NewType to add comversion methods.
2016-07-24 23:01:09 -07:00
Alexandre Bury
10e072c140 Allow loading themes from content.
Made `load_theme` thake a `&str` and Added `load_theme_file`.
2016-07-24 16:56:22 -07:00
Alexandre Bury
2a4742f67b Use prelude in docs 2016-07-20 21:43:20 -07:00
Alexandre Bury
f28ac264f1 Add prelude import module
Update examples to use it.
2016-07-20 21:25:14 -07:00
Alexandre Bury
64d176ffa5 Add proper select popup placement
Added a popup select to the `list_view` example
2016-07-20 00:30:00 -07:00
Alexandre Bury
a1d0231e2c Make Menubar a proper View 2016-07-19 20:44:50 -07:00
Alexandre Bury
2065be3e88 Add some doc to the menu module 2016-07-19 20:28:34 -07:00
Alexandre Bury
05f66b8e1b Add macro'd Default implementations 2016-07-16 17:28:42 -07:00
Alexandre Bury
a22c92a1a1 Add ListView
Also added `examples/list_view.rs`.
2016-07-16 13:25:21 -07:00
Alexandre Bury
1010c825ae Added doc for event module 2016-07-14 23:25:32 -07:00
Alexandre Bury
91fdf96066 Add Direction enum
And add a Direction argument to take_focus
2016-07-14 22:23:06 -07:00
Alexandre Bury
7f17a4ff74 Don't expose single-item modules
Instead, pub-use it from the root.
2016-07-13 23:18:59 -07:00
Alexandre Bury
7f530e34b7 Add XY generic struct 2016-07-12 21:03:17 -07:00
Alexandre Bury
309c471a63 Add #![deny(missing_docs)]
And fill the appropriate missing ones
2016-07-11 20:26:33 -07:00
Alexandre Bury
c07e8b6aee Rustfmt 2016-07-10 19:11:21 -07:00
Alexandre Bury
6e0819f723 Simplify Event enum
Now properly unify Alt/Ctrl/Shift handling
2016-07-10 18:27:26 -07:00
Alexandre Bury
99bf28dfd6 Add needs_relayout method to View trait.
Purely optimization-focused trait (it is safe to ignore it entirely).
Allows view groups to take shortcuts if they know their children didn't
change since last time.
2016-07-10 17:41:49 -07:00
Alexandre Bury
4b095a0652 Apply rustfmt 2016-07-09 19:05:51 -07:00
Alexandre Bury
08ab18608b Clear the screen only on window resize and layer removal
Should actually also be done if a layer shrinks.
Luckily, clear can be called anytime, as draw() is the last action
performed in the event loop - so it's safe to clear the screen in any
event callback, or even during layout.
2016-07-09 18:49:37 -07:00
Alexandre Bury
2860467f29 Cache layout in TextView
Calling either get_min_size or layout will cache the results, so the
next call with the same constraints will not re-compute everything.
2016-07-09 18:23:58 -07:00
Alexandre Bury
8220fe529e Better menubar example
Added scrolling support, and left/right navigation
2016-07-02 19:37:38 -07:00
Alexandre Bury
1d54764cdb Working menubar example
Also update callback: use Rc instead of Box
2016-07-02 15:02:42 -07:00
Alexandre Bury
1863e48b07 Add MenuPopup view 2016-07-02 01:01:09 -07:00
Alexandre Bury
985009e51c More ncurses isolation
Also some renaming in the theme module
2016-06-30 23:38:01 -07:00
Alexandre Bury
5751a293e5 Push most ncurses-specific code into separate trait
Prepare backend change.

Still not isolated is the color setup in `theme`.
2016-06-29 17:37:51 -07:00
Alexandre Bury
d02c30ae9f Fix clippy warnings 2016-06-27 22:40:11 -07:00
Alexandre Bury
042e631d9f Add base for menubar
Cursive now has a global menubar, with a `select_menubar()` method.
2016-06-27 21:59:42 -07:00
Alexandre Bury
34f235daf0 Use UTF-8 drawing characters for printer methods
Instead of ncurses chtype.
2016-06-26 15:03:12 -07:00
Alexandre Bury
07c3c99e54 Update for new ncurses version 2016-03-15 15:39:08 -07:00
Alexandre Bury
36fbc1ce5b Add some convenient ID methods 2015-07-28 15:57:52 +02:00
Alexandre Bury
40af72a567 BugFix in LinearLayout
And add a simple linear example.
2015-06-08 12:23:36 -07:00
Alexandre Bury
df5ff808e3 Basic linear layout implementation
Not tested yet
2015-06-07 20:58:10 -07:00
Alexandre Bury
17e44652b8 Fix warning
Unused error reported.
2015-06-05 21:13:34 -07:00
Alexandre Bury
e5cb687990 Refactor themes and colors
And adds a theme example.
TODO: Shadow & Borders support
2015-06-05 18:26:40 -07:00
Alexandre Bury
cb523e88ae Fix doc-tests 2015-06-04 11:40:35 -07:00