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 RadioButtons widget #183

Merged
merged 5 commits into from
Mar 17, 2021
Merged

Conversation

tlambert03
Copy link
Member

This adds widgets.RadioButtons which has the same API as widgets.ComboBox (with the addition of an orientation parameter). Currently, only exclusive radio groups are supported.

shown here with horizontal orientation in a vertical layout:

Untitled

@codecov
Copy link

codecov bot commented Mar 12, 2021

Codecov Report

Merging #183 (ecef170) into master (16cda7c) will increase coverage by 0.01%.
The diff coverage is 83.75%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #183      +/-   ##
==========================================
+ Coverage   90.06%   90.07%   +0.01%     
==========================================
  Files          29       29              
  Lines        2908     2982      +74     
==========================================
+ Hits         2619     2686      +67     
- Misses        289      296       +7     
Impacted Files Coverage Δ
magicgui/backends/_qtpy/__init__.py 100.00% <ø> (ø)
magicgui/widgets/__init__.py 100.00% <ø> (ø)
magicgui/widgets/_protocols.py 99.44% <ø> (-0.01%) ⬇️
magicgui/backends/_qtpy/widgets.py 86.90% <81.15%> (-0.06%) ⬇️
magicgui/widgets/_bases/categorical_widget.py 83.87% <100.00%> (+3.22%) ⬆️
magicgui/widgets/_concrete.py 84.59% <100.00%> (+0.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16cda7c...ecef170. Read the comment docs.

Copy link
Contributor

@sofroniewn sofroniewn 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 to me! By default will you get the opposite orientation of the orientation of the main layout if possible? So always some combo of vertical + horizontal. Or is that maybe too magical? You could always fallback on a single default if nothing else makes sense

@tlambert03
Copy link
Member Author

By default will you get the opposite orientation of the orientation of the main layout if possible?

I was just gonna stick with vertical by default... someone won't like the magic :)

@sofroniewn
Copy link
Contributor

I was just gonna stick with vertical by default... someone won't like the magic :)

fine with me!

Copy link
Contributor

@jni jni left a comment

Choose a reason for hiding this comment

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

❤️

@tlambert03 tlambert03 merged commit 260f63e into pyapp-kit:master Mar 17, 2021
@tlambert03 tlambert03 deleted the radio-group branch March 17, 2021 00:24
@tlambert03 tlambert03 added the enhancement New feature or request label Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants