fix bar group glow to not affect content text
This commit is contained in:
parent
dca0b7c217
commit
5f3864afba
1 changed files with 28 additions and 11 deletions
|
|
@ -2,20 +2,33 @@ import QtQuick
|
||||||
import QtQuick.Effects
|
import QtQuick.Effects
|
||||||
import "." as M
|
import "." as M
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
default property alias content: row.children
|
default property alias content: row.children
|
||||||
property color borderColor: M.Theme.base02
|
property color borderColor: M.Theme.base02
|
||||||
color: "transparent"
|
|
||||||
border.color: borderColor
|
|
||||||
border.width: 1
|
|
||||||
radius: M.Theme.radius
|
|
||||||
|
|
||||||
visible: row.visibleChildren.length > 0
|
visible: row.visibleChildren.length > 0
|
||||||
|
|
||||||
layer.enabled: true
|
implicitWidth: row.implicitWidth + _pad * 2
|
||||||
layer.effect: MultiEffect {
|
implicitHeight: row.implicitHeight + _pad * 2
|
||||||
|
|
||||||
|
readonly property int _pad: 6
|
||||||
|
|
||||||
|
// Shadow source — rendered offscreen, only its glow is visible
|
||||||
|
Rectangle {
|
||||||
|
id: shadowSource
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "transparent"
|
||||||
|
border.color: root.borderColor
|
||||||
|
border.width: 1
|
||||||
|
radius: M.Theme.radius
|
||||||
|
visible: false
|
||||||
|
}
|
||||||
|
|
||||||
|
MultiEffect {
|
||||||
|
source: shadowSource
|
||||||
|
anchors.fill: shadowSource
|
||||||
shadowEnabled: true
|
shadowEnabled: true
|
||||||
shadowColor: root.borderColor
|
shadowColor: root.borderColor
|
||||||
shadowBlur: 0.6
|
shadowBlur: 0.6
|
||||||
|
|
@ -23,10 +36,14 @@ Rectangle {
|
||||||
shadowHorizontalOffset: 0
|
shadowHorizontalOffset: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
implicitWidth: row.implicitWidth + _pad * 2
|
// Visible border (on top of the glow)
|
||||||
implicitHeight: row.implicitHeight + _pad * 2
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
readonly property int _pad: 6
|
color: "transparent"
|
||||||
|
border.color: root.borderColor
|
||||||
|
border.width: 1
|
||||||
|
radius: M.Theme.radius
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: row
|
id: row
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue