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

Normalize naming of min/max arguments across widgets #2005

Merged
merged 15 commits into from
Jun 22, 2023

Conversation

freakboy3742
Copy link
Member

  • Slider now accepts min/max, rather than range.
  • NumberInput now uses min/max, rather than min_value/max_value
  • NumberInput now clips inconsistent min/max values
  • DateInput now uses min/max, rather than DatePicker.min_date/max_date
  • TimeInput now uses min/max, rather than TimePicker.min_time/max_time
  • Restores 100% core test coverage for DateInput and TimeInput (caused by a missing code path in the deprecation shim)
  • Restores 100% cocoa test coverage for Button (caused by the recent change to interpret default widget height as NONE, rather than 0)
  • Ports the toga.platform tests to pytest. Not sure why, but the introduction of the NotImplmented factory shim in Improve error message when a platform doesn't support a widget. #1992 caused local pytest runs to fail for me. Tox runs were fine; but since we needed to update the tests anyway, now was as good a time as any. This also corrects a minor issue with the definition of current_platform, and gets the module to 100% test coverage.

Backwards compatibility shims have been retained for old arguments, accessors and mutators.

Fixes #1999.

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

@freakboy3742 freakboy3742 mentioned this pull request Jun 21, 2023
4 tasks
@freakboy3742 freakboy3742 requested review from mhsmith and removed request for mhsmith June 21, 2023 06:46
core/src/toga/widgets/slider.py Show resolved Hide resolved
core/src/toga/widgets/slider.py Show resolved Hide resolved
core/src/toga/widgets/slider.py Outdated Show resolved Hide resolved
core/tests/widgets/test_dateinput.py Outdated Show resolved Hide resolved
core/src/toga/widgets/numberinput.py Show resolved Hide resolved
testbed/tests/widgets/test_textinput.py Show resolved Hide resolved
testbed/tests/widgets/test_slider.py Outdated Show resolved Hide resolved
testbed/tests/widgets/test_slider.py Show resolved Hide resolved
@freakboy3742 freakboy3742 merged commit 4fd883b into beeware:main Jun 22, 2023
@freakboy3742 freakboy3742 deleted the minmax branch June 22, 2023 22:32
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.

Min/max API consistency
2 participants