-
Notifications
You must be signed in to change notification settings - Fork 686
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
Fixes #2489. Create new ScrollBar based on a new Scroll and remove ScrollBarView/ScrollView #3498
base: v2_develop
Are you sure you want to change the base?
Conversation
I would appreciate the |
Ooooh! I'm super excited to review this! Will do asap. |
@tig how about you creating a new |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really slick!!
I've got a PR with some changes that you might like. I'll submit it vs. making a lot of comments.
Tweaks and suggestions
You mean being able to set the Normal.Background/Forground color for the View itself? Like the colorpicker in |
Yes or for the view passed on the |
@tig did you reorganize by placing the backfields before the properties by hand, or through some automatic system? I normally use R#'s Ctrl+E+C and it's not reformatting that way. |
By hand. It's still broken. |
Greet idea. I'll do it as part of #3376 where I've already completely re-done I also added the abilty to just click on any view in the Scenario and |
I just submitted another PR with quesitons / comments inline. |
Suggestions and questions
IMO, View sub-classes should not have the word "View" in them as a general principle. `
|
…o v2_2489_scroll-scrollbar-new
} | ||
|
||
/// <summary>Get or sets if the view-port is kept in all visible area of this <see cref="Scroll"/></summary> | ||
public bool KeepContentInAllViewport |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying to understand this.
In v1 there was a similarly named construct that was super confusing to me.
In the ContentScrolling work I did, I thought I addressed the user scenario that drove this with
/// <summary>
/// If set, <see cref="View.Viewport"/><c>.X</c> can be set values greater than <see cref="View.GetContentSize ()"/>
/// <c>.Width</c> enabling scrolling beyond the right
/// of the content area.
/// </summary>
/// <remarks>
/// <para>
/// When not set, <see cref="View.Viewport"/><c>.X</c> is constrained to <see cref="View.GetContentSize ()"/>
/// <c>.Width - 1</c>.
/// This means the last column of the content will remain visible even if there is an attempt to scroll the
/// Viewport past the last column.
/// </para>
/// <para>
/// The practical effect of this is that the last column of the content will always be visible.
/// </para>
/// </remarks>
AllowXGreaterThanContentWidth = 4,
/// <summary>
/// If set, <see cref="View.Viewport"/><c>.Y</c> can be set values greater than <see cref="View.GetContentSize ()"/>
/// <c>.Height</c> enabling scrolling beyond the right
/// of the content area.
/// </summary>
/// <remarks>
/// <para>
/// When not set, <see cref="View.Viewport"/><c>.Y</c> is constrained to <see cref="View.GetContentSize ()"/>
/// <c>.Height - 1</c>.
/// This means the last row of the content will remain visible even if there is an attempt to scroll the Viewport
/// past the last row.
/// </para>
/// <para>
/// The practical effect of this is that the last row of the content will always be visible.
/// </para>
/// </remarks>
AllowYGreaterThanContentHeight = 8,
Specifically:
The practical effect of this is that the last column of the content will always be visible.
Can you verify we are talking about the same end-user scenario:
"As a user, when using a ScrollBar to scroll through content, the last row/column of the content never scrolls beyond the visible area."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specifically:
The practical effect of this is that the last column of the content will always be visible.
Correct.
Can you verify we are talking about the same end-user scenario:
I think so.
"As a user, when using a ScrollBar to scroll through content, the last row/column of the content never scrolls beyond the visible area."
Correct. But imagine if a user want to use a scroll bar without a View
. But I may not being dealing with this right. What do you propose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct.
But imagine if a user want to use a scroll bar without a View. But I may not being dealing with this right. What do you propose?
If someone wants to use a scroll bar as a standalone View to control another View, and they want to ensure some content never gets scrolled out of visibility, they can code that up as needed. There's no need for ScrollBar to have that functionality.
I propose we don't have a KeepContentInViewport
-like property. AllowYGreaterThanContentHeight
should work for most mainline scenarios.
Haha! I was literally working on same thing this morning. I was up late last night thinking about this ;-). See how I used |
6cf29c6
to
cccbbc2
Compare
I think it's working much better now. When you have time please test it. Thanks. |
I think I do think you're correct that we need something more than just using Here's a suggestion: Add to public enum ViewportSettings
{
...
/// <summary>
/// If set, the vertical scroll bar (see <see cref="View.HorizontalScrollBar"/>) will be enabled and automatically made visible
/// when the dimension of the <see cref="View.Viewport"/> is smaller than the dimension of <see cref="View.GetContentSize()"/>.
/// </summary>
EnableHorizontalScrollBar = 64,
/// <summary>
/// If set, the vertical scroll bar (see <see cref="View.VerticalScrollBar"/>) will be enabled and automatically made visible
/// when the dimension of the <see cref="View.Viewport"/> is smaller than the dimension of <see cref="View.GetContentSize()"/>.
/// </summary>
EnableVerticalScrollBar = 128,
/// <summary>
/// If set, the horizontal and vertical scroll bars (see cref="View.HorizontalScrollBar"/> and <see cref="View.VerticalScrollBar"/>)
/// will be enabled and automatically made visible when the dimension of the <see cref="View.Viewport"/> is smaller than the
/// dimension of <see cref="View.GetContentSize()"/>.
/// </summary>
EnableScrollBars = EnableHorizontalScrollBar | EnableVerticalScrollBar This moves the automatic behavior out of If these flags are NOT set, then the developer can use What do you think of this idea? |
Updated CharMap.
Tweaked `CharMap` based on your latest
… into BDisp-v2_2489_scroll-tig-builtin
More Charmap scrollbar tweaks
… into BDisp-v2_2489_scroll-tig-builtin
Scroll related API doc and conceptual overview improvements
Can I just say how much I love the work @BDisp is doing in this PR? Love. Love. Love. |
@BDisp see my comment here: When you nuke the old ScrollView etc..., can you please take care of |
Fixes
ScrollBar
based on a newScroll
and removeScrollBarView/ScrollView
#2489Proposed Changes/Todos
Pull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)