added 'warningAlt' accent color config

This commit is contained in:
Zacharias-Brohn
2025-11-18 22:57:54 +01:00
parent a40299ed41
commit 36cf913830
6 changed files with 65 additions and 68 deletions
+2 -1
View File
@@ -5,7 +5,8 @@ JsonObject {
component Accents: JsonObject { component Accents: JsonObject {
property string primary: "#4080ff" property string primary: "#4080ff"
property string warning: "#ff6b6b"
property string primaryAlt: "#60a0ff" property string primaryAlt: "#60a0ff"
property string warning: "#ff6b6b"
property string warningAlt: "#ff8787"
} }
} }
-9
View File
@@ -16,15 +16,6 @@ Searcher {
forward: false forward: false
}) })
// FileView {
// path: root.currentNamePath
// watchChanges: true
// onFileChanged: reload()
// onLoaded: {
// root.actualCurrent = text().trim();
// }
// }
FileSystemModel { FileSystemModel {
id: wallpapers id: wallpapers
+8
View File
@@ -22,6 +22,7 @@ PanelWindow {
} }
WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.layer: WlrLayer.Overlay
WlrLayershell.keyboardFocus: WlrKeyboardFocus.OnDemand
required property PanelWindow bar required property PanelWindow bar
property bool centerShown: false property bool centerShown: false
property alias posX: backgroundRect.x property alias posX: backgroundRect.x
@@ -51,6 +52,13 @@ PanelWindow {
} }
} }
Keys.onPressed: {
if ( event.key === Qt.Key_Escape ) {
root.centerShown = false;
event.accepted = true;
}
}
Timer { Timer {
id: closeTimer id: closeTimer
interval: 300 interval: 300
+39 -23
View File
@@ -1,6 +1,7 @@
import qs.Modules import qs.Modules
import QtQuick import QtQuick
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Shapes
import Quickshell import Quickshell
import qs.Config import qs.Config
@@ -46,36 +47,51 @@ Item {
border.width: 1 border.width: 1
} }
Canvas { Shape {
id: progressCanvas
anchors.fill: backgroundCircle anchors.fill: backgroundCircle
Connections { smooth: true
target: root preferredRendererType: Shape.CurveRenderer
function onPercentageChanged() {
progressCanvas.requestPaint() ShapePath {
strokeWidth: 0
fillColor: root.warning ? Config.accentColor.accents.warning : Config.accentColor.accents.primary
startX: backgroundCircle.width / 2
startY: backgroundCircle.height / 2
PathLine {
x: backgroundCircle.width / 2
y: 0 + ( 1 / 2 )
} }
function onWarningChanged() {
progressCanvas.requestPaint() PathAngleArc {
centerX: backgroundCircle.width / 2
centerY: backgroundCircle.height / 2
radiusX: backgroundCircle.width / 2 - ( 1 / 2 )
radiusY: backgroundCircle.height / 2 - ( 1 / 2 )
startAngle: -90
sweepAngle: 360 * root.percentage
}
PathLine {
x: backgroundCircle.width / 2
y: backgroundCircle.height / 2
} }
} }
onPaint: { ShapePath {
var ctx = getContext("2d"); strokeWidth: 1
ctx.reset(); strokeColor: root.warning ? Config.accentColor.accents.warningAlt : Config.accentColor.accents.primaryAlt
fillColor: "transparent"
capStyle: ShapePath.FlatCap
var centerX = width / 2; PathAngleArc {
var centerY = height / 2; centerX: backgroundCircle.width / 2
var radius = width / 2; centerY: backgroundCircle.height / 2
var startAngle = -Math.PI / 2; // Start at top radiusX: backgroundCircle.width / 2 - ( 1 / 2 )
var endAngle = startAngle + (2 * Math.PI * percentage); radiusY: backgroundCircle.height / 2 - ( 1 / 2 )
startAngle: -90
ctx.fillStyle = warning ? Config.accentColor.accents.warning : Config.accentColor.accents.primary; sweepAngle: 360 * root.percentage
ctx.beginPath(); }
ctx.moveTo(centerX, centerY);
ctx.arc(centerX, centerY, radius, startAngle, endAngle);
ctx.lineTo(centerX, centerY);
ctx.fill();
} }
} }
} }
+1 -6
View File
@@ -81,6 +81,7 @@ Item {
} }
MouseArea { MouseArea {
id: widgetMouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onEntered: { onEntered: {
@@ -97,9 +98,7 @@ Item {
component ResourcePopout: PanelWindow { component ResourcePopout: PanelWindow {
id: popoutWindow id: popoutWindow
property alias containsMouse: popoutWindow.mouseAreaContainsMouse
property int rectHeight: contentRect.implicitHeight property int rectHeight: contentRect.implicitHeight
property bool mouseAreaContainsMouse: mouseArea.containsMouse
WlrLayershell.exclusionMode: ExclusionMode.Ignore WlrLayershell.exclusionMode: ExclusionMode.Ignore
anchors { anchors {
@@ -127,10 +126,6 @@ Item {
duration: MaterialEasing.expressiveEffectsTime duration: MaterialEasing.expressiveEffectsTime
easing.bezierCurve: MaterialEasing.expressiveEffects easing.bezierCurve: MaterialEasing.expressiveEffects
} }
onFinished: {
if ( !mouseArea.containsMouse )
closeAnim.start();
}
} }
ParallelAnimation { ParallelAnimation {
+2 -16
View File
@@ -131,26 +131,13 @@ PanelWindow {
border.color: "#555555" border.color: "#555555"
radius: 8 radius: 8
// Rectangle {
// anchors.bottom: parent.bottom
// anchors.left: parent.left
// anchors.right: parent.right
// height: 4
// bottomLeftRadius: parent.radius
// bottomRightRadius: parent.radius
// color: "#40000000"
// Rectangle {
// anchors.fill: parent
// width: parent.width * ( Math.max(0, Math.min( rootItem.modelData.timer ) ) )
// }
// }
Component.onCompleted: { Component.onCompleted: {
root.notifRegions.push( notifRegion.createObject(root, { item: backgroundRect })); root.notifRegions.push( notifRegion.createObject(root, { item: backgroundRect }));
} }
Column { Column {
id: contentLayout id: contentLayout
z: 0
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@@ -238,11 +225,10 @@ PanelWindow {
} }
MouseArea { MouseArea {
property int timePassed z: 1
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onEntered: { onEntered: {
// rootItem.modelData.timer.interval = 5000 - timer.restartMs();
rootItem.modelData.timer.stop(); rootItem.modelData.timer.stop();
} }
onExited: { onExited: {