-
Notifications
You must be signed in to change notification settings - Fork 18
adding color properties #26
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
Conversation
Forgot to mention: this change resolves #25 |
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.
Tested using display_button_simpletest.py on:
WIO Terminal
and
M4 Express using a SSD1306 128x32 OLED Display
Works well on both
I read through the code and it looks like it solves the problem at hand. There are a couple of situations below that could cause unexpected behavior but I’m not sure it’s worth added complexity to resolve them. Here are three (probably low probability) situations to consider:
Even with all these comments above, this PR resolves the key issue that it is trying to solve. |
Great feedback thanks for having a look @kmatch98. Thank you @jposada202020 for trying it out! I think you are right the colors will not get updated properly while the button is selected. I will work on a fix for both of those today. I intended to leave the selected_color alone when updating the fill_color. I thought it might make it confusing if user was trying to set a different specific selected_color and fill_color but did them "out of order" and wound up overwriting their own selected_color with the new inverse. I think it would be great to expose an easy way for user code to set selected_color to the inverse in the same way it does if initialized as Or if it was a setter function instead of a property it could accept a default argument to control the automatic inverse -> selected_color behavior? |
Read through changes but did not verify on hardware. Good updates to the color setters to eliminate the unexpected behavior when selected or unselected. Looks good to me. |
Thank you both for looking into it. Going to merge this one to get ready for some other updates that will work with things in the new Layouts library better. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Button to 1.5.0 from 1.4.1: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#26 from FoamyGuy/color_properties Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.1.2 from 0.1.1: > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#3 from LuminousOwl/fix-pull-parsing
This adds properties to be able to change
fill_color
,outline_color
,label_color
, and their "selected" counterparts.Previously color changing did not take effect immediately, and many of relevant properties were private.
A new example
examples/display_button_color_properties
has been added to test and illustrate usage of the new properties