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

DisabledIf widget #1702

Merged
merged 14 commits into from
Apr 13, 2021
Merged

DisabledIf widget #1702

merged 14 commits into from
Apr 13, 2021

Conversation

xarvic
Copy link
Collaborator

@xarvic xarvic commented Apr 7, 2021

Adds a widget wrapper that disables the inner widget if the provided closure returns true.
For the moment the only effect is that the text boxes annotated with "(disabled)" can't be focused by pressing Tab. The visual changes and changes in behavior are implemented on the widgets themselves in a following PR.

Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Looks good. A few little notes and doc fixups, but nothing major!

druid/examples/disabled.rs Outdated Show resolved Hide resolved
druid/src/widget/disable_if.rs Show resolved Hide resolved
druid/src/widget/disable_if.rs Show resolved Hide resolved
druid/src/widget/widget_ext.rs Outdated Show resolved Hide resolved
druid/src/widget/widget_ext.rs Outdated Show resolved Hide resolved
Copy link
Member

@cmyr cmyr left a comment

Choose a reason for hiding this comment

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

Looks good!

druid/src/widget/widget_ext.rs Outdated Show resolved Hide resolved
druid/src/widget/disable_if.rs Outdated Show resolved Hide resolved
druid/examples/disabled.rs Outdated Show resolved Hide resolved
@cmyr
Copy link
Member

cmyr commented Apr 12, 2021

@xarvic I've invited you as a collaborator on this repo; you should feel free to merge your own PRs when they're approved and you're happy with them, and feel free to approve other PRs when you feel confident about the changes. :)

@xarvic
Copy link
Collaborator Author

xarvic commented Apr 12, 2021

Thanks :) How can I accept? I have not received an e-mail or a notification on Github

@xarvic xarvic merged commit 0c68463 into linebender:master Apr 13, 2021
@arifd
Copy link
Contributor

arifd commented Apr 29, 2021

So I'm playing around with cargo run --example disabled. Looks like this is not working. Nothing changes whether or not I click on the disabled checkbox.

@SecondFlight
Copy link
Collaborator

Same here. I'm on Windows 10 with the latest Druid@master.

@cmyr
Copy link
Member

cmyr commented May 3, 2021

I suspect that's because we need to land #1717, which implements the style changes.

@SecondFlight
Copy link
Collaborator

SecondFlight commented May 3, 2021

Works with #1717 👍

@arifd
Copy link
Contributor

arifd commented May 4, 2021

Sorry for my git-ignorance, but I'm pulling in: druid = { git = "https://github.com/linebender/druid.git", features = ["im", "image", "png"] } in my Cargo.toml.

Since it looks like #1717 has been merged, do I just have to cargo clean && cargo build and i'll get the benefit of #1717 or is there something more to do?

@SecondFlight
Copy link
Collaborator

cargo update is probably what you're looking for. My understanding is that cargo will lock unspecified git repos to a specific commit (stored in cargo.lock), and cargo update will bump it to the latest commit.

@arifd
Copy link
Contributor

arifd commented May 4, 2021

Aha! That did it. Thanks! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants