-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TableView
- Upgrade to use Content Area for scrolling
#3822
Comments
TableView horizontal scrolling is by table column not characters. Does the new ScrollBar support 'virtual' viewport units which do not have to match directly to runes? One of the core principles for TableView is not having to calculate the content area. Instead it lays out content starting at the current row/col offset until it runs out of screen space. This is done for performance - in order to support basically unlimited table sizes (e.g. for CSV browsing or other use cases). |
Yep! See how CharMap does it (where each column is 3 wide).
Not a problem. Initialy call SetContentSize with a height +1. Whenever a row is added or the Viewport changes because the user has scrolled one past the end, just call SetContentSize() with a Height++. |
Or, just do 2). However, I'm quite confident if you do 1) you'll end up removing a TON of code from the class... |
Oh, and I just added this to /// <summary>
/// If set and <see cref="View.Viewport"/><c>.Width</c> is greater than <see cref="View.GetContentSize ()"/>
/// <c>.Width</c> <see cref="View.Viewport"/><c>.X</c> can be negative.
/// <para>
/// When not set, <see cref="View.Viewport"/><c>.X</c> will be constrained to non-negative values when
/// <see cref="View.Viewport"/><c>.Width</c> is greater than <see cref="View.GetContentSize ()"/>
/// <c>.Width</c>, preventing
/// scrolling beyond the left of the Viewport.
/// </para>
/// <para>
/// This can be useful in infinite scrolling scenarios.
/// </para>
/// </summary>
AllowNegativeXWhenWidthGreaterThanContentWidth = 16,
/// <summary>
/// If set and <see cref="View.Viewport"/><c>.Height</c> is greater than <see cref="View.GetContentSize ()"/>
/// <c>.Height</c> <see cref="View.Viewport"/><c>.Y</c> can be negative.
/// <para>
/// When not set, <see cref="View.Viewport"/><c>.Y</c> will be constrained to non-negative values when
/// <see cref="View.Viewport"/><c>.Height</c> is greater than <see cref="View.GetContentSize ()"/>
/// <c>.Height</c>, preventing
/// scrolling above the top of the Viewport.
/// </para>
/// <para>
/// This can be useful in infinite scrolling scenarios.
/// </para>
/// </summary>
AllowNegativeYWhenHeightGreaterThanContentHeight = 32, The reason I disabled this behavior by default is most use-cases do not want scrolling way beyond content. |
Once #3820 is done, which fixes
ScrollBar
based on a newScroll
and removeScrollBarView/ScrollView
#2489we will want to upgrade
TableView
to supportScrollBar
. There are two approaches:TableView
to utilize the virtual content scrolling now built intoView
viaViewport
,ViewportSettings
, andSetContentSize()
.View.HorizontalScrollBar/VerticalScrollBar
manually.The former is a far better solution and should not be too hard to accomplish.
The text was updated successfully, but these errors were encountered: