-
Notifications
You must be signed in to change notification settings - Fork 18
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
Mutable height and width #27
Conversation
I reviewed the updated code and makes sense to me. Did not verify on hardware. Thanks @FoamyGuy for all this work on buttons! |
I did some hardware testing on the PyPortal and ran into a couple of things for clarification. I did a few checks of this latest button along with the The only major issue I found is the first one, the second are more topics for discussion or minor documentation things. I didn't check the reaction of the buttons, will add that to my todo list. Issue 1 - BugI ran this code and received an error.
Error message:
I think the issue is caused in Issue 2 - Handling text that doesn't fit inside the buttonIf the text won't fit into the button, the code crashes with
Issue 3 - Usage: I couldn't figure out how to use
|
I've updated to include a 1: good catch thank you! fixed in latest commits 2: I've updated it to to attempt to truncate the text to fit. Another potential option could be making use of the new wrap by pixels once it's merged. 3: I agree with both suggestions, but I think both the updated doc string, and more graceful error handling could come in another PR. 4: I think the ideal end goal would be "touch_down", "still_touch" and "touch_up/released" but I'm not sure that we can get there with out more of an event system fleshed out that will can "watch" the touch screen in the background and give us new data when we check. I think as it is now we could miss these states if the user doesn't call the "checking" function quick enough. I do like what you've laid out for selected and value I think. Though I'm not sure if we'll ultimately want to bring that into this button or not, it may not be backward compatible with the current way this works. I think it's definitely worth more discussion and brainstorming. 5: Button and Label (especially if it were made "clickable" via Widget) are indeed very similar concepts. I think the main specific difference at the moment is buttons ability to have different styles, and to have border color effects. In the future I see opportunity for an ImageButton or similar that makes the same kind of shapes as the button but allows Bitmap image instead of text. |
I verified the change and it works fine for me! Thanks for the updates on this button, now along with Looks good to me. |
The new PyLint check for duplicate lines caused this to fail when merged. I will hold off on the release until we have the fix for that. |
Updating https://github.com/adafruit/Adafruit_CircuitPython_DS18X20 to 1.3.4 from 1.3.3: > Merge pull request adafruit/Adafruit_CircuitPython_DS18X20#21 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_EPD to 2.8.0 from 2.7.2: > Merge pull request adafruit/Adafruit_CircuitPython_EPD#45 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.7.0 from 3.6.8: > Merge pull request adafruit/Adafruit_CircuitPython_GPS#54 from lesamouraipourpre/parse-gsa-and-gsv Updating https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display to 3.10.6 from 3.10.5: > Merge pull request adafruit/Adafruit_CircuitPython_RGB_Display#90 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1306 to 2.11.0 from 2.10.2: > Merge pull request adafruit/Adafruit_CircuitPython_SSD1306#57 from adamcandy/add-page-addressing-mode Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Button to 1.5.2 from 1.5.1: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#27 from FoamyGuy/resizeable_button Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 2.15.0 from 2.14.0: > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#111 from FoamyGuy/wrap_by_pixels Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.5.3 from 2.5.2: > Merge pull request adafruit/Adafruit_CircuitPython_LED_Animation#75 from adafruit/REUSE > Hardcoded Black and REUSE versions > Added pre-commit-config file > Added pre-commit and SPDX copyright Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.0.3 from 5.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#65 from brentru/update-cpython-example
height and width properties that can be set to update the size of the button.
These changes allow the button to be used with the GridLayout from: adafruit/Adafruit_CircuitPython_DisplayIO_Layout#2
in order to create a grid with different sized cells like this: