-
Notifications
You must be signed in to change notification settings - Fork 30
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
Merge formateli:onoffbutton into master to add OnOffButton #61
base: master
Are you sure you want to change the base?
Conversation
Hi everyone. |
I'll review tomorrow in more details, but there are a few things that I see are wrong with this widget, like taking in StringVar, IntVar or BooleanVar types for the variable, typos in the docstrings, and the name of the widget (should probably be ToggleButton instead, states are not on/off all the time). |
I followed the checkbutton widget as a guidance, which is in essence a toggle button too. The other name I considered for the widget was SwitchButton |
…awn again when style changes (ex: style.theme_use())
Thank you for your pull request! While I quite like the idea of having a widget like this, I'm not quite happy with how this widget looks. Personally, I'd prefer to have an implementation based on new UI elements and layouts with the Checkbutton at its core but the looks of a toggle. This would be quite a bit harder than a Canvas but it has the potential to look a lot better, possibly even themed if it could be integrated with Right now, the widget should at least have the following:
Particularly the anti-aliasing is a problem, though it is probably not impossible. Still, it would be slow when using a |
Hi, I agree that the widget does not look very good, it is a prototype and has no sense continue with it. |
Okay, so the way I envision it is this:
As a baseline you could use the images from a GTK theme, such as arc, though something a little more neutral may be more appropriate. If you can do the first part, I can do the second. Currently I am working on another Tkinter project so I won't have time to build such a |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #61 +/- ##
==========================================
+ Coverage 89.69% 89.79% +0.10%
==========================================
Files 36 37 +1
Lines 3725 3802 +77
==========================================
+ Hits 3341 3414 +73
- Misses 384 388 +4
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Thanks for your guidance. Once I had a better understanding of how styles work in the ttk widgets, I just had to derive the new OnOffButton from ttk.Checkbutton and create new element and layout for this class. |
PR Details:
Description
A simple On/Off button (aka switch button)
Checklist
/examples
/tests
AUTHORS.md