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

Add disable methods (and update to imgui 1.84.2) #519

Merged
merged 9 commits into from
Sep 14, 2021

Conversation

dbr
Copy link
Contributor

@dbr dbr commented Sep 13, 2021

Most of the interesting change is in the last commit b24b726 - rest is fairly mechanical updating to latest imgui upstream.

Although it's worth noting I did change how cargo xtask bindgen works, so it doesn't call cargo xtask fixmod - which @thomcc may have some opinion on? (although we should either keep this change, or change the docs/upgrading-imgui.md doc as the two contradict each other)

For the interesting part, there is token and closure based methods to disable widgets.

I think the only bit of some contention might be: I have an irrational rational dislike of double-/triple-negative boolean logic in code (e.g disabled(!false) then introduce a let not_enabled = ... 😢 ), thus I've included both enabled and disabled methods (similar to Qt's setEnabled(...) and setDisabled(...)). Arguably a little redundant, but I think it's worthwhile to include to improve easy-of-reading

@sanbox-irl
Copy link
Member

Letting thom know to check if they have time. I do hilariously have the same feeling actually on negative bools -- I often write == false instead of !false in if checks, which is a tendency I've had to avoid in this repo since I'm told it's a little idiosyncratic

dbr added 8 commits September 14, 2021 11:11
Previously if you checked out a different rev of imgui submodule, this would be clobbered

With this change, you can checkout any revision of imgui, run bindgen, build, test, then commit change to the submodule

The autofix is still available via 'cargo task modfix'
Changes required:
- Overloaded methods named slightly differently (e.g sys::igPlotHistogramFloatPtr to sys::igPlotHistogram_FloatPtr)
- ImGuiNavInput_KeyMenu_ was removed upstream, so NavInput::INTERNAL_COUNT needed tweaked
Also change oddly-specific test to avoid having to change it every update
@dbr
Copy link
Contributor Author

dbr commented Sep 14, 2021

Updated sans im_str 🥳

Copy link
Member

@thomcc thomcc left a comment

Choose a reason for hiding this comment

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

lgtm

@sanbox-irl
Copy link
Member

thank you dbr!

@sanbox-irl sanbox-irl merged commit 1e94b41 into imgui-rs:main Sep 14, 2021
@dbr
Copy link
Contributor Author

dbr commented Sep 15, 2021

Oh just realized the CHANGELOG needs updated to mention 1.84.2 (currently it only mentions the previous update to 1.82)

@dbr dbr deleted the disable branch September 15, 2021 01:05
@sanbox-irl
Copy link
Member

@dbr good memory. will add this to the tracking issue so I don't forget, but I'll be doing over the entire changelog/readme fairly extensively before release.

@sanbox-irl sanbox-irl mentioned this pull request Sep 15, 2021
4 tasks
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.

3 participants