The new LabeledProgressBars from #4249 don't display correctly on Mono; the underlying progress bar graphic is never rendered, and changing the text doesn't erase previous iterations of it, so they end up all piled up on top of one another over a plain background. It's unreadable and unusable.
Cause
The strategy of adding a Label to ProgressBar.Controls was appealing because it allowed us to let text rendering be handled by code that's already an expert in it, but turning a Label transparent seems to rely too heavily on quirks of the specific Win32 graphics subsystems. Mono just does things a bit differently.
Changes
Now TransparentLabel.cs is deleted
Now LabeledProgressBar uses TextRenderer.DrawText to draw its own Text property in OnPaint rather than delegating this duty to a contained Label. This is a bit simpler and makes it work on Mono.
Now double buffering is enabled in the LabeledProgressBar to further reduce any remaining flickering
Problem
The new
LabeledProgressBar
s from #4249 don't display correctly on Mono; the underlying progress bar graphic is never rendered, and changing the text doesn't erase previous iterations of it, so they end up all piled up on top of one another over a plain background. It's unreadable and unusable.Cause
The strategy of adding a
Label
toProgressBar.Controls
was appealing because it allowed us to let text rendering be handled by code that's already an expert in it, but turning aLabel
transparent seems to rely too heavily on quirks of the specific Win32 graphics subsystems. Mono just does things a bit differently.Changes
TransparentLabel.cs
is deletedLabeledProgressBar
usesTextRenderer.DrawText
to draw its ownText
property inOnPaint
rather than delegating this duty to a containedLabel
. This is a bit simpler and makes it work on Mono.LabeledProgressBar
to further reduce any remaining flickering