-
-
Notifications
You must be signed in to change notification settings - Fork 669
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
[widget audit] toga.Button #1761
Merged
Merged
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
92fd082
Whitespace change to use as the starting point for a PR.
freakboy3742 d206715
Add changenote.
freakboy3742 9fdf46e
Fix tracing on Windows
mhsmith 38bd4d6
Migrate dummy widget tools to pytest.
freakboy3742 b541c09
Remove use of shadow attribute for button label.
freakboy3742 7077562
Convert Button tests to pytest.
freakboy3742 ec04ddc
Fix Android tests, get to 100% coverage.
freakboy3742 859ad48
Fix get_text implementation on gtk and winforms.
freakboy3742 f93158e
100% coverage on iOS.
freakboy3742 67f3374
Remove deprecated code from Button.
freakboy3742 ca8a760
Winforms to 100%.
freakboy3742 8a03783
GTK to 100%.
freakboy3742 37985ae
Winforms to 100%, no skips.
freakboy3742 2b9714e
Add test selection from the command line, and a slow mode.
freakboy3742 2ea497e
Fix and mark tests that aren't reliable
freakboy3742 c8e41b1
Updated dummy assertions to be simple functions.
freakboy3742 a07ebde
GTK Button color tests passing.
freakboy3742 e6c3096
Add a warning about UI animations.
freakboy3742 163fa97
Re-enable the button size test.
freakboy3742 8c24cbe
Correct handling of color for non-button widgets.
freakboy3742 df7c13e
Remove refresh calls that aren't needed any more.
freakboy3742 d1fdf8b
Removed the xfail marker from some tests.
freakboy3742 2e7f8d0
Modified the color test to assert all components in one assertion.
freakboy3742 da9c1ba
Use a programmatic approach to disable animations.
freakboy3742 50c4fee
iOS Button tests to 100%.
freakboy3742 4a2944f
iOS button to 100%.
freakboy3742 fe92bb9
Partial fixes for Android colors and fonts.
freakboy3742 73f0c5a
Implement `await redraw` for Android
mhsmith 2ff0e95
Fix Android font size calculation
mhsmith e6ed1c1
Fix button background color
mhsmith db63ecc
Modify font size and font handling.
freakboy3742 493e722
Add support for resetting foreground color.
freakboy3742 c3d5c8a
Ensure size probes return SP not DP.
freakboy3742 542faf7
Use del rather than assigning None to clear style.
freakboy3742 d3581ec
Don't allow newlines in button text.
freakboy3742 e1458ba
Correct label color tests.
freakboy3742 32451bd
Button at 100% on all tested platforms!
freakboy3742 c788a8c
Rework the EventLog so it is global.
freakboy3742 da5105a
Disallow empty labels on buttons.
freakboy3742 5bf1cbb
Revert a libs restructure.
freakboy3742 29924f0
More tweaks to the dummy test assertions.
freakboy3742 7e2bc2d
Removed a redundant background color implementation.
freakboy3742 8211f8b
Add notes about button text restrictions.
freakboy3742 8cd8531
Merge branch 'main' into audit-button
freakboy3742 857d899
Change `= None` tests to `del`, for compatibility with travertino mai…
mhsmith 7bd87a5
Fix Android font size, and add font size reset test
mhsmith 16ec542
Add memory retention for cached font instances.
freakboy3742 8bd9528
Merge branch 'system-ci' into audit-button
mhsmith e83f2fa
Allow default font to be returned as SANS_SERIF as well as SYSTEM
mhsmith 81e2d29
Add examples/font_size
mhsmith 02a345d
Add bold and italic font tests (working on Android, Cocoa and iOS)
mhsmith 9248973
Add bold and italic font tests (working on GTK and Winforms)
mhsmith 45e52e6
Remove redundant set_font methods in dummy widgets
mhsmith 8445dae
Merge branch 'main' into audit-button
freakboy3742 c646ef0
Improve comments
mhsmith e2da16b
Move generic font mapping assertions to tests_backend (Android, Cocoa…
mhsmith 926c3d6
Move generic font mapping assertions to tests_backend (GTK)
mhsmith 7f96efa
Move generic font mapping assertions to tests_backend (Winforms)
mhsmith 36ed554
Fix typos
mhsmith 091e3ec
Allow Button text to be set to an empty string, and make Winforms dis…
mhsmith dd73a9b
Use subclassing rather than an isinstance check.
freakboy3742 cfdc3e5
Revert the use of an interface state variable for button text.
freakboy3742 ce54201
Mark some classes with Test in the name as not-tests.
freakboy3742 5abe2f1
Tweak section heading.
freakboy3742 f76c90a
Modify the winforms button probe to do ZWS normalization.
freakboy3742 8f55716
Use correct zero width space character, and remove unnecessary workar…
mhsmith File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Partial fixes for Android colors and fonts.
- Loading branch information
commit fe92bb9bcc69a76628ef9270aa8e083ce29d4ebe
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from rubicon.java import JavaClass | ||
|
||
ColorStateList = JavaClass("android/content/res/ColorStateList") |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
from java import jclass | ||
|
||
from toga_android.libs.android import R__attr | ||
|
||
from .label import LabelProbe | ||
from .properties import toga_color | ||
|
||
|
||
# On Android, a Button is just a TextView with a state-dependent background image. | ||
class ButtonProbe(LabelProbe): | ||
native_class = jclass("android.widget.Button") | ||
|
||
@property | ||
def background_color(self): | ||
tint_list = self.native.getBackgroundTintList() | ||
if tint_list: | ||
return toga_color(tint_list.getColorForState([R__attr.state_enabled], 0)) | ||
else: | ||
return None |
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
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
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
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
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
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.
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.
To save us from working out what the system foreground color is, how about making this method save the original color when it's called for the first time, so it can restore it later?