style: format qml files

This commit is contained in:
tux
2026-08-24 15:44:57 +05:30
parent ca7ac0696b
commit adfd353e85
19 changed files with 500 additions and 519 deletions

View File

@@ -5,42 +5,42 @@ import QtQuick.Controls
import qs.config
Button {
id: root
id: root
property string label: ""
property url iconSource: ""
property bool iconOnly: false
property bool hoverHighlight: true
property bool pointerCursor: true
property string label: ""
property url iconSource: ""
property bool iconOnly: false
property bool hoverHighlight: true
property bool pointerCursor: true
padding: Appearance.padding
display: iconOnly ? AbstractButton.IconOnly : AbstractButton.TextBesideIcon
padding: Appearance.padding
display: iconOnly ? AbstractButton.IconOnly : AbstractButton.TextBesideIcon
text: label
font.family: Appearance.font.family
font.pointSize: Appearance.font.pointSize
palette.buttonText: Appearance.colors.foreground
icon.color: Appearance.colors.foreground
icon.source: iconSource
text: label
font.family: Appearance.font.family
font.pointSize: Appearance.font.pointSize
palette.buttonText: Appearance.colors.foreground
icon.color: Appearance.colors.foreground
icon.source: iconSource
HoverHandler {
cursorShape: Qt.PointingHandCursor
enabled: root.pointerCursor
}
background: Rectangle {
anchors.fill: parent
radius: Appearance.radius
color: {
if (!root.hoverHighlight)
return Appearance.colors.inActive;
return root.hovered ? Appearance.colors.inActive : Appearance.colors.background;
HoverHandler {
cursorShape: Qt.PointingHandCursor
enabled: root.pointerCursor
}
Behavior on color {
ColorAnimation {
duration: Appearance.duration
}
background: Rectangle {
anchors.fill: parent
radius: Appearance.radius
color: {
if (!root.hoverHighlight)
return Appearance.colors.inActive;
return root.hovered ? Appearance.colors.inActive : Appearance.colors.background;
}
Behavior on color {
ColorAnimation {
duration: Appearance.duration
}
}
}
}
}

View File

@@ -4,9 +4,9 @@ import Quickshell
import Quickshell.Wayland
PanelWindow {
property string name
property string name
implicitWidth: 0
implicitHeight: 0
WlrLayershell.namespace: `quickshell:${name}ExclusionZone`
implicitWidth: 0
implicitHeight: 0
WlrLayershell.namespace: `quickshell:${name}ExclusionZone`
}

View File

@@ -6,61 +6,61 @@ import Quickshell.Widgets
import qs.config
WrapperItem {
id: root
id: root
property int corner
property real radius: Appearance.radius
property color color
property int corner
property real radius: Appearance.radius
property color color
Component.onCompleted: {
switch (corner) {
case 0:
anchors.left = parent.left;
anchors.top = parent.top;
break;
case 1:
anchors.top = parent.top;
anchors.right = parent.right;
rotation = 90;
break;
case 2:
anchors.right = parent.right;
anchors.bottom = parent.bottom;
rotation = 180;
break;
case 3:
anchors.left = parent.left;
anchors.bottom = parent.bottom;
rotation = -90;
break;
Component.onCompleted: {
switch (corner) {
case 0:
anchors.left = parent.left;
anchors.top = parent.top;
break;
case 1:
anchors.top = parent.top;
anchors.right = parent.right;
rotation = 90;
break;
case 2:
anchors.right = parent.right;
anchors.bottom = parent.bottom;
rotation = 180;
break;
case 3:
anchors.left = parent.left;
anchors.bottom = parent.bottom;
rotation = -90;
break;
}
}
}
Shape {
preferredRendererType: Shape.CurveRenderer
Shape {
preferredRendererType: Shape.CurveRenderer
ShapePath {
strokeWidth: 0
fillColor: root.color
startX: root.radius
ShapePath {
strokeWidth: 0
fillColor: root.color
startX: root.radius
PathArc {
relativeX: -root.radius
relativeY: root.radius
radiusX: root.radius
radiusY: radiusX
direction: PathArc.Counterclockwise
}
PathArc {
relativeX: -root.radius
relativeY: root.radius
radiusX: root.radius
radiusY: radiusX
direction: PathArc.Counterclockwise
}
PathLine {
relativeX: 0
relativeY: -root.radius
}
PathLine {
relativeX: 0
relativeY: -root.radius
}
PathLine {
relativeX: root.radius
relativeY: 0
}
PathLine {
relativeX: root.radius
relativeY: 0
}
}
}
}
}