reorganize repo: move shell sources into shell/, test scripts into test/
This commit is contained in:
parent
344c1f8512
commit
d6cd2f173a
60 changed files with 2 additions and 2 deletions
166
shell/modules/BarGroup.qml
Normal file
166
shell/modules/BarGroup.qml
Normal file
|
|
@ -0,0 +1,166 @@
|
|||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import "." as M
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
default property alias content: row.children
|
||||
|
||||
// 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)
|
||||
property bool leftEdge: false
|
||||
property bool rightEdge: false
|
||||
|
||||
readonly property real _tlr: leftEdge ? M.Theme.screenRadius : M.Theme.radius
|
||||
readonly property real _trr: rightEdge ? M.Theme.screenRadius : M.Theme.radius
|
||||
readonly property real _blr: M.Theme.radius
|
||||
readonly property real _brr: M.Theme.radius
|
||||
|
||||
visible: row.visibleChildren.length > 0
|
||||
|
||||
implicitWidth: row.implicitWidth + _pad * 2
|
||||
implicitHeight: M.Theme.barHeight - 3 - _pad
|
||||
|
||||
readonly property int _pad: M.Theme.groupPadding
|
||||
property bool _hovered: false
|
||||
|
||||
HoverHandler {
|
||||
onHoveredChanged: root._hovered = hovered
|
||||
}
|
||||
|
||||
// Frosted base — semi-transparent so the bar background bleeds through
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
topLeftRadius: root._tlr
|
||||
topRightRadius: root._trr
|
||||
bottomLeftRadius: root._blr
|
||||
bottomRightRadius: root._brr
|
||||
color: Qt.rgba(M.Theme.base01.r, M.Theme.base01.g, M.Theme.base01.b, 0.55)
|
||||
}
|
||||
|
||||
// Frost sheen — subtle white highlight, top-heavy
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
topLeftRadius: root._tlr
|
||||
topRightRadius: root._trr
|
||||
bottomLeftRadius: root._blr
|
||||
bottomRightRadius: root._brr
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: Qt.rgba(1, 1, 1, 0.07)
|
||||
}
|
||||
GradientStop {
|
||||
position: 0.5
|
||||
color: "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Accent tint
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
topLeftRadius: root._tlr
|
||||
topRightRadius: root._trr
|
||||
bottomLeftRadius: root._blr
|
||||
bottomRightRadius: root._brr
|
||||
gradient: Gradient {
|
||||
GradientStop {
|
||||
position: 0
|
||||
color: Qt.rgba(root.borderColor.r, root.borderColor.g, root.borderColor.b, 0.12)
|
||||
}
|
||||
GradientStop {
|
||||
position: 1
|
||||
color: "transparent"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Visible border
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "transparent"
|
||||
border.color: root.borderColor
|
||||
border.width: root._hovered ? 2 : 1
|
||||
topLeftRadius: root._tlr
|
||||
topRightRadius: root._trr
|
||||
bottomLeftRadius: root._blr
|
||||
bottomRightRadius: root._brr
|
||||
|
||||
Behavior on border.width {
|
||||
NumberAnimation {
|
||||
duration: 120
|
||||
}
|
||||
}
|
||||
|
||||
layer.enabled: root._hovered
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
shadowColor: root.borderColor
|
||||
shadowBlur: 1.0
|
||||
shadowVerticalOffset: 0
|
||||
shadowHorizontalOffset: 0
|
||||
}
|
||||
}
|
||||
|
||||
// Pulsing accent fill — hover glow breath
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
topLeftRadius: root._tlr
|
||||
topRightRadius: root._trr
|
||||
bottomLeftRadius: root._blr
|
||||
bottomRightRadius: root._brr
|
||||
color: Qt.rgba(root.borderColor.r, root.borderColor.g, root.borderColor.b, _pulse)
|
||||
visible: root._hovered
|
||||
|
||||
property real _pulse: 0.08
|
||||
SequentialAnimation on _pulse {
|
||||
running: root._hovered
|
||||
loops: Animation.Infinite
|
||||
NumberAnimation {
|
||||
to: 0.22
|
||||
duration: 700
|
||||
easing.type: Easing.InOutSine
|
||||
}
|
||||
NumberAnimation {
|
||||
to: 0.06
|
||||
duration: 700
|
||||
easing.type: Easing.InOutSine
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
id: row
|
||||
property color accentColor: root.borderColor
|
||||
anchors.centerIn: parent
|
||||
spacing: M.Theme.moduleSpacing + 2
|
||||
}
|
||||
|
||||
// Separator lines overlaid between visible row children
|
||||
Repeater {
|
||||
model: row.visibleChildren.length > 1 ? row.visibleChildren.length - 1 : 0
|
||||
|
||||
delegate: Rectangle {
|
||||
required property int index
|
||||
|
||||
readonly property Item _left: row.visibleChildren[index]
|
||||
readonly property real _rightEdge: _left ? _left.x + _left.width : 0
|
||||
|
||||
x: row.x + _rightEdge + row.spacing / 2
|
||||
y: row.y
|
||||
width: 1
|
||||
height: row.implicitHeight
|
||||
color: Qt.rgba(root.borderColor.r, root.borderColor.g, root.borderColor.b, 0.4)
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue