Skip to content
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

Draw progress bar when ProgressBarRenderer.IsSupported is false #4269

Merged
merged 2 commits into from
Nov 30, 2024

Conversation

HebaruSan
Copy link
Member

Problem

After #4255, my Ubuntu VM still had problems rendering LabeledProgressBar. An exception was thrown and the progress bar appeared as a white background with a red X on it.

Cause

ProgressBarRenderer has a boolean IsSupported property which is set based on the capabilities and configuration of the host system. If false, then the class's drawing methods throw exceptions instead of drawing. It must have been true on my main Ubuntu system, but it's clearly false in my VM.

Changes

Now if ProgressBarRenderer.IsSupported is false, we draw it with the PaintEventArgs.Graphics object instead of ProgressBarRenderer.

@HebaruSan HebaruSan added Bug Something is not working as intended Easy This is easy to fix GUI Issues affecting the interactive GUI Linux Issues specific for Linux Mono Issues specific for Mono labels Nov 30, 2024
@HebaruSan HebaruSan changed the title Draw progress bar when ProgresBarRenderer.IsSupported is false Draw progress bar when ProgressBarRenderer.IsSupported is false Nov 30, 2024
@HebaruSan HebaruSan merged commit 670f5dc into KSP-CKAN:master Nov 30, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/mono-progress-bars branch November 30, 2024 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Easy This is easy to fix GUI Issues affecting the interactive GUI Linux Issues specific for Linux Mono Issues specific for Mono
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant