-
Notifications
You must be signed in to change notification settings - Fork 859
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
fix(border): fix flipped title colors in panel border #5553
fix(border): fix flipped title colors in panel border #5553
Conversation
Revert the change to the color flipping logic for `panel` border titles. The issue with the new method using `Style(reverse=True)` is that this will also flip any border title colors set with Textual CSS. Fixes Textualize#5548.
( | ||
(base_label_background + label_color) | ||
if label_color.a | ||
else TRANSPARENT | ||
), |
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.
This change effectively reverts to the original logic, which is necessary since the foreground/background is flipped for the panel border.
I wanted to flag this change in case there is something I've missed. While this did cause a couple of snapshot tests to fail, visually they looked identical.
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.
It's encouraging that no tests broke
The previous version added the border color, this version doesn't. I don't recall what, if anything, that was there for. I have a suspicion it is something to do with transparent borders. i.e. if the border color has alpha.
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.
Thanks for checking, I wasn't sure what the border color was there for either.
If the border title actually only sits on the border color for the panel/tab styles, maybe this isn't needed....?
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.
Wish I could go back in time and ask myself why I did that. If I didn't write a test for it, then it's probably safe.
( | ||
(base_label_background + label_color) | ||
if label_color.a | ||
else TRANSPARENT | ||
), |
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.
It's encouraging that no tests broke
The previous version added the border color, this version doesn't. I don't recall what, if anything, that was there for. I have a suspicion it is something to do with transparent borders. i.e. if the border color has alpha.
…-border
Thanks |
Revert the change to the color flipping logic for
panel
border titles.The issue with the new method using
Style(reverse=True)
is that this will also flip any border title colors set with Textual CSS.Fixes #5548.
Please review the following checklist.