Compare commits

..

2 commits

Author SHA1 Message Date
outfoxxed
dacfa9de82
widgets/cliprect: use ShaderEffectSource to propagate mouse events
Some checks failed
Build / Nix-6 (push) Has been cancelled
Build / Nix-7 (push) Has been cancelled
Build / Nix-8 (push) Has been cancelled
Build / Nix-9 (push) Has been cancelled
Build / Nix-10 (push) Has been cancelled
Build / Nix-11 (push) Has been cancelled
Build / Nix-12 (push) Has been cancelled
Build / Nix-13 (push) Has been cancelled
Build / Nix-14 (push) Has been cancelled
Build / Nix-15 (push) Has been cancelled
Build / Nix-16 (push) Has been cancelled
Build / Nix-17 (push) Has been cancelled
Build / Nix-18 (push) Has been cancelled
Build / Nix-19 (push) Has been cancelled
Build / Nix-20 (push) Has been cancelled
Build / Nix-21 (push) Has been cancelled
Build / Nix-22 (push) Has been cancelled
Build / Nix-23 (push) Has been cancelled
Build / Nix-24 (push) Has been cancelled
Build / Nix-25 (push) Has been cancelled
Build / Nix-26 (push) Has been cancelled
Build / Nix-27 (push) Has been cancelled
Build / Nix-28 (push) Has been cancelled
Build / Nix-29 (push) Has been cancelled
Build / Nix-30 (push) Has been cancelled
Build / Nix-31 (push) Has been cancelled
Build / Nix-32 (push) Has been cancelled
Build / Nix-33 (push) Has been cancelled
Build / Archlinux (push) Has been cancelled
Lint / Lint (push) Has been cancelled
2026-02-09 19:14:36 -08:00
outfoxxed
4429c03837
widgets/cliprect: fix ShaderEffect warnings on reload
layer.effect causes warnings on reload for an unknown reason which
seems to be ownership or destruction time related. This commit uses
an alternate strategy to create the shader which does not show this
warning.
2026-02-08 20:10:11 -08:00

View file

@ -26,7 +26,7 @@ Item {
/// Defaults to true if any corner has a non-zero radius, otherwise false. /// Defaults to true if any corner has a non-zero radius, otherwise false.
property /*bool*/alias antialiasing: rectangle.antialiasing property /*bool*/alias antialiasing: rectangle.antialiasing
/// The background color of the rectangle, which goes under its content. /// The background color of the rectangle, which goes under its content.
property color color: "white" property /*color*/alias color: shader.backgroundColor
/// See @@QtQuick.Rectangle.border. /// See @@QtQuick.Rectangle.border.
property clippingRectangleBorder border property clippingRectangleBorder border
/// Radius of all corners. Defaults to 0. /// Radius of all corners. Defaults to 0.
@ -72,14 +72,21 @@ Item {
anchors.fill: parent anchors.fill: parent
anchors.margins: root.contentInsideBorder ? root.border.width : 0 anchors.margins: root.contentInsideBorder ? root.border.width : 0
} }
}
layer.enabled: true ShaderEffectSource {
layer.samplerName: "content" id: shaderSource
layer.effect: ShaderEffect { hideSource: true
fragmentShader: `qrc:/Quickshell/Widgets/shaders/cliprect${root.contentUnderBorder ? "-ub" : ""}.frag.qsb` sourceItem: contentItemContainer
property Rectangle rect: rectangle }
property color backgroundColor: root.color
property color borderColor: root.border.color ShaderEffect {
} id: shader
anchors.fill: root
fragmentShader: `qrc:/Quickshell/Widgets/shaders/cliprect${root.contentUnderBorder ? "-ub" : ""}.frag.qsb`
property Rectangle rect: rectangle
property color backgroundColor: "white"
property color borderColor: root.border.color
property ShaderEffectSource content: shaderSource
} }
} }