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
22 changed files with 72 additions and 47 deletions

View file

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

View file

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

View file

@ -1,7 +1,6 @@
import qs.components import qs.components
import qs.constants import qs.constants
import qs.services import qs.services
import qs.widgets
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
@ -29,10 +28,10 @@ RowLayout {
const player = Mpris.active; const player = Mpris.active;
const displayName = player.identity ?? player.desktopEntry ?? player.dbusName ?? "unknown"; const displayName = player.identity ?? player.desktopEntry ?? player.dbusName ?? "unknown";
if (displayName.toLowerCase().includes('tidal')) { if (displayName.toLowerCase().includes('tidal')) {
return "Tidal"; return "Tidal";
} }
if (displayName.toLowerCase().includes('zen')) { if (displayName.toLowerCase().includes('zen')) {
return "Zen"; return "Zen";
} }
return displayName; return displayName;
} }

View file

@ -8,18 +8,19 @@ Button {
property alias radius: rectangle.radius property alias radius: rectangle.radius
font.pixelSize: 14 font.pixelSize: 14
padding: 6 verticalPadding: 6
horizontalPadding: 8
palette.button: hovered ? Theme.palette.primary : Theme.palette.base100 palette.button: hovered ? Theme.palette.primary : Theme.palette.base200
Behavior on palette.button { Behavior on palette.button {
ColorAnimation { ColorAnimation {
duration: 100 duration: Styling.animations.speed.normal
} }
} }
palette.buttonText: hoverEnabled && hovered ? Theme.palette.primarycontent : Theme.palette.basecontent palette.buttonText: hoverEnabled && hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
Behavior on palette.buttonText { Behavior on palette.buttonText {
ColorAnimation { ColorAnimation {
duration: 100 duration: Styling.animations.speed.normal
} }
} }

View file

@ -20,6 +20,6 @@ Drawer {
topRightRadius = 8; topRightRadius = 8;
} }
} }
color: Theme.palette.base200 color: Theme.palette.base100
} }
} }

View file

@ -15,9 +15,9 @@ RoundButton {
property int rotation: 0 property int rotation: 0
font.family: loader.font.family font.family: loader.font.family
font.pixelSize: 18 font.pixelSize: 19
radius: 8 radius: 8
padding: 6 padding: 8
HoverHandler { HoverHandler {
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
@ -30,13 +30,13 @@ RoundButton {
color: control.color color: control.color
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {
duration: 100 duration: Styling.animations.speed.normal
} }
} }
rotation: control.rotation rotation: control.rotation
Behavior on rotation { Behavior on rotation {
RotationAnimation { RotationAnimation {
duration: 200 duration: Styling.animations.speed.slow
easing.type: Easing.InOutCubic easing.type: Easing.InOutCubic
} }
} }
@ -44,17 +44,17 @@ RoundButton {
background: Rectangle { background: Rectangle {
id: rect id: rect
border.color: control.hovered ? Theme.palette.primary : Theme.palette.base100 border.color: control.hovered ? Theme.palette.base300 : Theme.palette.base200
Behavior on border.color { Behavior on border.color {
ColorAnimation { ColorAnimation {
duration: 100 duration: Styling.animations.speed.normal
} }
} }
border.width: 2 border.width: 0
color: control.hovered ? Theme.palette.primary : Theme.palette.base100 color: control.hovered ? Theme.palette.primary : Theme.palette.base200
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {
duration: 100 duration: Styling.animations.speed.normal
} }
} }
radius: control.radius radius: control.radius

View file

@ -6,11 +6,10 @@ WrapperRectangle {
id: root id: root
margin: 8 margin: 8
radius: 8 radius: 8
color: Theme.palette.base100 color: Theme.palette.base200
Behavior on color { Behavior on color {
ColorAnimation { ColorAnimation {
duration: 200 duration: Styling.animations.speed.normal
easing.type: Easing.InOutQuad
} }
} }
} }

View file

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

View file

