Compare commits

..

2 commits

Author SHA1 Message Date
Benjamin Palko
9fc91a92f7 add styling with animation speed 2025-09-05 15:48:24 -04:00
Benjamin Palko
f7e8fb7720 adjust theme on components 2025-09-05 15:15:17 -04:00
14 changed files with 75 additions and 38 deletions

View file

@ -5,7 +5,7 @@ Text {
color: Theme.palette.basecontent
Behavior on color {
ColorAnimation {
duration: 100
duration: Styling.animations.speed.fast
}
}
font.family: Theme.lucide.font.family

View file

@ -3,7 +3,6 @@ pragma ComponentBehavior: Bound
import qs.components
import qs.config
import qs.constants
import qs.widgets
import QtQuick
import QtQuick.Layouts
import Quickshell.Services.Mpris

View file

@ -1,7 +1,6 @@
import qs.components
import qs.constants
import qs.services
import qs.widgets
import QtQuick
import QtQuick.Layouts

View file

@ -12,12 +12,16 @@ Button {
horizontalPadding: 8
palette.button: hovered ? Theme.palette.primary : Theme.palette.base200
ColorAnimation on palette.button {
duration: 100
Behavior on palette.button {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
palette.buttonText: hoverEnabled && hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
ColorAnimation on palette.buttonText {
duration: 100
Behavior on palette.buttonText {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
wheelEnabled: true

View file

@ -28,26 +28,34 @@ RoundButton {
font: control.font
text: control.text
color: control.color
ColorAnimation on color {
duration: 100
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
rotation: control.rotation
RotationAnimation on rotation {
duration: 200
Behavior on rotation {
RotationAnimation {
duration: Styling.animations.speed.slow
easing.type: Easing.InOutCubic
}
}
}
background: Rectangle {
id: rect
border.color: control.hovered ? Theme.palette.base300 : Theme.palette.base200
ColorAnimation on border.color {
duration: 100
Behavior on border.color {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
border.width: 0
color: control.hovered ? Theme.palette.primary : Theme.palette.base200
ColorAnimation on color {
duration: 100
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
radius: control.radius
}

View file

@ -7,8 +7,9 @@ WrapperRectangle {
margin: 8
radius: 8
color: Theme.palette.base200
ColorAnimation on color {
duration: 200
easing.type: Easing.InOutQuad
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
}

View file

@ -1,3 +1,4 @@
import qs.config
import QtQuick
import QtQuick.Controls
@ -14,7 +15,7 @@ ListView {
rebound: Transition {
NumberAnimation {
properties: "x,y"
duration: 400
duration: Styling.animations.speed.slow
easing.type: Easing.BezierSpline
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
}

View file

@ -48,7 +48,7 @@ ProgressBar {
XAnimator on x {
from: control.width + rect.width
to: -rect.width
duration: 1000
duration: Styling.animations.speed.verySlow
loops: Animation.Infinite
running: control.indeterminate
}

View file

@ -19,13 +19,13 @@ Slider {
width: control.availableWidth
height: implicitHeight
radius: 8
color: Theme.palette.base100
color: Theme.palette.base200
Rectangle {
width: control.visualPosition * parent.width
Behavior on width {
NumberAnimation {
duration: 75
duration: Styling.animations.speed.fast
}
}
height: parent.height

View file

@ -40,14 +40,13 @@ Switch {
y: parent.height / 2 - height / 2
Behavior on x {
NumberAnimation {
duration: 100
duration: Styling.animations.speed.fast
}
}
width: parent.width / 2 - indicator.padding
height: parent.height - indicator.padding
radius: 16
color: control.checked ? Theme.palette.primary : Theme.palette.basecontent
// border.color: control.checked ? (control.down ? "#17a81a" : "#21be2b") : "#999999"
}
}

View file

@ -4,7 +4,9 @@ import QtQuick
Text {
font.family: Theme.fontFamily
color: Theme.palette.basecontent
ColorAnimation on color {
duration: 100
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.fast
}
}
}

View file

@ -14,6 +14,8 @@ ToolTip {
background: Rectangle {
radius: 8
color: Theme.palette.base200
color: Theme.palette.base100
border.color: Theme.palette.base200
border.width: 2
}
}

View file

@ -5,8 +5,9 @@ import Quickshell.Widgets
WrapperRectangle {
radius: 8
color: Theme.palette.base100
ColorAnimation on color {
duration: 200
easing.type: Easing.InOutQuad
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.fast
}
}
}

21
config/Styling.qml Normal file
View file

@ -0,0 +1,21 @@
pragma Singleton
import QtQuick
import Quickshell
Singleton {
id: root
readonly property Animations animations: Animations {}
component Animations: QtObject {
property AnimationSpeed speed: AnimationSpeed {}
}
component AnimationSpeed: QtObject {
property int veryFast: 50
property int fast: 100
property int normal: 200
property int slow: 400
property int verySlow: 1000
}
}