Skip to content
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

Add "horizontal" and "vertical" aliases for align_items and justify_content #3113

Merged
merged 3 commits into from
Jan 21, 2025

Conversation

mhsmith
Copy link
Member

@mhsmith mhsmith commented Jan 19, 2025

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@mhsmith mhsmith requested a review from freakboy3742 January 19, 2025 23:29
@mhsmith
Copy link
Member Author

mhsmith commented Jan 19, 2025

I'll look at the MicroPython failure tomorrow, but any other review comments would be useful.

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation of the aliasing behavior makes sense; a couple of minor notes inline.

However, reading how this is documented (in the changenote and the docs for Pack), I've got some pedagogical concerns about this change. See #3113 for further discussion.

core/tests/style/pack/test_aliases.py Show resolved Hide resolved
core/tests/style/pack/test_aliases.py Show resolved Hide resolved
core/src/toga/style/pack.py Outdated Show resolved Hide resolved
changes/3111.feature.rst Outdated Show resolved Hide resolved
Comment on lines +27 to +31
try:
_all_properties = style_cls._BASE_ALL_PROPERTIES
except AttributeError:
# Travertino 0.3 compatibility
_all_properties = style_cls._ALL_PROPERTIES
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like MicroPython doesn't support the __init_subclass__ method used by BaseStyle, so this will have to be revisited once we start actually running Travertino on MicroPython rather than simply importing it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh -_-

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually turns out it's super simple, I can just replace the subclass_init with a pair of properties.

Co-authored-by: Russell Keith-Magee <[email protected]>
Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the clarifications in the discussion on #3111, I think this is now good to go.

@mhsmith mhsmith merged commit 1bc7002 into beeware:main Jan 21, 2025
41 checks passed
@mhsmith mhsmith mentioned this pull request Jan 21, 2025
4 tasks
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.

Explicit "horizontal" and "vertical" aliases for alignment properties
3 participants