-
Notifications
You must be signed in to change notification settings - Fork 676
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
Create new ScrollBar
based on a new Scroll
and remove ScrollBarView/ScrollView
#2489
Comments
Also:
|
We need to decide whether the scrollbars will be inside the |
ahah I already can capture the mouse click in the VsDebugConsole_FIypdNdwhp.mp4 |
With negative bounds is working but I have to avoid drawing. VsDebugConsole_C5EmSaeNrU.mp4 |
Using the |
I would tend to agree that bars should be drawn inside, beginning from the inside of where Margin begins, and should not be included in width or height calculations. If padding is non-zero, they would thus be drawn in the padding area. Any margin would be beyond the bar.
|
It isn't so simples like that. Layout sub-views will be still needed because we are draw others views and they aren't totally always be accommodate in the padding area. If both scroll vertical and horizontal are visible then the width and the height are |
I need to decide what of the both properties could allow to have negative location. I started with the |
I already having it working on VsDebugConsole_uE0h67RM9F.mp4 |
See the difference if VsDebugConsole_a2BDBfZXLB.mp4 |
@tig, @tznind , @dodexahedron I need a final decision on which of both should using negative location. I'm using the Edit: |
I think using Question: How far are you going in changing existing sample code to use the built-in View scrolling with your PR? Similarly, what are you doing to light up new use-cases. For example, making it so that I ask because, until we do 3 or four use-cases like that I don't think we'll really know the answer to your question
I like this. It was how I envisioned it working. |
I wouldn't recommended rename it because when Bounds have negative location the Width/Height will be different than it's actually we know. So, they may really have different values from each other.
I have a lot of work of this and I'll open a PR asap, maybe today for you see what I'm doing. I'm not using a bool to show/hide the scroll bars but a enum of scroll bar type (None, Both, Vertical, Horizontal).
Yes I know, I'll try to submit a PR today if possible.
Good, we are in syntony. |
@tig I'll get rid of this constructor. Do you have any objection?
It will only have a default constructor and a
|
I don't understand why you are asking about this. I have no problem removing that constructor. However, to me, if But until I see your code, I have no idea how you're approaching this. |
Great.
I'm still using it to draw the bars. Have you other idea for that?
I'm struggling with some issues after I've merged from v2_developer, but I'm doing my best as possible. |
I see. That makes sense. I always ScrollBarView and ScrollView mixed up. |
Why would ScrollBarView need a "host"? Why isn't that just its SuperView? |
The SuperView is the Padding but the data is from the Parent. With the default constructor I want allow that any view can add it where the user want. I can remove the View parameter and in this case it will always added to the Padding but that will prevent it can be added into the Border. The host field will be only internal to identify the SuperView. |
I definately agree I'll wait to comment further until I see the code. But I do have one other suggestion: Feel free to clone |
I already created a |
I'm reopen this because I'm convinced that the WindowsTerminal_ECSMSxAgT4.mp4 |
View
ScrollBar
based on a new Scroll
and remove ScrollBarView/ScrollView
I've renamed this issue, and updated the proposed design in the first comment. Most of the other comments in this Issue are out-of-date, but useful historical context. |
This is a sub-issue of:
Requires
Bounds
->Viewport
: Content Scrolling inView
#3323Design
Scroll bar support will be based on three views:
ScrollBar
which is a composite of two buttons supporting continuous button press and aScroll
, which is just the "middle" part of a scroll bar.These views are described below.
Scroll
A new View that represents the "inside part" of a scroll bar, minus the arrow buttons
It should look like the existing
ScrollBarView
(but better).and
It should have the following fields/methods/events (roughly):
public Orientation Orientation {get ;set;}
- Determines the Orientation of the scroll.public int Size { get;set;}
- The size of content the scroll represents.public int Position { get; set;} - The position, relative to
Size`, to set the scrollbar at.public event PositionChanging
public event PositionChanged
public event SizeChanged
It'd be cool (but not required) for all the glyphs and styling to be configurable; similar to how
Slider.SliderStyle
works.The names/types of these should match
Slider
as much as is reasonable for consistency.It must not have any internal knowledge of
ScrollBar
or the other viewsScrollBar
contains.ScrollBar
A new View that is a composition of 3 subviews
public Button Decrease { get; set; }
- HasWantContinousButtonPressed
set to truepublic Button Increase { get; set; }
- HasWantContinousButtonPressed
set to truepublic Scroll Scroll { get; set; }
Exposes
public Orientation Orientation { get; set; }
. This is used to layout the 3 views correctly depending on orientation. Obvioulsy it also needs to change the glyph each of the two buttons have to be correct for orientation too.This will be just a regular View that can be added as a subview to another view. It will not need any of the
Host
complexity thatScrollBarView
has.Exposes:
public Orientation Orientation {get ;set;}
- Determines the Orientation of the scroll. A passthrough toscrollBar.Scroll.Orientation
.public int Size { get;set;}
- The size of content the scrollbar represents. Just a passthrough toscrollBar.Scroll.Size
.public int Position { get; set;} - The position, relative to
Size`, to set the scrollbar at.public event PositionChanging
public event PositionChanged
public event SizeChanged
Keyboard bindings for the most common operations should be included:
Key.UpArrow
,Key.DownArrow
,Key.LeftArrow
,Key.RightArrow
,Key.PageUp/Down
Specialized mouse code should not be needed because the 2
Button
s and theScroll
should "just work".View
changes requiredOnce
ScrollBar
is ready,View
can be modified to have two built-in scroll bars that can be enabled by the developer. These will wire in to the content scrolling support enabled in #3323.The two
ScrollBar
views will be added toPadding
using computed layout.Exposes:
public ScrollBar HoriztonalScrollBar { get; set ;}; // Actually created inside of
Padding`public ScrollBar VerticalScrollBar { get; set ;}; // Actually created inside of
Padding`We will expand
ViewportSettings
with more flags that control the behavior of the scroll bars:AutoHoriztonalScrollBar
,AutoVerticalScrollBar
, andAutoBothScrollBars
- when set auto show/hideWe should be able to use
Pos.Function()
to automatically ensure the bottom-right-corner is handled correctly depending onViewport
andContentSize
and the above settings.For a scroll bar to be visible the
Padding.Thickness
needs to be adjusted andScrollBar.Visible
needs to be set. UsingScrollBar.VisibleChanged
, we should be able to automatically adjustPadding.Thickness
when a developer setsHorizontalScrollBar.Visible = true/false
, etc...Delete
ScrollBarView
andScrollView
Once
ScrollBar
is ready, we will deleteScrollBarView
andScrollView
from the project, updating any built-in Views and Scenarios that use them.The text was updated successfully, but these errors were encountered: