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

Feature to maximize widgets #4931

Merged
merged 15 commits into from
Aug 26, 2024
Merged

Feature to maximize widgets #4931

merged 15 commits into from
Aug 26, 2024

Conversation

willmcgugan
Copy link
Collaborator

@willmcgugan willmcgugan commented Aug 24, 2024

Adds functionality to maximize widgets, which will show them full-screen in isolation.

  • The screen has a maximize method which maximizes the given widget. It is possible to maximize anything, but it seems most appropriate for focused widgets.
  • Widget subclasses can add a ALLOW_MAXIMIZE classvar to allow containers to be maximized. Handy for forms containing various inputs.
  • Adds a system command to maximize widgets.
Screen.Recording.2024-08-24.at.20.12.40.mov

@willmcgugan willmcgugan marked this pull request as draft August 24, 2024 19:56
@willmcgugan willmcgugan marked this pull request as ready for review August 25, 2024 10:56
@willmcgugan willmcgugan changed the title Maximize Feature to maximize widgets Aug 25, 2024
src/textual/app.py Show resolved Hide resolved
src/textual/containers.py Show resolved Hide resolved
src/textual/screen.py Show resolved Hide resolved
src/textual/screen.py Show resolved Hide resolved
src/textual/screen.py Outdated Show resolved Hide resolved
src/textual/screen.py Outdated Show resolved Hide resolved
src/textual/screen.py Outdated Show resolved Hide resolved
tests/snapshot_tests/test_snapshots.py Show resolved Hide resolved
src/textual/screen.py Outdated Show resolved Hide resolved
Copy link
Member

@darrenburns darrenburns left a comment

Choose a reason for hiding this comment

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

One suggestion for the docstring and one open question but LGTM.

Co-authored-by: Darren Burns <[email protected]>
@willmcgugan willmcgugan merged commit fba4773 into main Aug 26, 2024
20 checks passed
@willmcgugan willmcgugan deleted the maximize branch August 26, 2024 15:46
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.

2 participants