summaryrefslogtreecommitdiff
path: root/widgets
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-05 14:50:18 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-05 14:50:18 +1000
commit1fdaf24526ae688251307f2756bcdb9d7592e383 (patch)
tree9187b1efd11bfa7d1d2625da29c308a6a51c2842 /widgets
parentdev: get rid of wrapper width/height = 0 warnings (diff)
downloadcaelestia-shell-1fdaf24526ae688251307f2756bcdb9d7592e383.tar.gz
caelestia-shell-1fdaf24526ae688251307f2756bcdb9d7592e383.tar.bz2
caelestia-shell-1fdaf24526ae688251307f2756bcdb9d7592e383.zip
refactor: move colours to separate service
Diffstat (limited to 'widgets')
-rw-r--r--widgets/LayerShadow.qml4
-rw-r--r--widgets/StateLayer.qml3
-rw-r--r--widgets/StyledScrollBar.qml5
-rw-r--r--widgets/StyledText.qml3
-rw-r--r--widgets/StyledTextField.qml7
-rw-r--r--widgets/VerticalSlider.qml11
6 files changed, 19 insertions, 14 deletions
diff --git a/widgets/LayerShadow.qml b/widgets/LayerShadow.qml
index 1694a8e..b5f84c9 100644
--- a/widgets/LayerShadow.qml
+++ b/widgets/LayerShadow.qml
@@ -1,9 +1,9 @@
-import "root:/config"
+import "root:/services"
import Qt5Compat.GraphicalEffects
DropShadow {
anchors.fill: source
- color: Qt.alpha(Appearance.colours.m3shadow, 0.7)
+ color: Qt.alpha(Colours.palette.m3shadow, 0.7)
radius: 10
samples: 1 + radius * 2
}
diff --git a/widgets/StateLayer.qml b/widgets/StateLayer.qml
index e1a7b61..4508453 100644
--- a/widgets/StateLayer.qml
+++ b/widgets/StateLayer.qml
@@ -1,4 +1,5 @@
import "root:/widgets"
+import "root:/services"
import "root:/config"
import QtQuick
@@ -10,7 +11,7 @@ Rectangle {
anchors.fill: parent
- color: Appearance.colours.m3onSurface
+ color: Colours.palette.m3onSurface
opacity: mouse.pressed ? 0.1 : mouse.hovered ? 0.08 : 0
MouseArea {
diff --git a/widgets/StyledScrollBar.qml b/widgets/StyledScrollBar.qml
index 73b7451..a52bbd2 100644
--- a/widgets/StyledScrollBar.qml
+++ b/widgets/StyledScrollBar.qml
@@ -1,3 +1,4 @@
+import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Controls
@@ -8,7 +9,7 @@ ScrollBar {
contentItem: StyledRect {
opacity: root.pressed ? 0.8 : root.policy === ScrollBar.AlwaysOn || (root.active && root.size < 1) ? 0.6 : 0
radius: Appearance.rounding.full
- color: Appearance.colours.m3secondary
+ color: Colours.palette.m3secondary
Behavior on opacity {
NumberAnimation {
@@ -23,7 +24,7 @@ ScrollBar {
implicitWidth: 10
opacity: root.policy === ScrollBar.AlwaysOn || (root.active && root.size < 1) ? 0.4 : 0
radius: Appearance.rounding.full
- color: Appearance.colours.m3surfaceContainerLow
+ color: Colours.palette.m3surfaceContainerLow
Behavior on opacity {
NumberAnimation {
diff --git a/widgets/StyledText.qml b/widgets/StyledText.qml
index f95414f..9e4be48 100644
--- a/widgets/StyledText.qml
+++ b/widgets/StyledText.qml
@@ -1,5 +1,6 @@
pragma ComponentBehavior: Bound
+import "root:/services"
import "root:/config"
import QtQuick
@@ -11,7 +12,7 @@ Text {
property int animateDuration: Appearance.anim.durations.normal
renderType: Text.NativeRendering
- color: Appearance.colours.m3onSurface
+ color: Colours.palette.m3onSurface
font.family: Appearance.font.family.sans
font.pointSize: Appearance.font.size.smaller
diff --git a/widgets/StyledTextField.qml b/widgets/StyledTextField.qml
index cb1ce83..1209ec1 100644
--- a/widgets/StyledTextField.qml
+++ b/widgets/StyledTextField.qml
@@ -1,5 +1,6 @@
pragma ComponentBehavior: Bound
+import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Controls
@@ -7,8 +8,8 @@ import QtQuick.Controls
TextField {
id: root
- color: Appearance.colours.m3onSurface
- placeholderTextColor: Appearance.colours.m3outline
+ color: Colours.palette.m3onSurface
+ placeholderTextColor: Colours.palette.m3outline
font.family: Appearance.font.family.sans
font.pointSize: Appearance.font.size.smaller
@@ -18,7 +19,7 @@ TextField {
property bool disableBlink
implicitWidth: 2
- color: Appearance.colours.m3primary
+ color: Colours.palette.m3primary
radius: Appearance.rounding.normal
onXChanged: {
opacity = 1;
diff --git a/widgets/VerticalSlider.qml b/widgets/VerticalSlider.qml
index 1dbe3f2..f944da8 100644
--- a/widgets/VerticalSlider.qml
+++ b/widgets/VerticalSlider.qml
@@ -1,4 +1,5 @@
import "root:/widgets"
+import "root:/services"
import "root:/config"
import QtQuick
import QtQuick.Controls
@@ -12,7 +13,7 @@ Slider {
orientation: Qt.Vertical
background: StyledRect {
- color: Appearance.alpha(Appearance.colours.m3surfaceContainer, true)
+ color: Colours.alpha(Colours.palette.m3surfaceContainer, true)
radius: Appearance.rounding.full
StyledRect {
@@ -22,7 +23,7 @@ Slider {
y: root.handle.y
implicitHeight: parent.height - y
- color: Appearance.alpha(Appearance.colours.m3secondary, true)
+ color: Colours.alpha(Colours.palette.m3secondary, true)
radius: Appearance.rounding.full
}
}
@@ -39,7 +40,7 @@ Slider {
RectangularShadow {
anchors.fill: parent
radius: rect.radius
- color: Appearance.colours.m3shadow
+ color: Colours.palette.m3shadow
blur: 5
spread: 0
}
@@ -49,7 +50,7 @@ Slider {
anchors.fill: parent
- color: Appearance.alpha(Appearance.colours.m3inverseSurface, true)
+ color: Colours.alpha(Colours.palette.m3inverseSurface, true)
radius: Appearance.rounding.full
MaterialIcon {
@@ -57,7 +58,7 @@ Slider {
animate: true
text: root.icon
- color: Appearance.colours.m3inverseOnSurface
+ color: Colours.palette.m3inverseOnSurface
anchors.centerIn: parent
states: State {