-
-
Notifications
You must be signed in to change notification settings - Fork 669
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 textual dialogs #2092
Add textual dialogs #2092
Conversation
Co-authored-by: Katie McLaughlin <katie@glasnt.com>
super().__init__() | ||
self.interface = impl.interface | ||
self.impl = impl | ||
self.titlebar = TitleBar(title) |
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.
I noticed that the standard title bar expands when you click on it, which isn't really useful. Was that the reason for replacing it, or was there something else?
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.
The primary reason for replacing it was that Header()
can (AFAICT) only have the title of the app. That's great for the default title of a MainWindow, but useless for every other location where we might need a header (such as the titlebar of a dialog, or the titlebar or any other window - or changing the title of the main window. Removing the "thick" rendering was a bonus.
textual/src/toga_textual/window.py
Outdated
class CloseIcon(TextualWidget): | ||
DEFAULT_CSS = """ | ||
CloseIcon { |
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.
In the standard Textual header, I don't think this was intended to be a close button, but an application icon, as it's in the place where the icon would be on Windows.
Now that I'm a Mac user, I thought it was a close button too, and spent some time trying to work out why it didn't do anything. To avoid this confusion, maybe we'd be better off just removing it.
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.
That's a fair point - it's a decoration, but not a functional one.
I guess the alternative would be to make it functional... turn it into a button that does the close action on the window...
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.
Looks fine to me, except that the X on the close button was disappearing when you pointed at it, in both the VSCode terminal and the macOS terminal. It looks like this is caused by the border: none
property, so I've added that to the hover
block as well.
Add Info, Question, Confirm, Error, and Stack Trace dialogs for Textual.
Also corrects the 24/25 line aspect ratio calculation identified in this comment
PR Checklist: