move theme to styling

This commit is contained in:
Benjamin Palko 2025-09-05 17:30:09 -04:00
parent 467c9bc0e3
commit 4375f6e13d
36 changed files with 68 additions and 67 deletions

View file

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

View file

@ -11,13 +11,13 @@ Button {
verticalPadding: 6
horizontalPadding: 8
palette.button: hovered ? Theme.palette.primary : Theme.palette.base200
palette.button: hovered ? Styling.theme.primary : Styling.theme.base200
Behavior on palette.button {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
palette.buttonText: hoverEnabled && hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
palette.buttonText: hoverEnabled && hovered ? Styling.theme.primarycontent : Styling.theme.basecontent
Behavior on palette.buttonText {
ColorAnimation {
duration: Styling.animations.speed.normal

View file

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

View file

@ -6,7 +6,7 @@ RoundButton {
id: control
property alias border: rect.border
property color color: hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
property color color: hovered ? Styling.theme.primarycontent : Styling.theme.basecontent
property int rotation: 0
font.family: Styling.lucide.font.family
@ -39,14 +39,14 @@ RoundButton {
background: Rectangle {
id: rect
border.color: control.hovered ? Theme.palette.base300 : Theme.palette.base200
border.color: control.hovered ? Styling.theme.base300 : Styling.theme.base200
Behavior on border.color {
ColorAnimation {
duration: Styling.animations.speed.normal
}
}
border.width: 0
color: control.hovered ? Theme.palette.primary : Theme.palette.base200
color: control.hovered ? Styling.theme.primary : Styling.theme.base200
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.normal

View file

@ -6,7 +6,7 @@ WrapperRectangle {
id: root
margin: 8
radius: 8
color: Theme.palette.base200
color: Styling.theme.base200
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.normal

View file

@ -5,8 +5,8 @@ import QtQuick.Controls
Menu {
id: root
palette.window: Theme.palette.base100
palette.base: Theme.palette.base100
palette.window: Styling.theme.base100
palette.base: Styling.theme.base100
focus: true
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent

View file

@ -3,7 +3,7 @@ import QtQuick
import QtQuick.Controls
MenuItem {
palette.text: Theme.palette.basecontent
palette.highlight: Theme.palette.primary
palette.highlightedText: Theme.palette.primarycontent
palette.text: Styling.theme.basecontent
palette.highlight: Styling.theme.primary
palette.highlightedText: Styling.theme.primarycontent
}

View file

@ -3,7 +3,7 @@ import QtQuick
import QtQuick.Controls
MenuSeparator {
palette.text: Theme.palette.basecontent
palette.highlight: Theme.palette.primary
palette.highlightedText: Theme.palette.primarycontent
palette.text: Styling.theme.basecontent
palette.highlight: Styling.theme.primary
palette.highlightedText: Styling.theme.primarycontent
}

View file

@ -31,7 +31,7 @@ PopupWindow {
anchors.centerIn: root
implicitWidth: root.contentItem.children.reduce((prev, child) => Math.max(prev, child.width), 0)
implicitHeight: root.contentItem.children.reduce((prev, child) => prev + child.height, 0)
color: Theme.palette.base200
color: Styling.theme.base200
radius: 8
}
}

View file

@ -15,7 +15,7 @@ ProgressBar {
background: Rectangle {
implicitWidth: 200
implicitHeight: 6
color: Theme.palette.base100
color: Styling.theme.base100
radius: 8
}
@ -28,7 +28,7 @@ ProgressBar {
width: control.visualPosition * parent.width
height: parent.height
radius: 8
color: Theme.palette.primary
color: Styling.theme.primary
visible: !control.indeterminate
}
@ -41,7 +41,7 @@ ProgressBar {
Row {
Rectangle {
id: rect
color: Theme.palette.primary
color: Styling.theme.primary
width: 40
height: control.height
}

View file

@ -19,7 +19,7 @@ Slider {
width: control.availableWidth
height: implicitHeight
radius: 8
color: Theme.palette.base200
color: Styling.theme.base200
Rectangle {
width: control.visualPosition * parent.width
@ -29,7 +29,7 @@ Slider {
}
}
height: parent.height
color: Theme.palette.primary
color: Styling.theme.primary
radius: 8
}
}

View file

@ -11,7 +11,7 @@ Switch {
text: control.text
font: control.font
opacity: enabled ? 1.0 : 0.3
color: Theme.palette.basecontent
color: Styling.theme.basecontent
elide: Text.ElideRight
verticalAlignment: Text.AlignVCenter
}
@ -31,7 +31,7 @@ Switch {
y: parent.height / 2 - height / 2
radius: 16
color: "transparent"
border.color: control.checked ? Theme.palette.primary : Theme.palette.basecontent
border.color: control.checked ? Styling.theme.primary : Styling.theme.basecontent
border.width: 2
Rectangle {
@ -46,7 +46,7 @@ Switch {
width: parent.width / 2 - indicator.padding
height: parent.height - indicator.padding
radius: 16
color: control.checked ? Theme.palette.primary : Theme.palette.basecontent
color: control.checked ? Styling.theme.primary : Styling.theme.basecontent
}
}

View file

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

View file

@ -4,6 +4,6 @@ import QtQuick.Controls
TextField {
color: Theme.palette.basecontent
color: Styling.theme.basecontent
background: Item {}
}

View file

@ -9,13 +9,13 @@ ToolTip {
contentItem: Text {
text: control.text
font: control.font
color: Theme.palette.basecontent
color: Styling.theme.basecontent
}
background: Rectangle {
radius: 8
color: Theme.palette.base100
border.color: Theme.palette.base200
color: Styling.theme.base100
border.color: Styling.theme.base200
border.width: 2
}
}

View file

@ -4,7 +4,7 @@ import Quickshell.Widgets
WrapperRectangle {
radius: 8
color: Theme.palette.base100
color: Styling.theme.base100
Behavior on color {
ColorAnimation {
duration: Styling.animations.speed.fast

View file

@ -8,6 +8,7 @@ Singleton {
readonly property Lucide lucide: Lucide {}
readonly property Animations animations: Animations {}
readonly property var theme: Theme.palette
component Animations: QtObject {
property AnimationSpeed speed: AnimationSpeed {}

View file

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

View file

@ -6,7 +6,7 @@ StyledIconButton {
id: root
border.width: 2
border.color: Caffeine.enabled ? Theme.palette.secondary : root.hovered ? Theme.palette.primary : Theme.palette.base300
border.color: Caffeine.enabled ? Styling.theme.secondary : root.hovered ? Styling.theme.primary : Styling.theme.base300
text: Styling.lucide.icons.coffee
onClicked: {

View file

@ -24,7 +24,7 @@ StyledButton {
}
LucideIcon {
text: Styling.lucide.icons.cpu
color: root.hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
color: root.hovered ? Styling.theme.primarycontent : Styling.theme.basecontent
}
StyledText {
@ -32,7 +32,7 @@ StyledButton {
font.pixelSize: Dimensions.cpu.fontSize
text: ` ${(SystemInfo.cpuPerc * 100).toFixed().toString().padStart(2, "_")}%`
color: root.hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
color: root.hovered ? Styling.theme.primarycontent : Styling.theme.basecontent
states: [
State {

View file

@ -24,7 +24,7 @@ StyledButton {
}
LucideIcon {
text: Styling.lucide.icons.gpu
color: root.hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
color: root.hovered ? Styling.theme.primarycontent : Styling.theme.basecontent
}
StyledText {
@ -32,7 +32,7 @@ StyledButton {
font.pixelSize: Dimensions.gpu.fontSize
text: ` ${(SystemInfo.gpuPerc * 100).toFixed().toString().padStart(2, "_")}%`
color: root.hovered ? Theme.palette.primarycontent : Theme.palette.basecontent
color: root.hovered ? Styling.theme.primarycontent : Styling.theme.basecontent
states: [
State {

View file

@ -28,7 +28,7 @@ StyledButton {
when: Pipewire.muted
PropertyChanges {
root {
palette.button: Theme.palette.error
palette.button: Styling.theme.error
}
}
}

View file

@ -15,12 +15,12 @@ StyledButton {
Layout.alignment: Qt.AlignVCenter
color: {
if (root.isCritical) {
return Theme.palette.error;
return Styling.theme.error;
}
if (root.hovered) {
return Theme.palette.primarycontent;
return Styling.theme.primarycontent;
}
return Theme.palette.basecontent;
return Styling.theme.basecontent;
}
font.pixelSize: 16
text: {
@ -44,12 +44,12 @@ StyledButton {
Layout.alignment: Qt.AlignVCenter
color: {
if (root.isCritical) {
return Theme.palette.error;
return Styling.theme.error;
}
if (root.hovered) {
return Theme.palette.primarycontent;
return Styling.theme.primarycontent;
}
return Theme.palette.basecontent;
return Styling.theme.basecontent;
}
text: `${(root.laptopBattery?.percentage.toFixed(2) * 100)}%`
}

View file

@ -11,7 +11,7 @@ import Quickshell.Bluetooth
StyledPopupWindow {
id: root
backgroundColor: Theme.palette.base300
backgroundColor: Styling.theme.base300
margins: 16
radius: 8

View file

@ -64,7 +64,7 @@ StyledLabel {
PropertyChanges {
icon {
text: Styling.lucide.icons.batteryWarning
color: Theme.palette.error
color: Styling.theme.error
}
}
}
@ -76,7 +76,7 @@ StyledLabel {
StyledButton {
Layout.alignment: Qt.AlignRight
text: 'Disconnect'
palette.button: hovered ? Theme.palette.error : Theme.palette.base200
palette.button: hovered ? Styling.theme.error : Styling.theme.base200
onClicked: {
if (root.modelData.state != BluetoothDeviceState.Connected) {

View file

@ -48,7 +48,7 @@ StyledLabel {
hoverEnabled: root.modelData.state == BluetoothDeviceState.Disconnected
text: 'Unpair'
palette.button: hovered ? Theme.palette.error : Theme.palette.base100
palette.button: hovered ? Styling.theme.error : Styling.theme.base100
onClicked: {
if (!hoverEnabled) {

View file

@ -22,7 +22,7 @@ StyledIconButton {
PropertyChanges {
root {
rotation: 180
color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary
color: root.hovered ? Styling.theme.basecontent : Styling.theme.primary
}
}
},
@ -33,7 +33,7 @@ StyledIconButton {
root {
text: Styling.lucide.icons.triangleDashed
rotation: 180
color: root.hovered ? Theme.palette.basecontent : Theme.palette.primary
color: root.hovered ? Styling.theme.basecontent : Styling.theme.primary
}
}
}

View file

@ -10,7 +10,7 @@ import QtQuick.Layouts
StyledPopupWindow {
id: root
backgroundColor: Theme.palette.base300
backgroundColor: Styling.theme.base300
margins: 16
radius: 8
@ -32,7 +32,7 @@ StyledPopupWindow {
StyledLabel {
Layout.columnSpan: 2
color: Theme.palette.base200
color: Styling.theme.base200
StyledListView {
id: notifications

View file

@ -9,7 +9,7 @@ import Quickshell
StyledPopupWindow {
id: window
backgroundColor: Theme.palette.base300
backgroundColor: Styling.theme.base300
margins: 14
radius: 8
@ -32,7 +32,7 @@ StyledPopupWindow {
property Component menuSeperator: Rectangle {
implicitHeight: 2
color: Theme.palette.base100
color: Styling.theme.base100
}
property Component menuItem: MenuItem {
menuEntry: loader.modelData

View file

@ -31,7 +31,7 @@ StyledListView {
highlightResizeDuration: 0
highlight: Rectangle {
radius: 8
color: Theme.palette.primary
color: Styling.theme.primary
}
header: StyledText {

View file

@ -47,7 +47,7 @@ StyledWindow {
Layout.alignment: Qt.AlignTop
margin: 4
color: Theme.palette.base200
color: Styling.theme.base200
RowLayout {
LucideIcon {

View file

@ -42,7 +42,7 @@ Item {
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
color: root.active ? Theme.palette.primarycontent : Theme.palette.basecontent
color: root.active ? Styling.theme.primarycontent : Styling.theme.basecontent
font.pixelSize: 14
font.bold: true
}
@ -52,7 +52,7 @@ Item {
Layout.alignment: Qt.AlignTop
Layout.fillWidth: true
color: root.active ? Theme.palette.primarycontent : Theme.palette.basecontent
color: root.active ? Styling.theme.primarycontent : Styling.theme.basecontent
font.pixelSize: 10
elide: Text.ElideRight
}

View file

@ -53,10 +53,10 @@ StyledWindow {
Circle {
id: circle
radius: 150
borderColor: Theme.palette.base100
strokeColor: Pomodoro.state == "timer" ? Theme.palette.primary : Theme.palette.warning
borderColor: Styling.theme.base100
strokeColor: Pomodoro.state == "timer" ? Styling.theme.primary : Styling.theme.warning
strokeWidth: 12
fillColor: button.hovered ? Theme.palette.primary : "transparent"
fillColor: button.hovered ? Styling.theme.primary : "transparent"
percentage: (Pomodoro.state == "timer" ? (Pomodoro.initialTime - Pomodoro.remainingTime) : Pomodoro.remainingTime) / Pomodoro.initialTime % 1
}

View file

@ -76,7 +76,7 @@ StyledWindow {
highlightResizeDuration: 0
highlight: Rectangle {
radius: 8
color: Theme.palette.primary
color: Styling.theme.primary
}
onCurrentItemChanged: {
@ -103,7 +103,7 @@ StyledWindow {
}
padding: 16
color: list.currentIndex == index ? Theme.palette.primarycontent : Theme.palette.basecontent
color: list.currentIndex == index ? Styling.theme.primarycontent : Styling.theme.basecontent
text: modelData.text
font.pixelSize: 18
font.bold: true

View file

@ -137,7 +137,7 @@ StyledWindow {
font.pixelSize: 18
}
StyledWrapperRectangle {
border.color: Theme.palette.base100
border.color: Styling.theme.base100
border.width: 2
StyledListView {
implicitWidth: 200

View file

@ -22,8 +22,8 @@ Item {
ShapePath {
id: fill
fillColor: Theme.palette.base100
strokeColor: Theme.palette.base200
fillColor: Styling.theme.base100
strokeColor: Styling.theme.base200
strokeWidth: 8
PathAngleArc {