-
Notifications
You must be signed in to change notification settings - Fork 55
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
DataView checkboxes #694
DataView checkboxes #694
Conversation
Codecov Report
@@ Coverage Diff @@
## master #694 +/- ##
==========================================
+ Coverage 39.72% 39.84% +0.11%
==========================================
Files 492 493 +1
Lines 27222 27259 +37
Branches 4134 4140 +6
==========================================
+ Hits 10815 10862 +47
+ Misses 15935 15930 -5
+ Partials 472 467 -5
Continue to review full report at Codecov.
|
return ( | ||
CheckState.CHECKED | ||
if model.get_value(row, column) | ||
else CheckState.UNCHECKED | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why the default get_check_state
doesn't return a DataViewGetError
like set_check_state
does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a default implementation that is almost always what you want: if the value has a check state, then it should be checked if the underlying value is truthy and unchecked if it is falsey.
By implementing it on the ABC we save repetition elsewhere (we do similar things for get text and get image, try to have a sane default for the getter).
Co-authored-by: Poruri Sai Rahul <rporuri@enthought.com>
I think that's everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if CI is also happy.
Note: Partially resolves #533 |
This PR adds support for checkboxes in the data view; and adds a bool value type that uses them.
The bool value type uses a different code path than the editable values because the checkboxes are always interactable and don't require a click to activate an editor.