perf: replace always-on bargroup shadow with hover-only glow
the MultiEffect shadow on every BarGroup was causing 8+ offscreen FBO renders on every bar redraw. now only activates on hover.
This commit is contained in:
parent
54f80f0da8
commit
b5e0f47b80
1 changed files with 13 additions and 23 deletions
|
|
@ -31,29 +31,10 @@ Item {
|
|||
implicitHeight: M.Theme.barHeight - 3 - _pad
|
||||
|
||||
readonly property int _pad: 6
|
||||
property bool _hovered: false
|
||||
|
||||
// Shadow source — rendered offscreen, only its glow is visible
|
||||
Rectangle {
|
||||
id: shadowSource
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
border.color: root.borderColor
|
||||
border.width: 1
|
||||
topLeftRadius: root._tlr
|
||||
topRightRadius: root._trr
|
||||
bottomLeftRadius: root._blr
|
||||
bottomRightRadius: root._brr
|
||||
visible: false
|
||||
}
|
||||
|
||||
MultiEffect {
|
||||
source: shadowSource
|
||||
anchors.fill: shadowSource
|
||||
shadowEnabled: true
|
||||
shadowColor: root.borderColor
|
||||
shadowBlur: 1.0
|
||||
shadowVerticalOffset: 0
|
||||
shadowHorizontalOffset: 0
|
||||
HoverHandler {
|
||||
onHoveredChanged: root._hovered = hovered
|
||||
}
|
||||
|
||||
// Frosted base — semi-transparent so the bar background bleeds through
|
||||
|
|
@ -104,7 +85,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
// Visible border
|
||||
// Visible border — glow on hover only
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
|
|
@ -114,6 +95,15 @@ Item {
|
|||
topRightRadius: root._trr
|
||||
bottomLeftRadius: root._blr
|
||||
bottomRightRadius: root._brr
|
||||
|
||||
layer.enabled: root._hovered
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
shadowColor: root.borderColor
|
||||
shadowBlur: 1.0
|
||||
shadowVerticalOffset: 0
|
||||
shadowHorizontalOffset: 0
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue