Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions Panel.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import QtQuick.Effects
import QtQuick.Shapes
import Quickshell
import qs.Commons
import qs.Commons as Commons
import qs.Ui

// The pet's home: a card with the pet front and center, its needs as bars,
Expand Down Expand Up @@ -37,7 +38,7 @@ Panel {
readonly property bool ready: !!petService && petService.initialized === true
// Out roaming = not home: the plate stays empty while it plays outside.
readonly property bool petIsOut: ready && petService.roaming === true
readonly property color foreground: Color.popups.text
readonly property color foreground: Commons.Color.popups.text
readonly property string fontFamily: bar ? bar.fontFamily : Style.font.family

readonly property var needs: ready ? [
Expand Down Expand Up @@ -198,9 +199,9 @@ Panel {
width: parent.width
height: Style.space(150)
radius: Style.cornerRadius > 0 ? Style.space(10) : 0
color: Qt.alpha(Color.accent, 0.08)
color: Qt.alpha(Commons.Color.accent, 0.08)
border.width: 1
border.color: Qt.alpha(Color.accent, 0.25)
border.color: Qt.alpha(Commons.Color.accent, 0.25)

Text {
anchors.centerIn: parent
Expand Down Expand Up @@ -352,8 +353,8 @@ Panel {
fillGradient: LinearGradient {
x1: lightCone.mx; y1: lightCone.my
x2: lightCone.cx; y2: lightCone.cy
GradientStop { position: 0; color: Qt.alpha(Color.accent, 0.45 * decorItem.glow) }
GradientStop { position: 1; color: Qt.alpha(Color.accent, 0) }
GradientStop { position: 0; color: Qt.alpha(Commons.Color.accent, 0.45 * decorItem.glow) }
GradientStop { position: 1; color: Qt.alpha(Commons.Color.accent, 0) }
}
startX: lightCone.ax; startY: lightCone.ay
PathLine { x: lightCone.bx; y: lightCone.by }
Expand All @@ -371,7 +372,7 @@ Panel {
y: decorItem.height
width: decorItem.width * 0.75
height: Style.space(2)
color: Qt.alpha(Color.accent, 0.55)
color: Qt.alpha(Commons.Color.accent, 0.55)
}

Image {
Expand All @@ -385,7 +386,7 @@ Panel {
anchors.fill: decorImage
source: decorImage
colorization: 1
colorizationColor: Color.accent
colorizationColor: Commons.Color.accent
// Furniture stays in the background: dimmer than the pet.
opacity: 0.55
}
Expand All @@ -408,7 +409,7 @@ Panel {
return root.petService.stateAnim
}
frameMs: anim === "eat" ? 350 : 600
tint: Color.accent
tint: Commons.Color.accent

// Being scrubbed is wobbly business.
SequentialAnimation {
Expand Down Expand Up @@ -496,7 +497,7 @@ Panel {
Text {
id: sparkleItem
text: "✦"
color: Color.accent
color: Commons.Color.accent
font.pixelSize: Style.space(18)
opacity: 0

Expand Down Expand Up @@ -531,7 +532,7 @@ Panel {
visible: !root.petIsOut && !root.exiting && !root.entering && root.ready
&& root.petService.sleeping
text: "z z Z"
color: Color.accent
color: Commons.Color.accent
font.pixelSize: Style.space(16)
anchors.left: bigPet.right
anchors.leftMargin: -Style.space(6)
Expand Down Expand Up @@ -585,14 +586,14 @@ Panel {
source: panelEmoteImage
colorization: 1
// Same tint as the pet in the panel.
colorizationColor: Color.accent
colorizationColor: Commons.Color.accent
}
}

Text {
id: panelHeart
text: "♥"
color: Color.accent
color: Commons.Color.accent
font.pixelSize: Style.space(20)
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
Expand Down Expand Up @@ -737,7 +738,7 @@ Panel {
height: parent.height
radius: parent.radius
color: needRow.modelData.value >= 60
? Color.urgent : Color.accent
? Commons.Color.urgent : Commons.Color.accent

Behavior on width { NumberAnimation { duration: 300 } }
}
Expand Down Expand Up @@ -914,7 +915,7 @@ Panel {
anim: root.entering ? "idle" : "walk"
fallbackAnim: "idle"
frameMs: 220
tint: Color.accent
tint: Commons.Color.accent

property real slideToY: 0
}
Expand Down
15 changes: 8 additions & 7 deletions RoamWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Quickshell
import Quickshell.Wayland
import Quickshell.Hyprland
import qs.Commons
import qs.Commons as Commons

// The pet's playground: a transparent full-screen overlay where it wanders the
// bottom edge, climbs up the sides of windows whose top border leaves enough
Expand Down Expand Up @@ -562,8 +563,8 @@ PanelWindow {
fillGradient: LinearGradient {
x1: root.beamX; y1: root.beamTopY
x2: root.beamX; y2: root.petY
GradientStop { position: 0; color: Qt.alpha(Color.accent, 0.5 * beam.beamPulse) }
GradientStop { position: 1; color: Qt.alpha(Color.accent, 0.08 * beam.beamPulse) }
GradientStop { position: 0; color: Qt.alpha(Commons.Color.accent, 0.5 * beam.beamPulse) }
GradientStop { position: 1; color: Qt.alpha(Commons.Color.accent, 0.08 * beam.beamPulse) }
}
startX: root.beamX - root.spriteSize * 0.3
startY: root.beamTopY
Expand Down Expand Up @@ -603,7 +604,7 @@ PanelWindow {
// A climb without its dedicated sprite reuses the walk frames (rotated).
fallbackAnim: root.action === "climb" ? "walk" : "idle"
frameMs: asleep ? 1200 : (root.action === "idle" ? 500 : 220)
tint: Color.foreground
tint: Commons.Color.foreground
mirrored: root.facingLeft

// Click = pet; press-and-move = pick it up by the scruff and carry it.
Expand Down Expand Up @@ -718,7 +719,7 @@ PanelWindow {
source: emoteImage
colorization: 1
// Same tint as the pet, one creature one color.
colorizationColor: Color.foreground
colorizationColor: Commons.Color.foreground
}
}

Expand Down Expand Up @@ -767,7 +768,7 @@ PanelWindow {
anchors.fill: starImage
source: starImage
colorization: 1
colorizationColor: Color.foreground
colorizationColor: Commons.Color.foreground
}
}
}
Expand All @@ -776,7 +777,7 @@ PanelWindow {
Text {
text: "z z Z"
visible: root.petService && root.petService.sleeping
color: Color.foreground
color: Commons.Color.foreground
font.pixelSize: Math.max(11, root.spriteSize / 3)
x: root.petX + root.spriteSize
y: root.petY - root.spriteSize - height / 2
Expand All @@ -794,7 +795,7 @@ PanelWindow {
Text {
id: heart
text: "♥"
color: Color.accent
color: Commons.Color.accent
font.pixelSize: Math.max(12, root.spriteSize / 3)
x: root.petX + root.spriteSize / 2 - width / 2
opacity: 0
Expand Down