Skip to content
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 incorrect visible: false docs #7415

Merged
merged 6 commits into from
Feb 6, 2025
Merged

Conversation

NigelBreslaw
Copy link
Member

fixed: #7377

@NigelBreslaw NigelBreslaw requested a review from tronical January 21, 2025 10:56
@tronical tronical requested a review from ogoffart January 21, 2025 11:12
</SlintProperty>

### visible
<SlintProperty propName="visible" typeName="bool" defaultValue="true">
When set to `false`, the element and all his children won't be drawn and not react to mouse input.
When set to `false`, the element and all his children won't be drawn and not react to mouse input. The element
will still take up layout space within any layout container.

The following example demonstrates the `opacity` property with children. An opacity is applied to the red rectangle. Since the green rectangle is a child of the red one, you can see the gradient underneath it, but you can't see the red rectangle through the green one.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you going to fix this example in a followup?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I will create that later. If we are talking about an example showing a conditional item in a layout?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we are talking about an example for opacity that show that opacity creates a layer, like what was in the 1.8 docs.

@ogoffart
Copy link
Member

But that PR doesn't fix the issue fully.

@NigelBreslaw NigelBreslaw force-pushed the nigel/docs-visible-fix branch from 8d0674c to 00ec1d7 Compare January 21, 2025 13:46
@ogoffart
Copy link
Member

Is it not strange that the example for the opacity property is attached to the visibility property? Should it not be moved to the previous section?

:::
<CodeSnippetMD imagePath="/src/assets/generated/rectangle-opacity.png" scale="3" imageWidth="100" imageHeight="310" imageAlt='rectangle opacity'>
```slint playground
component ImageInfo inherits Rectangle {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example is fine. But it deosn't explain the layer approach.
Which mean that for example, if the Rectangle itself has an opacity, both we can see through both the image and the text, but we can't see the image through the text.

See the Qt documentation as a better explaination for what i'm trying to explain: https://doc.qt.io/qt-6/qml-qtquick-item.html#item-layers

We pretend to operate with a "Layered Opacity"

Unless we are using the software renderer, in which case this is currently implemented with a "Non-layered Opacity" which i consider a defect of the software renderer, but i don't know if we can/want to fix that without paying a price of quite a lot of memory

@NigelBreslaw NigelBreslaw force-pushed the nigel/docs-visible-fix branch from ea1caad to 7725275 Compare February 6, 2025 10:48
@NigelBreslaw
Copy link
Member Author

The latest change looks like this screenshot.
Screenshot 2025-02-06 at 12 48 50

@ogoffart
Copy link
Member

ogoffart commented Feb 6, 2025

Strange to show both layered opacity and non-layered opacity when only one is true.
Maybe the label should be "software renderer" and "other renderers"

@tronical: what do you think?

@tronical
Copy link
Member

tronical commented Feb 6, 2025

Strange to show both layered opacity and non-layered opacity when only one is true. Maybe the label should be "software renderer" and "other renderers"

@tronical: what do you think?

I think the purpose of the screenshot is not not explain differences in features in the software but rather the concept, i.e. what exactly we mean when saying "with layer opacity".

As it happens, we also use this to point out a deficiency of the software renderer, but that's one that we might eventually be able to fix, and then it's merely a matter of removing the sentence, not having to change to screenshot.

@NigelBreslaw NigelBreslaw merged commit 608f665 into master Feb 6, 2025
28 of 37 checks passed
@NigelBreslaw NigelBreslaw deleted the nigel/docs-visible-fix branch February 6, 2025 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong documentation for opacity
3 participants