Textualize / textual

The lean application framework for Python. Build sophisticated user interfaces with a simple Python API. Run your apps in the terminal and a web browser.
https://textual.textualize.io/
MIT License
25.2k stars 773 forks source link

Add classvar ESCAPE_TO_MINIMIZE #4951

Closed willmcgugan closed 1 month ago

willmcgugan commented 1 month ago

Fixes https://github.com/Textualize/textual/issues/4949

darrenburns commented 1 month ago

As mentioned, maybe this should be union of true/false/none. The value at App takes precedence. If the value is set (not None) at the Screen level, the the value from the Screen overrides.

willmcgugan commented 1 month ago

It could be done with a binding. But it would place a burden on the dev not to break it, and to do the right thing if they want to bind escape for something else. Maybe we could add something to the binding system to make that a non-issue in the future, but I don't know what that would look like.