-
Notifications
You must be signed in to change notification settings - Fork 633
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
base: master
Are you sure you want to change the base?
Conversation
</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. |
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.
Are you going to fix this example in a followup?
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.
Yes I will create that later. If we are talking about an example showing a conditional item in a layout?
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.
No, we are talking about an example for opacity that show that opacity creates a layer, like what was in the 1.8 docs.
But that PR doesn't fix the issue fully. |
8d0674c
to
00ec1d7
Compare
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 { |
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 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
fixed: #7377