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.
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
[widget audit] toga.Button #1761
Changes from 58 commits
92fd082
d206715
9fdf46e
38bd4d6
b541c09
7077562
ec04ddc
859ad48
f93158e
67f3374
ca8a760
8a03783
37985ae
2b9714e
2ea497e
c8e41b1
a07ebde
e6c3096
163fa97
8c24cbe
df7c13e
d1fdf8b
2e7f8d0
da9c1ba
50c4fee
4a2944f
fe92bb9
73f0c5a
2ff0e95
e6ed1c1
db63ecc
493e722
c3d5c8a
542faf7
d3581ec
e1458ba
32451bd
c788a8c
da5105a
5bf1cbb
29924f0
7e2bc2d
8211f8b
8cd8531
857d899
7bd87a5
16ec542
8bd9528
e83f2fa
81e2d29
02a345d
9248973
45e52e6
8445dae
c646ef0
e2da16b
926c3d6
7f96efa
36ed554
091e3ec
dd73a9b
cfdc3e5
ce54201
5abe2f1
f76c90a
8f55716
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This is definitely a good approximation; I only wonder if it might be worth introducing a fudge factor so that "12pt == 14sp" (i.e., "size in toga points" * 1.1666 == size in dp).
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.
(for the record - this is on the "strong opinion, weakly held" list; I won't give much pushback on a different fudge factor, or no fudge factor at all).
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.
Windows defaults to 8 points (see above), and according to the fonts.py files in the respective backends, Cocoa defaults to 12 points and iOS 17. So I don't see any strong reason to fix 12 as the default. Android is already within the range of the other platforms, and making 1 Toga pt = 1sp brings it closer to iOS, which is probably the one it's most useful to be consistent with.
In the long run I think the best solution to this issue is the CSS font size keywords, as mentioned above.
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.
Sure - that makes sense.
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.
Why is the default typeface part of the cache key?
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.
Because it may affect the resulting font when font_family is
SYSTEM
. The default font on most widgets issans-serif
, but on buttons it'ssans-serif-medium
, which is intermediate between normal and bold.