Blish-HUD
Blish-HUD copied to clipboard
Panel Scrollbar Update (clean)
Container.cs
Properties:
- added a _panelScrollbar property which is either null or the scrollbar of the container
- added a new public property ScrollPadding which determines the Padding on the left side of the Scrollbar
- added a new public bool property ScrollbarVisible which tells if the scrollbar is visible or not
- added a new public int property ScrollbarWidth which returns the current scrollbar width (0 if null)
- added a new public Point property MaxSize which lets you limit the size a container would get resized to
- added a new public int property MaxWidth which lets you limit the width a container would get resized to -> MaxSize.x
- added a new public int property MaxHeight which lets you limit the width a container would get resized to -> MaxSize.y
Methods:
- exclude the scrollbar from the Child handling of the container
- take MaxSize into account when resizing the container
- disposing the scrollbar on dispose
Scrollbar.cs
Properties:
- added a new public bool property Drawn which tells if the scrollbar is visible and drawn or not
- added a new public int property ScrollbarWidth which returns the scrollbar width
Panel.cs
Methods: RecalculateLayout
- updating the ScrollbarVisible property
- updating the _panelScrollbar if not null to match the container size
- updating _backgroundColorBounds to only color up to the scrollbar mid
UpdateScrollbar
- adjusted _panelScrollbar.Right to get the position right
FlowPanel.cs
Methods: all variants of ReflowChildLayout
- using the ContentRegion instead of the container bounds for layout calculations to avoid the scrollbar bounds
Control.cs
Properties:
- added a new protected rectangle property _backgroundColorBounds which sets the rectangle which would be colorized by BackgroundColor. If not set it will colorize the whole Control like it used to do. This is required to colorize not the whole panel but only until the mid of the scrollbar.
Methods: Draw
- take the _backgroundColorBounds over drawBounds if set
Oh well... Tbh then we might discard the whole PR. We've talked about it to implement it as a eventually temporary solution to the scrollbar overlapping the content, as I did not felt comfortable to adjust the scrollbar to "not be a control anymore".
The reason it is implemented as it is, is that it has to be within the control bounds to not be cut off.
Sizes had to update in order to adjust properly to window size if a window is resizeable.
As I've said, if this is not a solution you want to see implemented we can discard it, i will implement custom classes for my stuff until there is a fix.
I might look into it again, but before I do I really need to know how your solution has to look, but at that point it might be easier/better to let you deal with it.