@ -40,15 +40,15 @@ ProgressBar {
Row { Row {
Rectangle { Rectangle {
id: rect id: rect
color: Theme.palette.primary color: Theme.palette.primary
width: 40 width: 40
height: control.height height: control.height
} }
XAnimator on x { XAnimator on x {
from: control.width + rect.width from: control.width + rect.width
to: -rect.width to: -rect.width
duration: 1000 duration: Styling.animations.speed.verySlow
loops: Animation.Infinite loops: Animation.Infinite
running: control.indeterminate running: control.indeterminate
} }

View file

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

View file

@ -40,14 +40,13 @@ Switch {
y: parent.height / 2 - height / 2 y: parent.height / 2 - height / 2
Behavior on x { Behavior on x {
NumberAnimation { NumberAnimation {
duration: 100 duration: Styling.animations.speed.fast
} }
} }
width: parent.width / 2 - indicator.padding width: parent.width / 2 - indicator.padding
height: parent.height - indicator.padding height: parent.height - indicator.padding
radius: 16 radius: 16
color: control.checked ? Theme.palette.primary : Theme.palette.basecontent 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 { Text {
font.family: Theme.fontFamily font.family: Theme.fontFamily
color: Theme.palette.basecontent color: Theme.palette.basecontent
ColorAnimation on color { Behavior on color {
duration: 100 ColorAnimation {
duration: Styling.animations.speed.fast
}
} }
} }

View file

@ -1,8 +1,9 @@
import qs.config import qs.config
import QtQuick
import QtQuick.Controls import QtQuick.Controls
TextField { TextField {
color: Theme.palette.basecontent color: Theme.palette.basecontent
background: null background: Item {}
} }

View file

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

View file

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

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
}
}

View file

@ -32,11 +32,11 @@ PanelWindow {
Rectangle { Rectangle {
id: background id: background
anchors.fill: parent anchors.fill: parent
color: Theme.palette.base300 color: Theme.palette.base100
radius: Dimensions.radius radius: Dimensions.radius
border { border {
color: Theme.palette.base100 color: Theme.palette.base200
width: Dimensions.bar.border width: Dimensions.bar.border
pixelAligned: true pixelAligned: true
} }

View file

@ -6,7 +6,8 @@ import qs.services
StyledIconButton { StyledIconButton {
id: root id: root
border.color: Caffeine.enabled ? Theme.palette.secondary : root.hovered ? Theme.palette.primary : Theme.palette.base100 border.width: 2
border.color: Caffeine.enabled ? Theme.palette.secondary : root.hovered ? Theme.palette.primary : Theme.palette.base300
text: Icons.coffee text: Icons.coffee
onClicked: { onClicked: {

View file

@ -4,13 +4,14 @@ import qs.components
import qs.services import qs.services
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import Quickshell.Widgets
StyledDrawer { StyledDrawer {
id: root id: root
visible: Visibility.dashboard visible: Visibility.dashboard
StyledWrapperRectangle { WrapperItem {
margin: 32 margin: 32
ColumnLayout { ColumnLayout {
spacing: 8 spacing: 8

View file

@ -4,7 +4,6 @@ import "items"
import "services" import "services"
import qs.components import qs.components
import qs.config import qs.config
import qs.widgets
import Quickshell import Quickshell
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls

View file

@ -1,6 +1,7 @@
pragma ComponentBehavior: Bound pragma ComponentBehavior: Bound
import "services" import "services"
import qs.config
import qs.components import qs.components
import qs.constants import qs.constants
import qs.services import qs.services
@ -47,6 +48,8 @@ StyledWindow {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
margin: 4 margin: 4
color: Theme.palette.base200
RowLayout { RowLayout {
LucideIcon { LucideIcon {
id: icon id: icon

View file

@ -3,7 +3,6 @@ pragma ComponentBehavior: Bound
import qs.components import qs.components
import qs.config import qs.config
import qs.services import qs.services
import qs.widgets
import Quickshell.Hyprland import Quickshell.Hyprland
import Quickshell.Io import Quickshell.Io
import Quickshell.Wayland import Quickshell.Wayland
@ -28,7 +27,6 @@ StyledWindow {
StyledWrapperRectangle { StyledWrapperRectangle {
id: rect id: rect
color: Theme.palette.base300
margin: 14 margin: 14
radius: 8 radius: 8