Skip to content

Update simpletest example for touch "drag-outside" response #29

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

Merged
merged 4 commits into from
Mar 31, 2021

Conversation

kmatch98
Copy link

This is more of a stylistic change to highlight the button response, if you don't think it adds anything, I'm fine cancelling this PR.

Existing code:
When the button is pressed and the touch is dragged outside of the button, the button remains pressed. Only removing the touch from the screen will reset the button.

New code:
The button is cleared if the touch is dragged outside the button.

Minor edits:
Also, I had to clean up some doc-string pylint errors in the examples, and I made one update to use the pre-defined BUTTON_LABEL variable.

@kmatch98
Copy link
Author

kmatch98 commented Mar 3, 2021

Ok, the new pylint fixes have been implemented (for "duplicate code") and this is now passing. It's now ready for review.

@jposada202020
Copy link

@kmatch98 I stumble upon this in making my color "styles" new library research, I will be able to make a review when my new hardware arrives later this week. Thanks,

@jposada202020
Copy link

@kmatch98 Thanks for this. I tested this using

Adafruit CircuitPython 6.2.0-beta.4 on 2021-03-18; Adafruit PyPortal Titano with samd51j20

Works as mentioned in this PR. Not related with this PR, but an improvement that we could do these examples, the display width and height are hard-coded to 320/240, so we could use the display.width, and display.height value, this will allow for using the same code in different display. let me know if you could do it before we merge these changes. If not I can submit a new PR for this. :)
Thanks again

Copy link

@FoamyGuy FoamyGuy 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. Tested on PyPortal.

Thanks for this improvement and clarifying comments @kmatch98. Thanks for testing @jposada202020. We can make a new PR for using dynamic display sizing in the examples.

@FoamyGuy FoamyGuy merged commit b07d03c into adafruit:master Mar 31, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 1, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Button to 1.5.4 from 1.5.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Button#29 from kmatch98/master
  > "Increase duplicate code check threshold "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants