group colors match top gradient based on horizontal position
This commit is contained in:
parent
8e8d0e6fa5
commit
ec8672e837
2 changed files with 15 additions and 10 deletions
|
|
@ -1,12 +1,26 @@
|
|||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import "." as M
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
default property alias content: row.children
|
||||
property color borderColor: M.Theme.base02
|
||||
|
||||
// Auto-compute border color from top gradient position (base0C → base09)
|
||||
readonly property real _posFrac: {
|
||||
const scr = QsWindow.window?.screen;
|
||||
if (!scr) return 0.5;
|
||||
const gx = mapToGlobal(width / 2, 0).x - scr.x;
|
||||
return Math.max(0, Math.min(1, gx / scr.width));
|
||||
}
|
||||
property color borderColor: Qt.rgba(
|
||||
M.Theme.base0C.r + (M.Theme.base09.r - M.Theme.base0C.r) * _posFrac,
|
||||
M.Theme.base0C.g + (M.Theme.base09.g - M.Theme.base0C.g) * _posFrac,
|
||||
M.Theme.base0C.b + (M.Theme.base09.b - M.Theme.base0C.b) * _posFrac,
|
||||
1
|
||||
)
|
||||
|
||||
visible: row.visibleChildren.length > 0
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue