Skip to content

Commit fd87be1

Browse files
committed
widgets/cliprect: pass user input to contained items
1 parent b6a79fe commit fd87be1

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/widgets/ClippingRectangle.qml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ Item {
1313
/// If content should be displayed underneath the border.
1414
///
1515
/// Defaults to false, does nothing if the border is opaque.
16-
property bool contentUnderBorder: false;
16+
property bool contentUnderBorder: false
1717
/// If the content item should be resized to fit inside the border.
1818
///
1919
/// Defaults to `!contentUnderBorder`. Most useful when combined with
2020
/// `anchors.fill: parent` on an item passed to the ClippingRectangle.
21-
property bool contentInsideBorder: !root.contentUnderBorder;
21+
property bool contentInsideBorder: !root.contentUnderBorder
2222
/// If the rectangle should be antialiased.
2323
///
2424
/// Defaults to true if any corner has a non-zero radius, otherwise false.
25-
property /*bool*/alias antialiasing: rectangle.antialiasing;
25+
property /*bool*/alias antialiasing: rectangle.antialiasing
2626
/// The background color of the rectangle, which goes under its content.
27-
property /*color*/alias color: shader.backgroundColor;
27+
property /*color*/alias color: shader.backgroundColor
2828
/// See @@QtQuick.Rectangle.border.
29-
property clippingRectangleBorder border;
29+
property clippingRectangleBorder border
3030
/// Radius of all corners. Defaults to 0.
3131
property /*real*/alias radius: rectangle.radius
3232
/// Radius of the top left corner. Defaults to @@radius.
@@ -41,10 +41,10 @@ Item {
4141
/// Visual children of the ClippingRectangle's @@contentItem. (`list<Item>`).
4242
///
4343
/// See @@QtQuick.Item.children for details.
44-
default property alias children: contentItem.children;
44+
default property alias children: contentItem.children
4545
/// The item containing the rectangle's content.
4646
/// There is usually no reason to use this directly.
47-
readonly property alias contentItem: contentItem;
47+
readonly property alias contentItem: contentItem
4848

4949
Rectangle {
5050
id: rectangle
@@ -60,8 +60,6 @@ Item {
6060
Item {
6161
id: contentItemContainer
6262
anchors.fill: root
63-
layer.enabled: true
64-
visible: false
6563

6664
Item {
6765
id: contentItem
@@ -74,9 +72,13 @@ Item {
7472
id: shader
7573
anchors.fill: root
7674
fragmentShader: `qrc:/Quickshell/Widgets/shaders/cliprect${root.contentUnderBorder ? "-ub" : ""}.frag.qsb`
77-
property Rectangle rect: rectangle;
78-
property color backgroundColor;
79-
property color borderColor: root.border.color;
80-
property Item content: contentItemContainer;
75+
property Rectangle rect: rectangle
76+
property color backgroundColor
77+
property color borderColor: root.border.color
78+
79+
property ShaderEffectSource content: ShaderEffectSource {
80+
hideSource: true
81+
sourceItem: contentItemContainer
82+
}
8183
}
8284
}

0 commit comments

Comments
 (0)