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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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

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
2 participants