Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Variable progressbar length #745

Merged
merged 3 commits into from
Sep 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Nez.Portable/UI/Widgets/ProgressBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public override float PreferredWidth
return Math.Max(style.Knob == null ? 0 : style.Knob.MinWidth,
style.Background != null ? style.Background.MinWidth : 0);
else
return 140;
return PreferredLength;
}
}

Expand All @@ -29,13 +29,15 @@ public override float PreferredHeight
get
{
if (_vertical)
return 140;
return PreferredLength;
else
return Math.Max(style.Knob == null ? 0 : style.Knob.MinHeight,
style.Background != null ? style.Background.MinHeight : 0);
}
}

public float PreferredLength { get; set; } = 140;

public float Min { get; protected set; }
public float Max { get; protected set; }

Expand Down