-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
ProgressBar does not expose current #69
Comments
Easy enough to add to next relase. I might update the standalone ProgressBar library first, that is a much smaller project : https://github.com/goblinfactory/progress-bar watch that lib as well, depending what features you need. if you only need progress bar features, then that lib is much simpler. |
@goblinfactory if you do not mind I could create a PR for it. Like I said it should not take too much time to do it |
Nice! If you submit a PR for https://github.com/goblinfactory/progress-bar I'll review it tomorrow night and create a new nuget. That project is quite casual and simple. Unfortunately konsole wont be able to take PR's until I get a bunch of stuff done according to dotnet foundation guidelines, contributor agreements etc and I won't have time to look at that until this weekend when I'm on leave. |
Hi @MihailsKuzmins I've merged your PR in https://github.com/goblinfactory/progress-bar |
(give Nuget a few minutes to validate the package) |
@MihailsKuzmins I've created an alpha release for konsole with some progress bar improvements, including exposing .Current. https://www.nuget.org/packages/Goblinfactory.Konsole/6.3.0-alpha I've also added two new progress bar objects,
ProgressCharBar is a (no text) progressbar that automatically fills the width of the parent window to 100%. Here is an example of CharBar [Test]
public void show_percentage_correctly_25_perecent()
{
//begin-snippet: ProgressCharBar
// 'OpenBox' opens to fill the entire parent window.
// this test runs inside a mock console 22 chars wide, by 3 lines tall.
// hence the 22x3 box shown in the buffer below.
// -------------------------------------------
var box = Window.OpenBox("test progress");
// default color is green, default char is #
var pb = new ProgressCharBar(box, max: 4);
pb.Refresh(1);
_console.Buffer.Should().BeEquivalentTo(new[]
{
"┌─── test progress ──┐",
"│##### │",
"└────────────────────┘"
});
//end-snippet: ProgressCharBar
} As soon as you confirm this package is good enough and I have done some further testing, i will release a non alpha 6.3 update, and close this issue. |
Hey @goblinfactory (Alan) Instead of 6.3 I tested it with the latest version which was release a while ago (namely 7.3.). For my request it was perfect, I think that my issue has been solved, so you could close it as soon as the new release is published in NuGet. 🤞 |
Glad it works! Please note that version 7 has not been released yet, what you have fetched is an alpha release, so might be unstable. If you experience any issues let me know and i will try to address as quickly as possible. |
A class
ProgressBar
creates aProgressBarTwoLine
orProgressBarSlim
under the hood. Both of them have a field_current
, however, for the time being onlyProgressBarSlim
exposes the current value.Could it be possible that the class
ProgressBar
exposes it as well? This property could be added a get-only property toIProgressBar
. Does not look like a lot-to-do and it would be a handy property :)The text was updated successfully, but these errors were encountered: