Commit Graph

43 Commits

Author SHA1 Message Date
Alexandre Bury
6e0819f723 Simplify Event enum
Now properly unify Alt/Ctrl/Shift handling
2016-07-10 18:27:26 -07:00
Alexandre Bury
9b2dec2a7f Use proper bounds for dialogs
Buttons height was not removed from the budget for get_min_size
2016-07-09 18:36:07 -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
cc72aa4ddc Better wide char support 2016-07-04 16:04:32 -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
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
80b219f34a Apply rustfmt 2016-06-27 22:10:59 -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
ac85a1f288 Fixed bug with dialog without buttons 2015-07-28 21:54:32 +02:00
Alexandre Bury
25a298a2eb Fix dialog layout and input 2015-06-08 22:24:59 -07:00
Alexandre Bury
d5a796a4cd Fix dialog button alignment 2015-06-08 15:11:36 -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
Alexandre Bury
a77a40558f Add some doc. 2015-06-03 15:36:51 -07:00
Alexandre Bury
781d9c1a03 Can now change dialog button alignment 2015-06-02 19:36:22 -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
6c6f929430 Better UTF-8 support in views
EditView, TextView, Dialog and Button should now properly display and
layout non-ascii text.
The lorem example now includes greek text to show this.
2015-05-28 17:32:28 -07:00
Alexandre Bury
3adb95c7ab Add support for Shift and Ctrl input
Careful: Ctrl-4 and ctrl-\ currently make ncurses crash.
Also some letters combine with Ctrl to make other codes. Run stty -a to
see some mappings.
Basically, you'll have issues with:
C,I,J,M,Q,S,Z
and non-letters.
2015-05-28 14:44:10 -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
abb09cf4bb Split style and color
Color is a color-pair
Style is an attribute, like Bold or Reversed
2015-05-26 21:45:00 -07:00
Alexandre Bury
5407c53545 Dialog gives focus to its content first 2015-05-26 17:10:47 -07:00
Alexandre Bury
44899bdcd6 Add/fix some doc 2015-05-26 16:48:27 -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
25e1ca6074 Rename Margins -> Vec4
And move it to the vec module
2015-05-25 14:56:51 -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
a2b4273589 Fix warnings 2015-05-23 17:11:58 -07:00
Alexandre Bury
081b7545b9 Remove viewpath in callbacks 2015-05-23 17:07:22 -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
d9652ac728 Add animated example. 2015-05-22 16:28:05 -07:00
Alexandre Bury
b2e52dc702 Add some (non-doc) comments. 2015-05-22 00:43:58 -07:00
Alexandre Bury
3df17cc64b Improved lorem example
TODO: add margins around the textview?
2015-05-22 00:06:33 -07:00
Alexandre Bury
25726140d8 Add colors and styles to printer 2015-05-21 23:29:49 -07:00
Alexandre Bury
919e60d4ce Add lines and boxes to printer.
Dialog now draws its box.
2015-05-20 10:31:38 -07:00
Alexandre Bury
7d301e1980 Add documentation 2015-05-19 17:31:52 -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
ca5c485847 Fix Button on_key_event
KEY_ENTER is actually almost never called. The return key sends the
ascii code for '\n' instead.
2015-05-19 10:58:42 -07:00
Alexandre Bury
04121414e1 Add proper draw and layout to Dialog 2015-05-18 19:41:35 -07:00
Alexandre Bury
68819c89bf Fixed variable case warnings 2015-05-18 15:31:55 -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