dynamic color scheme progress
This commit is contained in:
+24
-8
@@ -5,6 +5,7 @@ import Quickshell.Io
|
||||
import Quickshell.Services.Pipewire
|
||||
import Quickshell.Widgets
|
||||
import qs.Modules
|
||||
import qs.Config
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -12,6 +13,7 @@ Item {
|
||||
implicitHeight: 34
|
||||
|
||||
property bool expanded: false
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3tertiaryFixed : "#ffffff"
|
||||
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
@@ -34,8 +36,11 @@ Item {
|
||||
anchors.right: parent.right
|
||||
height: 22
|
||||
radius: height / 2
|
||||
color: "#40000000"
|
||||
color: Config.useDynamicColors ? DynamicColors.tPalette.m3surfaceContainer : "#40000000"
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
|
||||
// Background circle
|
||||
Rectangle {
|
||||
@@ -66,8 +71,11 @@ Item {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
font.family: "Material Symbols Rounded"
|
||||
font.pixelSize: 18
|
||||
text: "\ue050" // volume_up icon
|
||||
color: "#ffffff"
|
||||
text: "\ue050" // volumeUp icon
|
||||
color: root.textColor
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -87,7 +95,7 @@ Item {
|
||||
|
||||
implicitWidth: parent.width * ( Pipewire.defaultAudioSink?.audio.volume ?? 0 )
|
||||
radius: parent.radius
|
||||
color: "#ffffff"
|
||||
color: root.textColor
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -97,7 +105,7 @@ Item {
|
||||
width: sinkVolumeMouseArea.pressed ? 25 : 12
|
||||
height: sinkVolumeMouseArea.pressed ? 25 : 12
|
||||
radius: width / 2
|
||||
color: sinkVolumeMouseArea.containsMouse || sinkVolumeMouseArea.pressed ? "#ffffff" : "#aaaaaa"
|
||||
color: sinkVolumeMouseArea.containsMouse || sinkVolumeMouseArea.pressed ? (Config.useDynamicColors ? DynamicColors.palette.m3onSurface : "#ffffff") : (Config.useDynamicColors ? DynamicColors.palette.m3onSurfaceVariant : "#aaaaaa")
|
||||
border.color: "#40000000"
|
||||
border.width: 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -171,7 +179,11 @@ Item {
|
||||
font.family: "Material Symbols Rounded"
|
||||
font.pixelSize: 18
|
||||
text: "\ue029"
|
||||
color: ( Pipewire.defaultAudioSource?.audio.muted ?? false ) ? "#ff4444" : "#ffffff"
|
||||
color: ( Pipewire.defaultAudioSource?.audio.muted ?? false ) ? (Config.useDynamicColors ? DynamicColors.palette.m3error : "#ff4444") : root.textColor
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -191,7 +203,11 @@ Item {
|
||||
|
||||
implicitWidth: parent.width * ( Pipewire.defaultAudioSource?.audio.volume ?? 0 )
|
||||
radius: parent.radius
|
||||
color: ( Pipewire.defaultAudioSource?.audio.muted ?? false ) ? "#ff4444" : "#ffffff"
|
||||
color: ( Pipewire.defaultAudioSource?.audio.muted ?? false ) ? (Config.useDynamicColors ? DynamicColors.palette.m3error : "#ff4444") : root.textColor
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -201,7 +217,7 @@ Item {
|
||||
width: sourceVolumeMouseArea.pressed ? 25 : 12
|
||||
height: sourceVolumeMouseArea.pressed ? 25 : 12
|
||||
radius: width / 2
|
||||
color: sourceVolumeMouseArea.containsMouse || sourceVolumeMouseArea.pressed ? "#ffffff" : "#aaaaaa"
|
||||
color: sourceVolumeMouseArea.containsMouse || sourceVolumeMouseArea.pressed ? (Config.useDynamicColors ? DynamicColors.palette.m3onSurface : "#ffffff") : (Config.useDynamicColors ? DynamicColors.palette.m3onSurfaceVariant : "#aaaaaa")
|
||||
border.color: "#40000000"
|
||||
border.width: 2
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import QtQuick
|
||||
import qs.Modules
|
||||
|
||||
ColorAnimation {
|
||||
duration: 400
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: MaterialEasing.standard
|
||||
}
|
||||
@@ -3,6 +3,7 @@ import QtQuick
|
||||
import QtQuick.Controls
|
||||
import qs.Helpers
|
||||
import qs.Config
|
||||
import qs.Paths
|
||||
|
||||
TextField {
|
||||
id: root
|
||||
@@ -84,6 +85,8 @@ TextField {
|
||||
launcherWindow.visible = false;
|
||||
} else if ( wallpaperPickerLoader.active ) {
|
||||
SearchWallpapers.setWallpaper(wallpaperPickerLoader.item.currentItem.modelData.path)
|
||||
if ( Config.useDynamicColors )
|
||||
Quickshell.execDetached(["python3", Quickshell.shellPath("scripts/SchemeColorGen.py"), `--path=${wallpaperPickerLoader.item.currentItem.modelData.path}`, `--thumbnail=${Paths.cache}/imagecache/thumbnail.jpg`, `--output=${Paths.state}/scheme.json`]);
|
||||
if ( Config.wallust ) {
|
||||
Wallust.generateColors(WallpaperPath.currentWallpaperPath);
|
||||
}
|
||||
|
||||
+13
-2
@@ -15,6 +15,8 @@ Item {
|
||||
implicitWidth: resourceRowLayout.x < 0 ? 0 : resourceRowLayout.implicitWidth
|
||||
implicitHeight: 22
|
||||
property bool warning: percentage * 100 >= warningThreshold
|
||||
property color usageColor: Config.useDynamicColors ? ( warning ? DynamicColors.palette.m3error : DynamicColors.palette.m3primary ) : ( warning ? Config.accentColor.accents.warning : Config.accentColor.accents.primary )
|
||||
property color borderColor: Config.useDynamicColors ? ( warning ? DynamicColors.palette.m3onError : DynamicColors.palette.m3onPrimary ) : ( warning ? Config.accentColor.accents.warningAlt : Config.accentColor.accents.primaryAlt )
|
||||
|
||||
Behavior on percentage {
|
||||
NumberAnimation {
|
||||
@@ -55,9 +57,14 @@ Item {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 0
|
||||
fillColor: root.warning ? Config.accentColor.accents.warning : Config.accentColor.accents.primary
|
||||
fillColor: root.usageColor
|
||||
startX: backgroundCircle.width / 2
|
||||
startY: backgroundCircle.height / 2
|
||||
|
||||
Behavior on fillColor {
|
||||
CAnim {}
|
||||
}
|
||||
|
||||
PathLine {
|
||||
x: backgroundCircle.width / 2
|
||||
y: 0 + ( 1 / 2 )
|
||||
@@ -80,10 +87,14 @@ Item {
|
||||
|
||||
ShapePath {
|
||||
strokeWidth: 1
|
||||
strokeColor: root.warning ? Config.accentColor.accents.warningAlt : Config.accentColor.accents.primaryAlt
|
||||
strokeColor: root.borderColor
|
||||
fillColor: "transparent"
|
||||
capStyle: ShapePath.FlatCap
|
||||
|
||||
Behavior on strokeColor {
|
||||
CAnim {}
|
||||
}
|
||||
|
||||
PathAngleArc {
|
||||
centerX: backgroundCircle.width / 2
|
||||
centerY: backgroundCircle.height / 2
|
||||
|
||||
+18
-5
@@ -10,6 +10,7 @@ Item {
|
||||
id: root
|
||||
implicitWidth: rowLayout.implicitWidth + rowLayout.anchors.leftMargin + rowLayout.anchors.rightMargin
|
||||
implicitHeight: 34
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3tertiaryFixed : "#ffffff"
|
||||
|
||||
Rectangle {
|
||||
anchors {
|
||||
@@ -18,7 +19,7 @@ Item {
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
implicitHeight: 22
|
||||
color: "#40000000"
|
||||
color: Config.useDynamicColors ? DynamicColors.tPalette.m3surfaceContainer : "#40000000"
|
||||
radius: height / 2
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
@@ -33,7 +34,10 @@ Item {
|
||||
font.family: "Material Symbols Rounded"
|
||||
font.pixelSize: 18
|
||||
text: "\uf7a3"
|
||||
color: "#ffffff"
|
||||
color: root.textColor
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Resource {
|
||||
@@ -46,7 +50,10 @@ Item {
|
||||
font.family: "Material Symbols Rounded"
|
||||
font.pixelSize: 18
|
||||
text: "\ue322"
|
||||
color: "#ffffff"
|
||||
color: root.textColor
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Resource {
|
||||
@@ -59,7 +66,10 @@ Item {
|
||||
font.family: "Material Symbols Rounded"
|
||||
font.pixelSize: 16
|
||||
text: "\ue30f"
|
||||
color: "#ffffff"
|
||||
color: root.textColor
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Resource {
|
||||
@@ -71,7 +81,10 @@ Item {
|
||||
font.family: "Material Symbols Rounded"
|
||||
font.pixelSize: 18
|
||||
text: "\ue30d"
|
||||
color: "#ffffff"
|
||||
color: root.textColor
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Resource {
|
||||
|
||||
@@ -2,8 +2,11 @@ import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Services.SystemTray
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import qs.Modules
|
||||
import qs.Config
|
||||
import Caelestia
|
||||
import QtQuick.Effects
|
||||
|
||||
MouseArea {
|
||||
id: root
|
||||
|
||||
@@ -1,17 +1,22 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Modules
|
||||
import qs.Config
|
||||
|
||||
Item {
|
||||
id: root
|
||||
required property int countUpdates
|
||||
implicitWidth: contentRow.childrenRect.width + 10
|
||||
implicitHeight: 22
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3tertiaryFixed : "#ffffff"
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: height / 2
|
||||
color: "#40000000"
|
||||
color: Config.useDynamicColors ? DynamicColors.tPalette.m3surfaceContainer : "#40000000"
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
@@ -28,7 +33,10 @@ Item {
|
||||
font.family: "Material Symbols Rounded"
|
||||
font.pixelSize: 18
|
||||
text: "\uf569"
|
||||
color: "#ffffff"
|
||||
color: root.textColor
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
TextMetrics {
|
||||
@@ -40,7 +48,10 @@ Item {
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
|
||||
text: textMetrics.text
|
||||
color: "white"
|
||||
color: root.textColor
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-2
@@ -2,6 +2,7 @@ import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Hyprland
|
||||
import qs.Helpers
|
||||
import qs.Config
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -11,6 +12,7 @@ Item {
|
||||
clip: true
|
||||
|
||||
property bool showFirst: true
|
||||
property color textColor: Config.useDynamicColors ? DynamicColors.palette.m3primary : "white"
|
||||
|
||||
Component.onCompleted: {
|
||||
Hyprland.rawEvent.connect(( event ) => {
|
||||
@@ -37,7 +39,7 @@ Item {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
text: root.currentTitle
|
||||
color: "white"
|
||||
color: root.textColor
|
||||
elide: Text.ElideRight
|
||||
font.pixelSize: 16
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -46,13 +48,17 @@ Item {
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
id: titleText2
|
||||
anchors.fill: parent
|
||||
anchors.margins: 5
|
||||
color: "white"
|
||||
color: root.textColor
|
||||
elide: Text.ElideRight
|
||||
font.pixelSize: 16
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
@@ -61,5 +67,9 @@ Item {
|
||||
Behavior on opacity {
|
||||
NumberAnimation { duration: 200; easing.type: Easing.InOutQuad }
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+17
-11
@@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import qs.Config
|
||||
@@ -26,7 +27,7 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
color: "#40000000"
|
||||
color: Config.useDynamicColors ? DynamicColors.tPalette.m3surfaceContainer : "#40000000"
|
||||
radius: height / 2
|
||||
|
||||
Behavior on implicitWidth {
|
||||
@@ -35,7 +36,11 @@ Rectangle {
|
||||
easing.type: Easing.InOutQuad
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: workspacesRow
|
||||
anchors.left: parent.left
|
||||
@@ -47,15 +52,16 @@ Rectangle {
|
||||
model: Hyprland.workspaces
|
||||
|
||||
Rectangle {
|
||||
id: workspaceIndicator
|
||||
required property var modelData
|
||||
|
||||
width: 16
|
||||
height: 16
|
||||
radius: height / 2
|
||||
|
||||
color: modelData.id === Hyprland.focusedWorkspace.id ? Config.accentColor.accents.primary : "#606060"
|
||||
color: modelData.id === Hyprland.focusedWorkspace.id ? ( Config.useDynamicColors ? DynamicColors.palette.m3primary : Config.accentColor.accents.primary ) : ( Config.useDynamicColors ? DynamicColors.palette.m3inverseOnSurface : "#606060" )
|
||||
|
||||
border.color: modelData.id === Hyprland.focusedWorkspace.id ? Config.accentColor.accents.primaryAlt : "#808080"
|
||||
border.color: modelData.id === Hyprland.focusedWorkspace.id ? ( Config.useDynamicColors ? DynamicColors.palette.m3onPrimary : Config.accentColor.accents.primaryAlt ) : ( Config.useDynamicColors ? DynamicColors.palette.m3inverseOnSurface : "#808080" )
|
||||
border.width: 1
|
||||
|
||||
visible: root.shouldShow( modelData.monitor )
|
||||
@@ -90,13 +96,13 @@ Rectangle {
|
||||
duration: 200
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
text: modelData.id
|
||||
font.pixelSize: 10
|
||||
font.family: "Rubik"
|
||||
color: modelData.id === Hyprland.focusedWorkspace.id ? Config.workspaceWidget.textColor : Config.workspaceWidget.inactiveTextColor
|
||||
}
|
||||
// Text {
|
||||
// anchors.centerIn: parent
|
||||
// text: modelData.id
|
||||
// font.pixelSize: 10
|
||||
// font.family: "Rubik"
|
||||
// color: modelData.id === Hyprland.focusedWorkspace.id ? Config.workspaceWidget.textColor : Config.workspaceWidget.inactiveTextColor
|
||||
// }
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
|
||||
Reference in New Issue
Block a user