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
Alexandre Bury
d9652ac728
Add animated example.
2015-05-22 16:28:05 -07:00
Alexandre Bury
9b998b0dd4
Add missing documentation.
2015-05-20 11:11:55 -07:00
Alexandre Bury
c8136c67e0
Add focus system
...
May need to add a direction to take_focus
2015-05-19 15:54:11 -07:00
Alexandre Bury
04121414e1
Add proper draw and layout to Dialog
2015-05-18 19:41:35 -07:00
Alexandre Bury
1fcca9b3a9
Rename module vec2 -> vec
...
Margins may be moved to vec::Vec4 some day
2015-05-18 11:51:30 -07:00
Alexandre Bury
74f0fee9b6
Add Dialog skeleton
2015-05-16 14:02:15 -07:00
Alexandre Bury
e17ca97136
Add ViewPath and Cursive::find
...
Callbacks now include a path to the triggering view.
The Cursive root can find the View corresponding to a ViewPath.
In the future, ViewPaths may be returned when creating the layout.
2015-05-15 17:56:38 -07:00