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:
Dave Pearson
2022-11-15 11:59:01 +00:00
parent 1f4c156eac
commit af1168b4ee
2 changed files with 258 additions and 262 deletions

View File

@@ -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