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

Progress bar widget #141

Merged
merged 7 commits into from
Jan 4, 2020
Merged

Conversation

Songtronix
Copy link
Contributor

@Songtronix Songtronix commented Jan 2, 2020

This will add a very primitive progressbar:
image

What additionally can be done:

  • make it customizable by accepting colors.
  • allow the use of a border
  • optional label in the middle showing the percentage
  • make progressbar render on the web

@hecrj hecrj added the feature New feature or request label Jan 2, 2020
@hecrj hecrj added this to the 0.1.0 milestone Jan 2, 2020
@Songtronix Songtronix force-pushed the songtronix/progressbar-widget branch from af3817e to bf8f83d Compare January 2, 2020 13:25
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thank you. 🎉

I left some feedback, let me know what you think!

native/src/widget/progressbar.rs Outdated Show resolved Hide resolved
native/src/widget/progressbar.rs Outdated Show resolved Hide resolved
addtionally rename Progressbar to ProgressBar
@Songtronix Songtronix force-pushed the songtronix/progressbar-widget branch from a405cfe to 986f012 Compare January 2, 2020 17:12
@Songtronix
Copy link
Contributor Author

Songtronix commented Jan 3, 2020

Hmm I can't get the tour to compile to wasm. Either my setup is messed up or some dependency isn't wasm compatible anymore.

error[E0599]: no method named `as_sock` found for type `&std::net::TcpStream` in the current scope
   --> /home/songtronix/.cargo/registry/src/github.com-1ecc6299db9ec823/net2-0.2.33/src/ext.rs:855:25
    |
855 |         do_connect(self.as_sock(), addr)
    |                         ^^^^^^^ method not found in `&std::net::TcpStream`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `as_sock`, perhaps you need to implement it:
            candidate #1: `ext::AsSock`

@hecrj
Copy link
Member

hecrj commented Jan 3, 2020

This is probably a dev dependency, maybe surf? Rust will try to compile all the dev dependencies even if they are not used by the example you are trying to build.

Although it would be great to use a cross-platform HTTP client, maybe we could make the dev dependency conditional based on the target for the time being. This way, the examples that do not use it could still be compiled.

@Songtronix
Copy link
Contributor Author

Songtronix commented Jan 3, 2020

Okay disabling almost all dev dependencies helped. I'll try to get the progressbar working on the web.

@Songtronix
Copy link
Contributor Author

Songtronix commented Jan 3, 2020

Well implementing the progressbar for the web is harder than I thought, instead I've fixed the text_input for the web to support being a password field if required. (This fixes the tour example to be compiling again).

@Songtronix Songtronix changed the title [WIP] add progressbar widget add progressbar widget Jan 3, 2020
@Songtronix Songtronix requested a review from hecrj January 3, 2020 15:44
Also fixes some minor documentation issues.
@hecrj hecrj changed the title add progressbar widget Progress bar widget Jan 3, 2020
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved the DEFAULT_HEIGHT constant to the Renderer trait and fixed some minor documentation issues.

I will be happy to merge this in its current state. We can improve it and add iced_web support in further PRs.

Let me know what you think.

@Songtronix
Copy link
Contributor Author

Good idea to move the default height over to the render. I'm fine with merging it 👌

@hecrj hecrj merged commit 8311500 into iced-rs:master Jan 4, 2020
@Songtronix Songtronix deleted the songtronix/progressbar-widget branch January 4, 2020 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants