-
-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem?
In the AdvancedImageBox control for Avalonia, alternating grid colors are disabled based on scroll bar visibility. This is due to this condition:
UVtools/UVtools.AvaloniaControls/AdvancedImageBox.cs
Lines 1545 to 1565 in beda0ac
| if (ShowGrid & gridCellSize > 0 && (!IsHorizontalBarVisible || !IsVerticalBarVisible)) | |
| { | |
| // draw the background | |
| var gridColor = GridColor; | |
| var altColor = GridColorAlternate; | |
| var currentColor = gridColor; | |
| for (int y = 0; y < viewPortSize.Height; y += gridCellSize) | |
| { | |
| var firstRowColor = currentColor; | |
| for (int x = 0; x < viewPortSize.Width; x += gridCellSize) | |
| { | |
| context.FillRectangle(currentColor, new Rect(x, y, gridCellSize, gridCellSize)); | |
| currentColor = ReferenceEquals(currentColor, gridColor) ? altColor : gridColor; | |
| } | |
| if (Equals(firstRowColor, currentColor)) | |
| currentColor = ReferenceEquals(currentColor, gridColor) ? altColor : gridColor; | |
| } | |
| } |
I don't know what the reasoning is, but I find this behavior rather surprising as I don't expect background to change based on scroll bar visibility.
Describe the solution you'd like
Allow showing alternating grid background no matter the state of scroll bars.
If the app relies on this behavior, it can be achieved by binding ShowGrid or GridCellSize to !(IsHorizontalBarVisible && IsVerticalBarVisible) condition.
Files
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request