mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 00:46:39 +01:00
TODOs
This commit is contained in:
@@ -94,6 +94,9 @@ public class ListView : View
|
||||
private int _lastSelectedItem = -1;
|
||||
private int _selected = -1;
|
||||
private IListDataSource _source;
|
||||
// TODO: ListView has been upgraded to use Viewport and ContentSize instead of the
|
||||
// TODO: bespoke _top and _left. It was a quick & dirty port. There is now duplicate logic
|
||||
// TODO: that could be removed.
|
||||
//private int _top, _left;
|
||||
|
||||
/// <summary>
|
||||
@@ -250,10 +253,16 @@ public class ListView : View
|
||||
get => _source;
|
||||
set
|
||||
{
|
||||
if (_source == value)
|
||||
|
||||
{
|
||||
return;
|
||||
}
|
||||
_source = value;
|
||||
ContentSize = new Size (Viewport.Width, _source.Count);
|
||||
KeystrokeNavigator.Collection = _source?.ToList ();
|
||||
|
||||
ContentSize = new Size (Viewport.Width, _source?.Count ?? 0);
|
||||
Viewport = Viewport with { Y = 0 };
|
||||
KeystrokeNavigator.Collection = _source?.ToList ();
|
||||
_selected = -1;
|
||||
_lastSelectedItem = -1;
|
||||
SetNeedsDisplay ();
|
||||
@@ -317,6 +326,7 @@ public class ListView : View
|
||||
{
|
||||
if (_selected < Viewport.Y)
|
||||
{
|
||||
// TODO: The Max check here is not needed because, by default, Viewport enforces staying w/in ContentArea (View.ScrollSettings).
|
||||
Viewport = Viewport with { Y = Math.Max (_selected, 0) };
|
||||
}
|
||||
else if (Viewport.Height > 0 && _selected >= Viewport.Y + Viewport.Height)
|
||||
|
||||
@@ -670,7 +670,7 @@ Item 6",
|
||||
|
||||
private class NewListDataSource : IListDataSource
|
||||
{
|
||||
public int Count => throw new NotImplementedException ();
|
||||
public int Count => 0;
|
||||
public int Length => throw new NotImplementedException ();
|
||||
public bool IsMarked (int item) { throw new NotImplementedException (); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user