feat: colorful multi-accent quickshell design system
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A8TNMgnEa7Kia5Wcz2kyDx
This commit is contained in:
1 parent
2e8389d75c
commit
e6f6b5f09c
23 files changed
+1073
-577
No files matched your search
@@ -0,0 +1,54 @@
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import "."
|
||||
|
||||
// Bar-style pill chrome: rounded surface, border, optional colored glow.
|
||||
// Children are centered in an internal Row - place them directly as this
|
||||
// component's children, same as putting them in a Row.
|
||||
Rectangle {
|
||||
id: pill
|
||||
|
||||
property color tint: Theme.colors.border
|
||||
property bool glow: false
|
||||
// How strongly `tint` is mixed into the base surface color, so each
|
||||
// pill reads as its own tinted background instead of one flat surface
|
||||
// color with only the border/glow varying.
|
||||
property real tintStrength: 0.35
|
||||
default property alias content: contentRow.data
|
||||
|
||||
function blend(base, mix, amount) {
|
||||
return Qt.rgba(
|
||||
base.r + (mix.r - base.r) * amount,
|
||||
base.g + (mix.g - base.g) * amount,
|
||||
base.b + (mix.b - base.b) * amount,
|
||||
base.a
|
||||
);
|
||||
}
|
||||
|
||||
implicitWidth: contentRow.implicitWidth + Theme.geometry.padding * 2
|
||||
implicitHeight: contentRow.implicitHeight + Theme.geometry.padding
|
||||
height: implicitHeight
|
||||
radius: Theme.geometry.pillRadius
|
||||
color: blend(Theme.colors.surface, tint, tintStrength)
|
||||
border.color: tint
|
||||
border.width: 1
|
||||
|
||||
Behavior on color { ColorAnimation { duration: Theme.animation.durationNormal } }
|
||||
|
||||
Behavior on border.color { ColorAnimation { duration: Theme.animation.durationFast } }
|
||||
|
||||
layer.enabled: glow
|
||||
layer.effect: MultiEffect {
|
||||
shadowEnabled: true
|
||||
shadowColor: pill.tint
|
||||
shadowOpacity: Theme.elevation.low.opacity
|
||||
shadowBlur: Theme.elevation.low.blur
|
||||
shadowVerticalOffset: 1
|
||||
}
|
||||
|
||||
Row {
|
||||
id: contentRow
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.geometry.spacing
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user