2
0
mirror of https://github.com/rivo/tview.git synced 2024-11-19 03:25:34 +00:00
Commit Graph

50 Commits

Author SHA1 Message Date
Daniel P. Berrangé
0bca6dadb3 Fix inverted handling of KeyPgDn/KeyPgUp in List widget
Consider a list with 5 items, and the currentItem index is 2, and
all items fit on the screen without scrolling.

KeyPgDn will set currentItem to 7 which is out of bounds, and
gets wrapped around to 0.

KeyPgUp will set currentItem to -3 which is out of bounds, and
gets wrapped around to 4.

Thus PgDn selects the first item, while PgUp selects the last item,
which is the opposite of expected behaviour for these keys. Fix
this by clamping currentItem to the boundaries in the key handler.

Fixes: https://github.com/rivo/tview/issues/580
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-15 18:40:20 +00:00
Oliver
ae9464cc35 Upgraded printing and style handling to the new definition of tcell.ColorDefault. 2021-03-12 18:48:52 +01:00
Oliver
dfabe788d4 Allowing list items to shift horizontally. Resolves #512, fixes #513 2021-02-15 18:26:27 +01:00
Oliver
675ed5b96b Removed Focusable interface. 2020-11-17 19:33:25 +01:00
Oliver
e4d167311d Upgraded to latest tcell version. Results in a minor incompatibility in the Table class. 2020-10-18 14:15:57 +02:00
rivo
ba71c7df7c
Merge pull request #418 from abitrolly/patch-2
Use List height for scrolling with PgUp/PgDn
2020-04-14 13:53:51 +02:00
Oliver
f395cf6e33 Added mouse scrolling to List, Table, TextView, and TreeView. 2020-03-29 21:36:06 +02:00
Oliver
9af6826328 Added/fixed comments, some structural changes/bugfixes for mouse support. Table, TextView, and TreeView still open. Closes #363 2020-03-27 18:41:44 +01:00
rivo
160d8fda1d
Merge pull request #363 from millerlogic/mouse-support
Mouse support
2020-03-26 19:28:51 +01:00
Anatoli Babenia
37ec5d08a6
Use List height for scrolling with PgUp/PgDn
Fixes #417.
2020-03-11 22:22:05 +03:00
Chris Miller
1fb9862c00 Separate action events 2020-02-28 01:19:36 +00:00
Oliver
ba670d23ba The inner area of a Box does not clamp to screen borders anymore. Consequently added some drawing optimization to primitives. Resolves #405 2020-02-19 18:31:32 +01:00
Trevor Slocum
babee1042c Fix panic when navigating empty list
Resolves #407.
2020-02-17 08:27:45 -08:00
Chris Miller
8abbf770ec Change mouse handler func 2020-02-14 02:09:09 +00:00
Chris Miller
9598ca2519 New mouse design
capture bool not finalized
2020-01-24 20:40:34 +00:00
Oliver
6e00e540f2 Added a wrap-around flag to the List. Resolves #380 2019-12-29 17:47:05 +01:00
Chris Miller
cd3c60e6d1 Refactor EventMouse 2019-11-05 09:19:40 +00:00
Chris Miller
93c0edc4a8 Get mouse actions rather than just mouse state 2019-11-05 06:03:04 +00:00
Chris Miller
d891191b78 Fire Selected on list item click 2019-11-04 06:55:58 +00:00
Chris Miller
d7250288e2 More mouse handling for primitives 2019-11-04 06:30:25 +00:00
Oliver
f63eca142c List changed event was not fired when SetCurrentItem() was called. Fixes #315 2019-07-11 11:37:27 +01:00
Oliver
8d5eba0c2f Replaced runewidth.StringWidth() with my own implementation. Fixes #236 2019-03-19 12:13:40 +01:00
Oliver
03d744dee3 SetOffset() also turns off end-tracking in Table. Fixes #238 2019-03-08 20:13:09 +01:00
ardnew
c43d107310 merge https://github.com/rivo/tview into list-spanhighlight, resolving conflicts for rivo/tview#220 2019-02-20 11:06:48 -06:00
ardnew
26ff9c763a renaming new struct field as requested in rivo/tview#220 2019-02-20 10:58:59 -06:00
Oliver
84fdb36408 Fixed confusing comments. Fixes #231 2019-01-24 13:01:53 +01:00
Oliver
0a179573ae Improved List scrolling (using an offset member variable). Fixes #217 2019-01-23 21:40:01 +01:00
Oliver
bbe0f17f96 Added FindItems() and InsertItem() to List. Also allowed negative indices for some List functions. Resolves #213, resolves #215 2019-01-12 21:22:58 +01:00
ardnew
e0f6e89550 change: added option to span selection highlight across width of list view 2019-01-03 00:51:11 -06:00
Oliver
08411f6e81 Added an option to List which hides the selection when List has no focus. Resolves #193 2018-11-26 11:00:48 +01:00
Oliver
2590cd6434 Added RemoveItem() function to List. Resolves #158 2018-09-05 12:57:35 +02:00
Oliver
7afc7ac893 Index out of range bugfix. Fixes #101 2018-05-18 23:46:33 +02:00
Rob Warner
2899c719ca Fix panic with empty list 2018-05-09 18:13:40 -04:00
Oliver
f291602d9a Added functions to retrieve and set a list item's texts. Resolves #102 2018-04-19 21:17:13 +02:00
Oliver
761e3d72da Added Primitive demo to go along with the GitHub Wiki entry on how to create your own primitive. 2018-03-19 21:25:30 +01:00
Oliver
b357eaf10f Drop-down allows typing to directly jump to options. Resolves #77 2018-03-18 20:42:51 +01:00
Oliver
7e4958256f List (and therefore also DropDown) will scroll if currently selected item is not on screen anymore. Fixes #71 2018-03-11 09:51:15 +01:00
Oliver
4db30f9ed4 "FieldLength" is now "FieldWidth" everywhere for clarity and consistency. Sorry for this breaking change. It is better in the long run. 2018-01-17 21:17:59 +01:00
Oliver
258f212e5e Added color tag functionality to all strings. Resolves #25 2018-01-17 17:13:36 +01:00
Oliver
626453b2a6 All primitives now offer a way to intercept all key events sent to them. Also made the global key event intercept handler more general/consistent. Resolves #22 2018-01-14 21:29:34 +01:00
Oliver
61d8ea30f8 Added support for wide unicode characters (e.g. Chinese). Resolves #9 2018-01-11 15:45:52 +01:00
Oliver
2874294d89 Added Styles variable with default colors for primitives. 2018-01-10 09:44:21 +01:00
Oliver
e4f97a6436 Added links to Wiki to documentation. Also replaced screenshot with GIF screencast. 2018-01-07 16:39:06 +01:00
Oliver
7b5ab63e8c List selections should be visible even when they don't have focus. Also added screenshot for Postgres demo. 2018-01-07 14:37:41 +01:00
Oliver
997b92f1b4 More callback handlers for lists. And more consistency. 2018-01-01 17:17:20 +01:00
Oliver
7dc0dace25 Improved table navigation. 2017-12-29 22:27:10 +01:00
Oliver
8f59d491ee Added Table primitive. Still ironing out some minor issues. 2017-12-26 01:07:30 +01:00
Oliver
8eb4c5ef48 Added TextView. All subclasses of Box now also have inside padding. 2017-12-21 18:08:53 +01:00
Oliver
2bd80aa513 Added DropDown. Also needed to refactor a bit to reduce dependencies. 2017-12-18 20:04:52 +01:00
Oliver
d5bf1a4ef0 Added list, improved existing primitives, and fixed a bunch of bugs. 2017-12-16 22:48:26 +01:00