-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Adafruit_GFX_Button & Adafruit_GFX changes: pressedcolor, radius, custom fonts. #347
Draft
IanBUK
wants to merge
20
commits into
adafruit:master
Choose a base branch
from
IanBUK:Radius
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- radius property to Adafruit_GFX_Button, to allow buttons to have different sized radius corners. 0 or less results in sharp corners - getLabel() function, exposes the current label. - drawButton can now show a different colour background when the button is pressed. - _pressedcolor field added to hold the background colour of a pressed button.. - new overrides to initButton to allow setting of pressedColor. - _maxlabellength used to hold the maximum length of the label - here increased to 40 characters. The property is used in the drawButton function, so changes need making purely to the static const int in the .h file. - drawButton now respects the current font, so the label is positioned correctly. Adafuit_GFX - getFont() function to get the current font. This allows the Button etc to change behaviour based on the font. e.g. in the Button, we can now better calculate the width of the label correctly and therefore position it better.
The build error is produced by clang, but it doesn't give any actual error detail. This code runs locally! How do I find out what clang is failing on? |
Clang seems to be ignoring my change. Is it looking at the wrong branch, or is it taking the previous commit as it's still running from the .h file changes?
finally decided to watch no longer |
Fix doxygen error
Finally...sorted it. I’m new to GitHub, I normally work with the MS stack and so had never heard of clang or doxygen. Apologies if I bored or frustrated you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds functionality to Adafruit_GFX_Button: setting a custom backcolour for when the button is pressed; setting the radius of the rounded corners and fixes an issue with using custom fonts on labels, along with allowing more than 9 characters on a label. The Adafruit_GFX class has been extended to include a getFont() function that exposes the current font.
Adafruit_GFX_Button:
Adafuit_GFX
getFont() function to get the current font. This allows the Button etc to change behaviour based on the font. e.g. in the Button, we can now better calculate the width of the label correctly and therefore position it better.