mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Don't take transparent to imply not visible
This seeks to address #1175, where a containing widget with a transparent background, but with a border, won't show the border. It seems that at the heart of the Compositor it's taking `is_transparent` (of the widget) as one of the indicators that mean that it won't be visible. This wouldn't normally be the case, in that a widget could be transparent (in the background) but could have visible content. Note that some snapshot tests failed with this change, but no material difference was found in those failing snapshot tests.
This commit is contained in:
@@ -633,11 +633,7 @@ class Compositor:
|
||||
def is_visible(widget: Widget) -> bool:
|
||||
"""Return True if the widget is (literally) visible by examining various
|
||||
properties which affect whether it can be seen or not."""
|
||||
return (
|
||||
widget.visible
|
||||
and not widget.is_transparent
|
||||
and widget.styles.opacity > 0
|
||||
)
|
||||
return widget.visible and widget.styles.opacity > 0
|
||||
|
||||
_Region = Region
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user