Commit Graph

57 Commits

Author SHA1 Message Date
Alexandre Bury
d7eaa5a086 Rename View::get_min_size -> required_size 2017-01-23 22:53:03 -08:00
Alexandre Bury
924c74afbe Add ScrollStrategy to TextView 2017-01-21 11:44:40 -08:00
Alexandre Bury
3b3f403f7a Apply rustfmt 2016-10-02 15:22:29 -07:00
Alexandre Bury
2e06dd70cb Apply rustfmt 2016-09-22 22:11:13 -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
7d16f70d67 Add some tests to view::position 2016-09-20 18:32:31 -07:00
Alexandre Bury
b38995b906 Refactor BoxView
Add `Boxable` trait.
2016-08-03 21:55:41 -07:00
Alexandre Bury
24e4e41a85 Move DummyView to views module 2016-07-29 23:36:40 -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
261d2aac48 Remove Ticker alias
The `Counter` NewType can fill this role.
2016-07-27 23:55:34 -07:00
Alexandre Bury
bea7240271 Wrap Arc<AtomicUsize> around NewType Counter
And offers a simpler API
2016-07-26 23:29:13 -07:00
Alexandre Bury
eb6b5d5728 Fix LinearLayout children width
Now properly gives the full width to every children.
2016-07-26 10:49:37 -07:00
Alexandre Bury
5dd20db676 Add Dialog::empty and Dialog::content
Allows to set the content after the title, for when it's more
readable.
2016-07-25 20:43:01 -07:00
Alexandre Bury
c1c9322319 Add panel view 2016-07-25 13:35:46 -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
0a8228d073 Add examples to documentation 2016-07-20 22:08:06 -07:00
Alexandre Bury
8b6022a398 Add popup mode to SelectView
Single-line, opens a popup on selection.
2016-07-19 23:47:27 -07:00
Alexandre Bury
a1d0231e2c Make Menubar a proper View 2016-07-19 20:44:50 -07:00
Alexandre Bury
d4afdf024f Add checkbox view 2016-07-16 17:22:24 -07:00
Alexandre Bury
5ee8706582 Add scrollable flag to TextViews 2016-07-16 17:08:17 -07:00
Alexandre Bury
a22c92a1a1 Add ListView
Also added `examples/list_view.rs`.
2016-07-16 13:25:21 -07:00
Alexandre Bury
2b54d6df28 Make View::draw take a &self (instead of a &mut self)
TrackedView, the only user of the mutability, now uses internal
mutability with a Cell.
2016-07-15 23:44:38 -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
1b34934df7 Fix printer::Printer imports 2016-07-13 23:25:54 -07:00
Alexandre Bury
5059e21cb1 Fix focus in LinearLayout
Focus now at least works. #42 is still open though.
2016-07-13 22:11:03 -07:00
Alexandre Bury
e166869c51 Add some documentation to view module 2016-07-13 20:52:24 -07:00
Alexandre Bury
03c400ad44 Fix linear layout in constrained space 2016-07-13 01:19:05 -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
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
1863e48b07 Add MenuPopup view 2016-07-02 01:01:09 -07:00
Alexandre Bury
1b1d7166a1 Replace SizeRequest with simple Vec2
We may go back to an enum though, to handle text views in LinearLayouts.
But the previous Fixed/AtMost/Unknown distinction was useless.
2016-07-02 00:47:38 -07:00
Alexandre Bury
c958093b74 Add TrackedView to cache the view size 2016-07-01 20:23:58 -07:00
Alexandre Bury
87cd1ce23f Add position parameter to stack view layers
Can be centered, absolute or relative to the previous layer.
Can be set independently for each axis.
2016-07-01 19:19:43 -07:00
Alexandre Bury
58bd274df0 Update Readme & run rustfmt 2016-06-25 16:39:05 -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
df11b4f1f0 Update documentation 2015-06-08 15:38:10 -07:00
Alexandre Bury
df5ff808e3 Basic linear layout implementation
Not tested yet
2015-06-07 20:58:10 -07:00
Alexandre Bury
cb523e88ae Fix doc-tests 2015-06-04 11:40:35 -07:00
Alexandre Bury
323805b52f Add scrolling to SelectView
Scrolling functionalities are stored in ScrollBase. Both TextView and
SelectView use it.
Also add letter search to SelectView (currently case sensitive).
And made the cities example bigger with a long list of capitals.
2015-05-31 16:38:53 -07:00
Alexandre Bury
6b781684ef Rename ListView -> SelectView
And added documentation.
2015-05-30 21:32:24 -07:00
Alexandre Bury
969650ab1a Add basic ListView
Show a selection among a list of items.
Maybe should be called SelectView?
TODO:
* Scrolling
* Error handling with empty list
* Action on Enter on an item
2015-05-30 21:05:34 -07:00
Alexandre Bury
f9c9e56518 Transform ncurses i32 key into Event enum
Prepares support for unicode char input spanning multiple ncurses
characters.
2015-05-27 18:04:33 -07:00
Alexandre Bury
e8fcaabd6c Add EditView
TODO: proper visualization:
* Display cursor when focused (instead of color change)
* Do not use HIGHLIGHT, but something like INVERTED
2015-05-26 15:48:35 -07:00
Alexandre Bury
dca9d7f662 Use usize for Vec2 instead of u32
Much less casts needed now.
2015-05-25 14:46:29 -07:00
Alexandre Bury
7e823435cd Stop using ncurses::WINDOW
Overlap is a mess. Let's do it ourselve.
2015-05-23 15:58:06 -07:00
Alexandre Bury
d9b56574d2 Add selector by ID 2015-05-23 10:33:29 -07:00