Compare commits
32
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74261f0a49 | ||
|
|
e76350fa7f | ||
|
|
015c1fb27d | ||
|
|
f6cb7e44c2 | ||
|
|
5a8939bc1e | ||
|
|
6071223009 | ||
|
|
2d40ce33d1 | ||
|
|
954dc10fbb | ||
|
|
15ccfd24c6 | ||
|
|
33b08523e9 | ||
|
|
742bece30b | ||
|
|
a64eadd14a | ||
|
|
f9eeb793db | ||
|
|
6bb193c78c | ||
|
|
aadecbfe44 | ||
|
|
53f0aa80ae | ||
|
|
d9856c9409 | ||
|
|
8dc9753e2b | ||
|
|
2a4bd3dfdd | ||
|
|
f75f51ef50 | ||
|
|
e0873304d1 | ||
|
|
99a0155c17 | ||
|
|
f309debea5 | ||
|
|
0979fd014d | ||
|
|
656bd0a54d | ||
|
|
f01001dcfa | ||
|
|
bc6b0d50ab | ||
|
|
f27c9afc25 | ||
|
|
5962fc8354 | ||
|
|
1adcb9841c | ||
|
|
0e0f8555ed | ||
|
|
1d63e67554 |
+1
-2
@@ -3,9 +3,8 @@ FunctionsSpacing=true
|
||||
IndentWidth=4
|
||||
MaxColumnWidth=-1
|
||||
NewlineType=native
|
||||
GroupAttributesTogether=false
|
||||
NormalizeOrder=true
|
||||
ObjectsSpacing=true
|
||||
SemicolonRule=always
|
||||
SingleLineEmptyObjects=true
|
||||
SortImports=false
|
||||
UseTabs=true
|
||||
|
||||
@@ -27,25 +27,25 @@ AnchorAnimation {
|
||||
if (type == AnchorAnim.DefaultSpatial)
|
||||
return Tokens.anim.durations.expressiveDefaultSpatial;
|
||||
if (type == AnchorAnim.SlowSpatial)
|
||||
return Tokens.anim.durations.expressiveSlowSpatial;
|
||||
return Tokens.anim.durations.large;
|
||||
|
||||
const types = ["small", "normal", "large", "extraLarge"];
|
||||
const idx = type % 4; // 0-7 are the 4 standard types
|
||||
const idx = type % 4;
|
||||
return Tokens.anim.durations[types[idx]];
|
||||
}
|
||||
easing: {
|
||||
easing.bezierCurve: {
|
||||
if (type == AnchorAnim.FastSpatial)
|
||||
return Tokens.anim.expressiveFastSpatial;
|
||||
return Tokens.anim.curves.expressiveFastSpatial;
|
||||
if (type == AnchorAnim.DefaultSpatial)
|
||||
return Tokens.anim.expressiveDefaultSpatial;
|
||||
return Tokens.anim.curves.expressiveDefaultSpatial;
|
||||
if (type == AnchorAnim.SlowSpatial)
|
||||
return Tokens.anim.expressiveSlowSpatial;
|
||||
return Tokens.anim.curves.expressiveSlowSpatial;
|
||||
|
||||
if (type >= AnchorAnim.StandardSmall && type <= AnchorAnim.StandardExtraLarge)
|
||||
return Tokens.anim.standard;
|
||||
return Tokens.anim.curves.standard;
|
||||
if (type >= AnchorAnim.EmphasizedSmall && type <= AnchorAnim.EmphasizedExtraLarge)
|
||||
return Tokens.anim.emphasized;
|
||||
return Tokens.anim.curves.emphasized;
|
||||
|
||||
return Tokens.anim.expressiveDefaultSpatial;
|
||||
return Tokens.anim.curves.expressiveDefaultSpatial;
|
||||
}
|
||||
}
|
||||
|
||||
+12
-12
@@ -30,34 +30,34 @@ NumberAnimation {
|
||||
if (type === Anim.DefaultSpatial)
|
||||
return Tokens.anim.durations.expressiveDefaultSpatial;
|
||||
if (type === Anim.SlowSpatial)
|
||||
return Tokens.anim.durations.expressiveSlowSpatial;
|
||||
return Tokens.anim.durations.large;
|
||||
if (type === Anim.FastEffects)
|
||||
return Tokens.anim.durations.expressiveFastEffects;
|
||||
if (type === Anim.DefaultEffects)
|
||||
return Tokens.anim.durations.expressiveDefaultEffects;
|
||||
return Tokens.anim.durations.expressiveEffects;
|
||||
if (type === Anim.SlowEffects)
|
||||
return Tokens.anim.durations.expressiveSlowEffects;
|
||||
|
||||
const types = ["small", "normal", "large", "extraLarge"];
|
||||
const idx = type % 4; // 0-7 are the 4 standard types
|
||||
const idx = type % 4;
|
||||
return Tokens.anim.durations[types[idx]];
|
||||
}
|
||||
easing: {
|
||||
easing.bezierCurve: {
|
||||
if (type === Anim.FastSpatial)
|
||||
return Tokens.anim.expressiveFastSpatial;
|
||||
return Tokens.anim.curves.expressiveFastSpatial;
|
||||
if (type === Anim.DefaultSpatial)
|
||||
return Tokens.anim.expressiveDefaultSpatial;
|
||||
return Tokens.anim.curves.expressiveDefaultSpatial;
|
||||
if (type === Anim.SlowSpatial)
|
||||
return Tokens.anim.expressiveSlowSpatial;
|
||||
return Tokens.anim.curves.expressiveSlowSpatial;
|
||||
if (type === Anim.FastEffects)
|
||||
return Tokens.anim.expressiveFastEffects;
|
||||
return Tokens.anim.curves.expressiveFastEffects;
|
||||
if (type === Anim.DefaultEffects)
|
||||
return Tokens.anim.expressiveDefaultEffects;
|
||||
return Tokens.anim.curves.expressiveDefaultEffects;
|
||||
if (type === Anim.SlowEffects)
|
||||
return Tokens.anim.expressiveSlowEffects;
|
||||
return Tokens.anim.curves.expressiveSlowEffects;
|
||||
|
||||
if (type >= Anim.EmphasizedSmall && type <= Anim.EmphasizedExtraLarge)
|
||||
return Tokens.anim.emphasized;
|
||||
return Tokens.anim.standard;
|
||||
return Tokens.anim.curves.emphasized;
|
||||
return Tokens.anim.curves.standard;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ Slider {
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.normal / 2
|
||||
easing: Tokens.anim.standardAccel
|
||||
easing.bezierCurve: Tokens.anim.curves.standardAccel
|
||||
property: "scale"
|
||||
target: icon
|
||||
to: 0
|
||||
@@ -119,7 +119,7 @@ Slider {
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.normal / 2
|
||||
easing: Tokens.anim.standardDecel
|
||||
easing.bezierCurve: Tokens.anim.curves.standardDecel
|
||||
property: "scale"
|
||||
target: icon
|
||||
to: 1
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import QtQuick
|
||||
import ZShell.Config
|
||||
import qs.Components
|
||||
import qs.Services
|
||||
|
||||
CustomRect {
|
||||
@@ -16,7 +15,7 @@ CustomRect {
|
||||
property color activeOnColor
|
||||
property bool checked
|
||||
property real checkedRadius: Tokens.rounding.medium
|
||||
property real defaultRadius: Tokens.rounding.large
|
||||
property real defaultRadius: Math.min(width, height) / 2
|
||||
property color disabledColor: Qt.alpha(Colors.palette.m3onSurface, 0.1)
|
||||
property color disabledOnColor: Qt.alpha(Colors.palette.m3onSurface, 0.38)
|
||||
property bool fillWidth
|
||||
@@ -37,7 +36,7 @@ CustomRect {
|
||||
readonly property color onColor: !enabled ? disabledOnColor : internalChecked ? activeOnColor : inactiveOnColor
|
||||
property real padding
|
||||
readonly property alias pressed: stateLayer.pressed
|
||||
property real pressedRadius: Tokens.rounding.small
|
||||
property real pressedRadius: Tokens.rounding.smallest
|
||||
readonly property alias radiusAnim: radiusAnim
|
||||
property bool radiusMorph: true
|
||||
property alias shapeMorph: stateLayer.shapeMorph
|
||||
|
||||
+58
-2
@@ -2,6 +2,62 @@ import QtQuick
|
||||
import ZShell.Config
|
||||
|
||||
ColorAnimation {
|
||||
duration: Tokens.anim.durations.expressiveSlowEffects
|
||||
easing: Tokens.anim.expressiveSlowEffects
|
||||
enum Type {
|
||||
StandardSmall = 0,
|
||||
Standard,
|
||||
StandardLarge,
|
||||
StandardExtraLarge,
|
||||
EmphasizedSmall,
|
||||
Emphasized,
|
||||
EmphasizedLarge,
|
||||
EmphasizedExtraLarge,
|
||||
FastSpatial,
|
||||
DefaultSpatial,
|
||||
SlowSpatial,
|
||||
FastEffects,
|
||||
DefaultEffects,
|
||||
SlowEffects
|
||||
}
|
||||
|
||||
property int type: CAnim.DefaultSpatial
|
||||
|
||||
duration: {
|
||||
if (type < CAnim.StandardSmall || type > Anim.SlowEffects)
|
||||
return Tokens.anim.durations.normal;
|
||||
|
||||
if (type === CAnim.FastSpatial)
|
||||
return Tokens.anim.durations.expressiveFastSpatial;
|
||||
if (type === CAnim.DefaultSpatial)
|
||||
return Tokens.anim.durations.expressiveDefaultSpatial;
|
||||
if (type === CAnim.SlowSpatial)
|
||||
return Tokens.anim.durations.large;
|
||||
if (type === CAnim.FastEffects)
|
||||
return Tokens.anim.durations.expressiveFastEffects;
|
||||
if (type === CAnim.DefaultEffects)
|
||||
return Tokens.anim.durations.expressiveEffects;
|
||||
if (type === CAnim.SlowEffects)
|
||||
return Tokens.anim.durations.expressiveSlowEffects;
|
||||
|
||||
const types = ["small", "normal", "large", "extraLarge"];
|
||||
const idx = type % 4;
|
||||
return Tokens.anim.durations[types[idx]];
|
||||
}
|
||||
easing.bezierCurve: {
|
||||
if (type === CAnim.FastSpatial)
|
||||
return Tokens.anim.curves.expressiveFastSpatial;
|
||||
if (type === CAnim.DefaultSpatial)
|
||||
return Tokens.anim.curves.expressiveDefaultSpatial;
|
||||
if (type === CAnim.SlowSpatial)
|
||||
return Tokens.anim.curves.expressiveSlowSpatial;
|
||||
if (type === CAnim.FastEffects)
|
||||
return Tokens.anim.curves.expressiveFastEffects;
|
||||
if (type === CAnim.DefaultEffects)
|
||||
return Tokens.anim.curves.expressiveDefaultEffects;
|
||||
if (type === CAnim.SlowEffects)
|
||||
return Tokens.anim.curves.expressiveSlowEffects;
|
||||
|
||||
if (type >= CAnim.EmphasizedSmall && type <= Anim.EmphasizedExtraLarge)
|
||||
return Tokens.anim.curves.emphasized;
|
||||
return Tokens.anim.curves.standard;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ BusyIndicator {
|
||||
property real implicitSize: Tokens.font.size.normal * 3
|
||||
property real internalStrokeWidth: strokeWidth
|
||||
readonly property alias progress: manager.progress
|
||||
property real strokeWidth: Tokens.padding.extraSmall * 0.8
|
||||
property real strokeWidth: Tokens.padding.small * 0.8
|
||||
property alias type: manager.indeterminateAnimationType
|
||||
|
||||
implicitHeight: implicitSize
|
||||
@@ -34,6 +34,7 @@ BusyIndicator {
|
||||
anchors.fill: parent
|
||||
bgColor: root.bgColor
|
||||
fgColor: root.fgColor
|
||||
hasEndIndicator: false
|
||||
padding: root.padding
|
||||
rotation: manager.rotation
|
||||
startAngle: manager.startFraction * 360
|
||||
@@ -53,6 +54,7 @@ BusyIndicator {
|
||||
Anim {
|
||||
duration: manager.completeEndDuration * Tokens.anim.durations.scale
|
||||
properties: "opacity,internalStrokeWidth"
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ Item {
|
||||
readonly property real size: Math.min(width, height)
|
||||
property int spacing: Tokens.spacing.small
|
||||
property int startAngle: -90
|
||||
property int strokeWidth: Tokens.padding.extraSmall
|
||||
property int strokeWidth: Tokens.padding.small
|
||||
property int sweepAngle: 360
|
||||
readonly property real thickness: strokeWidth * (1 + waveAmplitude) * 2
|
||||
property real value
|
||||
|
||||
@@ -23,7 +23,7 @@ CheckBox {
|
||||
color: Colors.palette.m3surfaceVariant
|
||||
implicitHeight: control.checkHeight
|
||||
implicitWidth: control.checkWidth
|
||||
radius: Tokens.rounding.small / 2
|
||||
radius: Tokens.rounding.smallest / 2
|
||||
|
||||
CustomRect {
|
||||
color: Colors.palette.m3primary
|
||||
|
||||
@@ -28,8 +28,6 @@ Flickable {
|
||||
interval: 10
|
||||
running: root.doneFakeFlick
|
||||
|
||||
onTriggered: {
|
||||
root.doneFakeFlick = false;
|
||||
}
|
||||
onTriggered: root.doneFakeFlick = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,27 +10,24 @@ ListView {
|
||||
maximumFlickVelocity: 3000
|
||||
|
||||
rebound: Transition {
|
||||
// onRunningChanged: {
|
||||
// if (!running && !root.doneFakeFlick) {
|
||||
// root.doneFakeFlick = true;
|
||||
// root.flick(1, 1);
|
||||
// root.flick(-1, -1);
|
||||
// Qt.callLater(() => root.cancelFlick());
|
||||
// }
|
||||
// }
|
||||
onRunningChanged: {
|
||||
if (!running && !root.doneFakeFlick) {
|
||||
root.doneFakeFlick = true;
|
||||
root.flick(1, 1);
|
||||
root.flick(-1, -1);
|
||||
Qt.callLater(() => root.cancelFlick());
|
||||
}
|
||||
}
|
||||
|
||||
Anim {
|
||||
properties: "x,y"
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
|
||||
// Timer {
|
||||
// interval: 10
|
||||
// running: root.doneFakeFlick
|
||||
//
|
||||
// onTriggered: {
|
||||
// root.doneFakeFlick = false;
|
||||
// }
|
||||
// }
|
||||
Timer {
|
||||
interval: 10
|
||||
running: root.doneFakeFlick
|
||||
|
||||
onTriggered: root.doneFakeFlick = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ MouseArea {
|
||||
property int scrollAccumulatedY: 0
|
||||
|
||||
function onWheel(event: WheelEvent): void {
|
||||
event.accepted = false;
|
||||
}
|
||||
|
||||
onWheel: event => {
|
||||
|
||||
@@ -1,37 +1,32 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Templates
|
||||
import qs.Helpers
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
ScrollBar {
|
||||
id: root
|
||||
|
||||
required property Flickable flickable
|
||||
readonly property bool isHorizontal: flickable && flickable.ScrollBar.horizontal === root
|
||||
readonly property real axisSize: isHorizontal ? flickable.width : flickable.height
|
||||
readonly property real axisContentSize: isHorizontal ? flickable.contentWidth : flickable.contentHeight
|
||||
readonly property real axisContentPos: isHorizontal ? (flickable.contentX - flickable.originX) : (flickable.contentY - flickable.originY)
|
||||
readonly property real axisLength: isHorizontal ? root.width : root.height
|
||||
readonly property real effectiveSize: Math.max(nonAnimHeight, root.minimumSize)
|
||||
readonly property real effectiveTravel: Math.max(0, 1 - root.effectiveSize)
|
||||
readonly property real nonAnimHeight: root.axisSize / root.axisContentSize
|
||||
readonly property real nonAnimY: root.axisContentPos / root.axisContentSize
|
||||
required property Flickable flickable
|
||||
readonly property real nonAnimHeight: flickable.height / flickable.contentHeight
|
||||
readonly property real nonAnimY: flickable.contentY / flickable.contentHeight
|
||||
readonly property real rawTravel: Math.max(0, 1 - root.nonAnimHeight)
|
||||
readonly property bool reversed: isHorizontal ? (flickable instanceof ListView && flickable.layoutDirection === Qt.RightToLeft) : (flickable instanceof ListView && flickable.verticalLayoutDirection === ListView.BottomToTop)
|
||||
readonly property bool reversed: flickable instanceof ListView && flickable.verticalLayoutDirection === ListView.BottomToTop
|
||||
property bool shouldBeActive
|
||||
readonly property real travelScale: root.rawTravel > 0 ? root.effectiveTravel / root.rawTravel : 0
|
||||
|
||||
enabled: !Visibilities.getForActive().isDrawing
|
||||
implicitWidth: size === 1 ? 0 : isHorizontal ? 0 : Tokens.padding.extraSmall * 2
|
||||
implicitHeight: size === 1 ? 0 : isHorizontal ? Tokens.padding.extraSmall * 2 : 0
|
||||
implicitWidth: Tokens.padding.extraSmall * 2
|
||||
|
||||
contentItem: Item {}
|
||||
contentItem: Item {
|
||||
}
|
||||
Behavior on position {
|
||||
enabled: !fullMouse.pressed
|
||||
|
||||
Anim {}
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
|
||||
onHoveredChanged: {
|
||||
@@ -52,27 +47,54 @@ ScrollBar {
|
||||
target: root.flickable
|
||||
}
|
||||
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
active: root.size < 1
|
||||
sourceComponent: root.isHorizontal ? horizontalTrack : verticalTrack
|
||||
}
|
||||
CustomClippingRect {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
implicitWidth: handle.implicitWidth
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
Component {
|
||||
id: verticalTrack
|
||||
CustomRect {
|
||||
id: handle
|
||||
|
||||
VerticalScrollBarTrack {
|
||||
scrollBar: root
|
||||
mouseArea: fullMouse
|
||||
}
|
||||
}
|
||||
anchors.right: parent.right
|
||||
color: Colors.palette.m3secondary
|
||||
implicitHeight: root.height * root.effectiveSize
|
||||
implicitWidth: fullMouse.pressed || fullMouse.containsMouse ? Tokens.padding.extraSmall * 2 : Tokens.padding.extraSmall
|
||||
opacity: {
|
||||
if (!root.enabled)
|
||||
return 0;
|
||||
if (root.size === 1)
|
||||
return 0;
|
||||
if (fullMouse.pressed)
|
||||
return 1;
|
||||
if (fullMouse.containsMouse)
|
||||
return 0.8;
|
||||
if (root.policy === ScrollBar.AlwaysOn || root.shouldBeActive)
|
||||
return 0.6;
|
||||
return 0;
|
||||
}
|
||||
radius: Tokens.rounding.full
|
||||
y: root.reversed ? root.height * (1 + root.nonAnimY) * root.travelScale : root.height * root.nonAnimY * root.travelScale
|
||||
|
||||
Component {
|
||||
id: horizontalTrack
|
||||
Behavior on implicitWidth {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
|
||||
HorizontalScrollBarTrack {
|
||||
scrollBar: root
|
||||
mouseArea: fullMouse
|
||||
MouseArea {
|
||||
id: mouse
|
||||
|
||||
acceptedButtons: Qt.NoButton
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,40 +111,25 @@ ScrollBar {
|
||||
|
||||
property real pressOffset: 0
|
||||
|
||||
function contentPosFromThumbStart(thumbStart) {
|
||||
var visualPos = root.effectiveTravel > 0 ? thumbStart / root.travelScale : 0;
|
||||
return root.reversed ? (visualPos - 1) * root.axisContentSize : visualPos * root.axisContentSize;
|
||||
function contentYFromThumbTop(thumbTop) {
|
||||
var visualPos = root.effectiveTravel > 0 ? thumbTop / root.travelScale : 0;
|
||||
|
||||
return root.reversed ? (visualPos - 1) * root.flickable.contentHeight : visualPos * root.flickable.contentHeight;
|
||||
}
|
||||
|
||||
function updateFromEvent(event) {
|
||||
var eventPos = root.isHorizontal ? event.x : event.y;
|
||||
var posInTrack = eventPos / root.axisLength;
|
||||
var thumbStart = posInTrack - pressOffset;
|
||||
thumbStart = Math.max(0, Math.min(root.effectiveTravel, thumbStart));
|
||||
var posInTrack = event.y / root.height;
|
||||
var thumbTop = posInTrack - pressOffset;
|
||||
thumbTop = Math.max(0, Math.min(root.effectiveTravel, thumbTop));
|
||||
|
||||
var newPos = contentPosFromThumbStart(thumbStart);
|
||||
if (root.isHorizontal)
|
||||
root.flickable.contentX = newPos + root.flickable.originX;
|
||||
else
|
||||
root.flickable.contentY = newPos + root.flickable.originY;
|
||||
root.flickable.contentY = contentYFromThumbTop(thumbTop);
|
||||
}
|
||||
|
||||
function visualThumbStart() {
|
||||
function visualThumbTop() {
|
||||
const visualPos = root.reversed ? (1 + root.nonAnimY) : root.nonAnimY;
|
||||
return visualPos * root.travelScale;
|
||||
}
|
||||
|
||||
function onWheel(event: WheelEvent): void {
|
||||
if (root.horizontal) {
|
||||
event.accepted = false;
|
||||
return;
|
||||
}
|
||||
|
||||
var delta = event.angleDelta.y > 0 ? -0.1 : 0.1;
|
||||
var newPos = Math.max(0, Math.min(1 - root.size, root.position + delta));
|
||||
root.position = newPos;
|
||||
}
|
||||
|
||||
anchors.fill: parent
|
||||
cursorShape: undefined
|
||||
hoverEnabled: true
|
||||
@@ -133,15 +140,24 @@ ScrollBar {
|
||||
updateFromEvent(event);
|
||||
}
|
||||
onPressed: event => {
|
||||
var currentStart = visualThumbStart();
|
||||
var currentEnd = currentStart + root.effectiveSize;
|
||||
var eventPos = root.isHorizontal ? event.x : event.y;
|
||||
var clickPos = eventPos / root.axisLength;
|
||||
var currentTop = visualThumbTop();
|
||||
var currentBottom = currentTop + root.effectiveSize;
|
||||
var clickPos = event.y / root.height;
|
||||
|
||||
var clickedInsideThumb = clickPos >= currentStart && clickPos <= currentEnd;
|
||||
pressOffset = clickedInsideThumb ? (clickPos - currentStart) : root.effectiveSize / 2;
|
||||
var clickedInsideThumb = clickPos >= currentTop && clickPos <= currentBottom;
|
||||
|
||||
if (clickedInsideThumb) {
|
||||
pressOffset = clickPos - currentTop;
|
||||
} else {
|
||||
pressOffset = root.effectiveSize / 2;
|
||||
}
|
||||
|
||||
updateFromEvent(event);
|
||||
}
|
||||
onWheel: event => {
|
||||
var delta = event.angleDelta.y > 0 ? -0.1 : 0.1;
|
||||
var newPos = Math.max(0, Math.min(1 - root.size, root.position + delta));
|
||||
root.position = newPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ Slider {
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
Anim on waveProgress {
|
||||
NumberAnimation on waveProgress {
|
||||
duration: root.waveDuration
|
||||
easing.type: Easing.Linear
|
||||
from: 0
|
||||
|
||||
@@ -38,9 +38,9 @@ DoubleSpinBox {
|
||||
horizontalAlignment: TextField.AlignHCenter
|
||||
implicitWidth: 65
|
||||
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
||||
leftPadding: Tokens.padding.small
|
||||
leftPadding: Tokens.padding.larger
|
||||
readOnly: !root.editable
|
||||
rightPadding: Tokens.padding.small
|
||||
rightPadding: Tokens.padding.larger
|
||||
text: root.textFromValue(root.value, root.locale)
|
||||
validator: root.validator
|
||||
|
||||
|
||||
@@ -12,14 +12,14 @@ Row {
|
||||
}
|
||||
|
||||
property alias active: menu.active
|
||||
property color color: type == SplitButton.Filled ? Colors.palette.m3primary : Colors.palette.m3secondaryContainer
|
||||
property color color: type == CustomSplitButton.Filled ? Colors.palette.m3primary : Colors.palette.m3secondaryContainer
|
||||
property color disabledColor: Qt.alpha(Colors.palette.m3onSurface, 0.1)
|
||||
property color disabledTextColor: Qt.alpha(Colors.palette.m3onSurface, 0.38)
|
||||
readonly property alias expandBtn: expandBtn
|
||||
property alias expanded: menu.expanded
|
||||
property string fallbackIcon
|
||||
property string fallbackText
|
||||
property real horizontalPadding: Tokens.padding.medium
|
||||
property real horizontalPadding: Tokens.padding.larger
|
||||
readonly property alias iconLabel: iconLabel
|
||||
readonly property alias label: label
|
||||
readonly property alias menu: menu
|
||||
@@ -27,20 +27,20 @@ Row {
|
||||
property bool menuOnTop
|
||||
property real minLeftWidth
|
||||
readonly property alias stateLayer: stateLayer
|
||||
property color textColor: type == SplitButton.Filled ? Colors.palette.m3onPrimary : Colors.palette.m3onSecondaryContainer
|
||||
property color textColor: type == CustomSplitButton.Filled ? Colors.palette.m3onPrimary : Colors.palette.m3onSecondaryContainer
|
||||
readonly property alias textRow: textRow
|
||||
property int type: SplitButton.Filled
|
||||
property int type: CustomSplitButton.Filled
|
||||
property real verticalPadding: Tokens.padding.small
|
||||
|
||||
spacing: Math.floor(Tokens.spacing.extraSmall / 2)
|
||||
spacing: Math.floor(Tokens.spacing.extraSmall)
|
||||
|
||||
CustomRect {
|
||||
bottomRightRadius: Tokens.rounding.medium / 2
|
||||
bottomRightRadius: Tokens.rounding.small / 2
|
||||
color: !root.enabled ? root.disabledColor : root.color
|
||||
implicitHeight: expandBtn.implicitHeight
|
||||
implicitWidth: Math.max(root.minLeftWidth, textRow.implicitWidth + root.horizontalPadding * 2)
|
||||
radius: implicitHeight / 2 * Math.min(1, Tokens.rounding.scale)
|
||||
topRightRadius: Tokens.rounding.medium / 2
|
||||
topRightRadius: Tokens.rounding.small / 2
|
||||
|
||||
StateLayer {
|
||||
id: stateLayer
|
||||
@@ -92,7 +92,7 @@ Row {
|
||||
CustomRect {
|
||||
id: expandBtn
|
||||
|
||||
property real rad: root.expanded ? implicitHeight / 2 * Math.min(1, Tokens.rounding.scale) : Tokens.rounding.medium / 2
|
||||
property real rad: root.expanded ? implicitHeight / 2 * Math.min(1, Tokens.rounding.scale) : Tokens.rounding.small / 2
|
||||
|
||||
bottomLeftRadius: rad
|
||||
color: !root.enabled ? root.disabledColor : root.color
|
||||
@@ -0,0 +1,70 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property alias active: splitButton.active
|
||||
property alias buttonAlias: splitButton
|
||||
property alias expanded: splitButton.expanded
|
||||
property int expandedZ: 100
|
||||
required property string label
|
||||
property alias menuItems: splitButton.menuItems
|
||||
property bool shouldBeActive: true
|
||||
property alias type: splitButton.type
|
||||
|
||||
signal selected(item: MenuItem)
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
clip: false
|
||||
implicitHeight: row.implicitHeight + Tokens.padding.smaller * 2
|
||||
opacity: shouldBeActive ? 1 : 0
|
||||
scale: shouldBeActive ? 1 : 0.8
|
||||
z: splitButton.menu.implicitHeight > 0 ? expandedZ : 1
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on scale {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: row
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
color: root.enabled ? Colors.palette.m3onSurface : Colors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
text: root.label
|
||||
}
|
||||
|
||||
CustomSplitButton {
|
||||
id: splitButton
|
||||
|
||||
enabled: root.enabled
|
||||
type: CustomSplitButton.Filled
|
||||
z: 2
|
||||
|
||||
menu.onItemSelected: item => {
|
||||
root.selected(item);
|
||||
}
|
||||
stateLayer.onClicked: {
|
||||
splitButton.expanded = !splitButton.expanded;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,8 @@ Switch {
|
||||
implicitWidth: implicitIndicatorWidth
|
||||
|
||||
indicator: CustomRect {
|
||||
color: {
|
||||
if (!root.enabled)
|
||||
return root.checked ? Qt.alpha(Colors.palette.m3onSurface, 0.12) : Qt.alpha(Colors.palette.m3surfaceContainerHighest, 0.38);
|
||||
return root.checked ? Colors.palette.m3primary : Colors.layer(Colors.palette.m3surfaceContainerHighest, root.cLayer);
|
||||
}
|
||||
implicitHeight: 14 + Tokens.padding.small * 2
|
||||
color: root.checked && root.enabled ? Colors.palette.m3primary : Colors.layer(Colors.palette.m3surfaceContainerHighest, root.cLayer)
|
||||
implicitHeight: Tokens.font.size.medium + Tokens.padding.normal * 2
|
||||
implicitWidth: implicitHeight * 1.7
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
@@ -26,11 +22,7 @@ Switch {
|
||||
readonly property real nonAnimWidth: root.pressed ? implicitHeight * 1.2 : implicitHeight
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: {
|
||||
if (!root.enabled)
|
||||
return root.checked ? Qt.alpha(Colors.palette.m3surface, 0.7) : Qt.alpha(Colors.palette.m3onSurface, 0.12);
|
||||
return root.checked ? Colors.palette.m3onPrimary : Colors.layer(Colors.palette.m3outline, root.cLayer + 1);
|
||||
}
|
||||
color: root.checked && root.enabled ? Colors.palette.m3onPrimary : Colors.layer(Colors.palette.m3outline, root.cLayer + 1)
|
||||
implicitHeight: parent.implicitHeight - Tokens.padding.extraSmall
|
||||
implicitWidth: nonAnimWidth
|
||||
radius: Tokens.rounding.full
|
||||
@@ -100,7 +92,7 @@ Switch {
|
||||
|
||||
anchors.centerIn: parent
|
||||
asynchronous: true
|
||||
height: parent.implicitHeight - Tokens.padding.medium
|
||||
height: parent.implicitHeight - Tokens.padding.larger
|
||||
preferredRendererType: Shape.CurveRenderer
|
||||
width: height
|
||||
|
||||
@@ -122,16 +114,12 @@ Switch {
|
||||
}
|
||||
|
||||
ShapePath {
|
||||
capStyle: Tokens.rounding.scale === 0 ? ShapePath.SquareCap : ShapePath.RoundCap
|
||||
capStyle: ShapePath.RoundCap
|
||||
fillColor: "transparent"
|
||||
startX: icon.start1.x
|
||||
startY: icon.start1.y
|
||||
strokeColor: {
|
||||
if (!root.enabled)
|
||||
return root.checked ? Colors.palette.m3outline : Colors.palette.m3surfaceContainer;
|
||||
return root.checked ? Colors.palette.m3primary : Colors.palette.m3surfaceContainerHighest;
|
||||
}
|
||||
strokeWidth: 16 * 0.15
|
||||
strokeColor: root.checked && root.enabled ? Colors.palette.m3primary : Colors.palette.m3surfaceContainerHighest
|
||||
strokeWidth: Tokens.font.size.larger * 0.15
|
||||
|
||||
Behavior on strokeColor {
|
||||
CAnim {
|
||||
@@ -165,6 +153,6 @@ Switch {
|
||||
|
||||
component PropAnim: PropertyAnimation {
|
||||
duration: Tokens.anim.durations.expressiveFastSpatial
|
||||
easing: Tokens.anim.expressiveFastSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveFastSpatial
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ TextFieldBase {
|
||||
property string leadingIcon
|
||||
readonly property int leadingOffset: leadingIcon ? leadingIconLoader.width + leadingIconLoader.anchors.leftMargin : 0
|
||||
property int radius: Tokens.rounding.small
|
||||
property alias sLayer: stateLayer
|
||||
readonly property real smallFontScale: smallFontSize / font.pointSize
|
||||
property int smallFontSize: Tokens.font.size.small
|
||||
property string supportingText
|
||||
@@ -129,8 +130,8 @@ TextFieldBase {
|
||||
}
|
||||
|
||||
AnchorAnim {
|
||||
duration: Tokens.anim.durations.expressiveDefaultEffects
|
||||
easing: Tokens.anim.expressiveDefaultEffects
|
||||
duration: Tokens.anim.durations.expressiveEffects
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -140,11 +141,12 @@ TextFieldBase {
|
||||
|
||||
active: root.leadingIcon
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.normal
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
text: root.leadingIcon
|
||||
}
|
||||
}
|
||||
@@ -154,7 +156,7 @@ TextFieldBase {
|
||||
|
||||
active: root.trailingIcon
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Tokens.padding.small
|
||||
anchors.rightMargin: Tokens.padding.normal
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
import QtQuick
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
CustomClippingRect {
|
||||
id: track
|
||||
|
||||
required property var scrollBar
|
||||
required property var mouseArea
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
implicitHeight: handle.implicitHeight
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
CustomRect {
|
||||
id: handle
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
color: Colors.palette.m3secondary
|
||||
implicitWidth: track.scrollBar.width * track.scrollBar.effectiveSize
|
||||
implicitHeight: track.mouseArea.pressed || track.mouseArea.containsMouse ? Tokens.padding.extraSmall * 2 : Tokens.padding.extraSmall
|
||||
opacity: {
|
||||
if (!track.scrollBar.enabled)
|
||||
return 0;
|
||||
if (track.scrollBar.size === 1)
|
||||
return 0;
|
||||
if (track.mouseArea.pressed)
|
||||
return 1;
|
||||
if (track.mouseArea.containsMouse)
|
||||
return 0.8;
|
||||
if (track.scrollBar.policy === CustomScrollBar.AlwaysOn || track.scrollBar.shouldBeActive)
|
||||
return 0.6;
|
||||
return 0;
|
||||
}
|
||||
radius: Tokens.rounding.full
|
||||
x: track.scrollBar.reversed ? track.scrollBar.width * (1 + track.scrollBar.nonAnimY) * track.scrollBar.travelScale : track.scrollBar.width * track.scrollBar.nonAnimY * track.scrollBar.travelScale
|
||||
|
||||
Behavior on implicitHeight {
|
||||
Anim {}
|
||||
}
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
acceptedButtons: Qt.NoButton
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ ButtonBase {
|
||||
return Colors.palette.m3onPrimary;
|
||||
return type === IconButton.Tonal ? Colors.palette.m3onSecondaryContainer : Colors.palette.m3onSurfaceVariant;
|
||||
}
|
||||
padding: type === IconButton.Text ? Tokens.padding.extraSmall / 2 : Tokens.padding.extraSmall
|
||||
padding: type === IconButton.Text ? Tokens.padding.extraSmall / 2 : Tokens.padding.small
|
||||
|
||||
MaterialIcon {
|
||||
id: label
|
||||
|
||||
@@ -17,7 +17,7 @@ ButtonBase {
|
||||
return Colors.palette.m3primary;
|
||||
return type === TextButton.Filled ? Colors.palette.m3onPrimary : Colors.palette.m3onSecondary;
|
||||
}
|
||||
horizontalPadding: Tokens.padding.small
|
||||
horizontalPadding: Tokens.padding.larger
|
||||
implicitHeight: row.implicitHeight + verticalPadding * 2
|
||||
implicitWidth: row.implicitWidth + horizontalPadding * 2
|
||||
inactiveColor: {
|
||||
@@ -32,7 +32,7 @@ ButtonBase {
|
||||
return Colors.palette.m3primary;
|
||||
return type === TextButton.Filled ? Colors.palette.m3onSurface : Colors.palette.m3onSecondaryContainer;
|
||||
}
|
||||
verticalPadding: Tokens.padding.extraSmall
|
||||
verticalPadding: Tokens.padding.small
|
||||
|
||||
RowLayout {
|
||||
id: row
|
||||
|
||||
+5
-5
@@ -78,7 +78,7 @@ MouseArea {
|
||||
implicitHeight: column.implicitHeight + column.anchors.margins * 2
|
||||
implicitWidth: Math.max(200, column.implicitWidth + column.anchors.margins * 2)
|
||||
level: 2
|
||||
radius: Tokens.rounding.large
|
||||
radius: Tokens.rounding.medium
|
||||
x: {
|
||||
watcher.transform;
|
||||
const item = root.attachTo;
|
||||
@@ -132,9 +132,9 @@ MouseArea {
|
||||
|
||||
Layout.fillWidth: true
|
||||
color: Qt.alpha(Colors.palette.m3tertiaryContainer, active ? 1 : 0)
|
||||
implicitHeight: menuOptionRow.implicitHeight + Tokens.padding.medium * 2
|
||||
implicitWidth: menuOptionRow.implicitWidth + Tokens.padding.medium * 2
|
||||
radius: menu.radius - column.anchors.margins
|
||||
implicitHeight: menuOptionRow.implicitHeight + Tokens.padding.larger * 2
|
||||
implicitWidth: menuOptionRow.implicitWidth + Tokens.padding.larger * 2
|
||||
radius: Tokens.rounding.small
|
||||
|
||||
Behavior on radius {
|
||||
Anim {
|
||||
@@ -157,7 +157,7 @@ MouseArea {
|
||||
id: menuOptionRow
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.medium
|
||||
anchors.margins: Tokens.padding.larger
|
||||
spacing: Tokens.spacing.small
|
||||
|
||||
MaterialIcon {
|
||||
|
||||
@@ -70,7 +70,7 @@ TextFieldBase {
|
||||
id: clearIcon
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Tokens.padding.small
|
||||
anchors.rightMargin: Tokens.padding.larger
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
enabled: root.text
|
||||
icon: "clear"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import QtQuick
|
||||
import QtQuick.Shapes
|
||||
import ZShell
|
||||
import ZShell.Config
|
||||
import ZShell.Components
|
||||
import qs.Helpers
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
MouseArea {
|
||||
@@ -80,7 +81,7 @@ MouseArea {
|
||||
|
||||
alwaysRunToEnd: true
|
||||
duration: Tokens.anim.durations.expressiveSlowEffects * 2
|
||||
easing: Tokens.anim.standard
|
||||
easing.bezierCurve: Tokens.anim.curves.standard
|
||||
property: "circleRadius"
|
||||
target: root
|
||||
to: root.endRadius
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
import QtQuick
|
||||
import QtQuick.Templates
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
TextArea {
|
||||
id: root
|
||||
|
||||
color: Colors.palette.m3onSurface
|
||||
cursorVisible: !readOnly
|
||||
font.pointSize: Tokens.font.size.small
|
||||
implicitHeight: contentHeight + topPadding + bottomPadding
|
||||
implicitWidth: contentWidth + leftPadding + rightPadding
|
||||
placeholderTextColor: Colors.palette.m3onSurfaceVariant // No anim cause placeholder is custom
|
||||
renderType: TextArea.NativeRendering
|
||||
selectedTextColor: color
|
||||
selectionColor: Qt.alpha(Colors.palette.m3primary, 0.4)
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
}
|
||||
Behavior on selectionColor {
|
||||
CAnim {}
|
||||
}
|
||||
cursorDelegate: Item {}
|
||||
|
||||
CustomRect {
|
||||
id: cursor
|
||||
|
||||
property bool disableBlink
|
||||
|
||||
color: Colors.palette.m3primary
|
||||
implicitHeight: root.cursorRectangle.height
|
||||
implicitWidth: 1.5
|
||||
radius: Tokens.rounding.largeIncreased
|
||||
x: root.cursorRectangle.x
|
||||
y: root.cursorRectangle.y
|
||||
|
||||
Behavior on x {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveFastEffects
|
||||
easing.bezierCurve: [0.2, 1, 0.21, 1, 1, 1]
|
||||
}
|
||||
}
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
type: Anim.StandardSmall
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onCursorPositionChanged(): void {
|
||||
if (root.activeFocus && root.cursorVisible) {
|
||||
cursor.opacity = 1;
|
||||
cursor.disableBlink = true;
|
||||
enableBlink.restart();
|
||||
}
|
||||
}
|
||||
|
||||
target: root
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: enableBlink
|
||||
|
||||
interval: 500
|
||||
|
||||
onTriggered: cursor.disableBlink = false
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 500
|
||||
repeat: true
|
||||
running: root.activeFocus && root.cursorVisible && !cursor.disableBlink
|
||||
triggeredOnStart: true
|
||||
|
||||
onTriggered: parent.opacity = parent.opacity === 1 ? 0 : 1
|
||||
}
|
||||
|
||||
Binding {
|
||||
cursor.opacity: 0
|
||||
when: !root.activeFocus || !root.cursorVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ ButtonBase {
|
||||
return Colors.palette.m3primary;
|
||||
return type === TextButton.Filled ? Colors.palette.m3onPrimary : Colors.palette.m3onSecondary;
|
||||
}
|
||||
horizontalPadding: Tokens.padding.small
|
||||
horizontalPadding: Tokens.padding.normal
|
||||
implicitHeight: label.implicitHeight + verticalPadding * 2
|
||||
implicitWidth: label.implicitWidth + horizontalPadding * 2
|
||||
inactiveColor: {
|
||||
@@ -29,7 +29,7 @@ ButtonBase {
|
||||
return Colors.palette.m3primary;
|
||||
return type === TextButton.Filled ? Colors.palette.m3onSurface : Colors.palette.m3onSecondaryContainer;
|
||||
}
|
||||
verticalPadding: Tokens.padding.extraSmall
|
||||
verticalPadding: Tokens.padding.small
|
||||
|
||||
CustomText {
|
||||
id: label
|
||||
|
||||
@@ -1,100 +0,0 @@
|
||||
import QtQuick
|
||||
import QtQuick.Templates
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
TextEdit {
|
||||
id: root
|
||||
|
||||
property bool animateCursor: true
|
||||
property alias cursor: cursor
|
||||
|
||||
color: Colors.palette.m3onSurface
|
||||
cursorVisible: !readOnly
|
||||
font.pointSize: Tokens.font.size.small
|
||||
font.family: Config.appearance.font.family.sans
|
||||
renderType: TextField.NativeRendering
|
||||
selectedTextColor: color
|
||||
selectionColor: Qt.alpha(Colors.palette.m3primary, 0.4)
|
||||
verticalAlignment: TextInput.AlignVCenter
|
||||
|
||||
Behavior on color {
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
cursorDelegate: Item {
|
||||
}
|
||||
Behavior on selectionColor {
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
|
||||
CustomRect {
|
||||
id: cursor
|
||||
|
||||
property bool disableBlink
|
||||
|
||||
color: Colors.palette.m3primary
|
||||
implicitHeight: root.cursorRectangle.height
|
||||
implicitWidth: 1.5
|
||||
radius: Tokens.rounding.largeIncreased
|
||||
x: root.cursorRectangle.x
|
||||
y: root.cursorRectangle.y
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
type: Anim.StandardSmall
|
||||
}
|
||||
}
|
||||
Behavior on x {
|
||||
enabled: root.animateCursor
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveFastEffects
|
||||
easing.bezierCurve: [0.2, 1, 0.21, 1, 1, 1]
|
||||
}
|
||||
}
|
||||
Behavior on y {
|
||||
enabled: root.animateCursor
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveFastEffects
|
||||
easing.bezierCurve: [0.2, 1, 0.21, 1, 1, 1]
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onCursorPositionChanged(): void {
|
||||
if (root.activeFocus && root.cursorVisible) {
|
||||
cursor.opacity = 1;
|
||||
cursor.disableBlink = true;
|
||||
enableBlink.restart();
|
||||
}
|
||||
}
|
||||
|
||||
target: root
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: enableBlink
|
||||
|
||||
interval: 500
|
||||
|
||||
onTriggered: cursor.disableBlink = false
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 500
|
||||
repeat: true
|
||||
running: root.activeFocus && root.cursorVisible && !cursor.disableBlink
|
||||
triggeredOnStart: true
|
||||
|
||||
onTriggered: parent.opacity = parent.opacity === 1 ? 0 : 1
|
||||
}
|
||||
|
||||
Binding {
|
||||
cursor.opacity: 0
|
||||
when: !root.activeFocus || !root.cursorVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,7 @@ TextField {
|
||||
color: Colors.palette.m3primary
|
||||
implicitHeight: root.cursorRectangle.height
|
||||
implicitWidth: 1.5
|
||||
radius: Tokens.rounding.largeIncreased
|
||||
radius: Tokens.rounding.large
|
||||
x: root.cursorRectangle.x
|
||||
y: root.cursorRectangle.y
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ CustomRect {
|
||||
return Colors.palette.m3errorContainer;
|
||||
return Colors.palette.m3surface;
|
||||
}
|
||||
implicitHeight: layout.implicitHeight + Tokens.padding.small * 2
|
||||
radius: Tokens.rounding.medium
|
||||
implicitHeight: layout.implicitHeight + Tokens.padding.smaller * 2
|
||||
radius: Tokens.rounding.normal
|
||||
|
||||
Behavior on border.color {
|
||||
CAnim {
|
||||
@@ -52,10 +52,10 @@ CustomRect {
|
||||
id: layout
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.rightMargin: Tokens.padding.small
|
||||
spacing: Tokens.spacing.medium
|
||||
anchors.leftMargin: Tokens.padding.normal
|
||||
anchors.margins: Tokens.padding.smaller
|
||||
anchors.rightMargin: Tokens.padding.normal
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomRect {
|
||||
color: {
|
||||
@@ -67,9 +67,9 @@ CustomRect {
|
||||
return Colors.palette.m3error;
|
||||
return Colors.palette.m3surfaceContainerHigh;
|
||||
}
|
||||
implicitHeight: icon.implicitHeight + Tokens.padding.small * 2
|
||||
implicitHeight: icon.implicitHeight + Tokens.padding.smaller * 2
|
||||
implicitWidth: implicitHeight
|
||||
radius: Tokens.rounding.medium
|
||||
radius: Tokens.rounding.normal
|
||||
|
||||
MaterialIcon {
|
||||
id: icon
|
||||
|
||||
@@ -21,7 +21,7 @@ Item {
|
||||
}
|
||||
return h;
|
||||
}
|
||||
implicitWidth: Config.utilities.sizes.toastWidth - Tokens.padding.small * 2
|
||||
implicitWidth: Config.utilities.sizes.toastWidth - Tokens.padding.normal * 2
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
@@ -82,7 +82,7 @@ Item {
|
||||
Behavior on anchors.bottomMargin {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
||||
easing: Tokens.anim.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
Behavior on opacity {
|
||||
@@ -105,7 +105,7 @@ Item {
|
||||
id: initAnim
|
||||
|
||||
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
||||
easing: Tokens.anim.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveDefaultSpatial
|
||||
from: 0
|
||||
properties: "opacity,scale"
|
||||
target: toast
|
||||
|
||||
@@ -8,7 +8,6 @@ CustomListView {
|
||||
|
||||
property real endFadeOpacity: fadeShouldBeActive(false) ? 0 : 1
|
||||
property real fadeAmount: 0.1
|
||||
property real fadeThreshold: 0.0
|
||||
readonly property bool horizontal: orientation === ListView.Horizontal
|
||||
property real startFadeOpacity: fadeShouldBeActive(true) ? 0 : 1
|
||||
|
||||
@@ -29,11 +28,11 @@ CustomListView {
|
||||
}
|
||||
|
||||
function marginEnd(): real {
|
||||
return horizontal ? rightMargin - fadeThreshold : bottomMargin - fadeThreshold;
|
||||
return horizontal ? rightMargin : bottomMargin;
|
||||
}
|
||||
|
||||
function marginStart(): real {
|
||||
return horizontal ? leftMargin - fadeThreshold : topMargin - fadeThreshold;
|
||||
return horizontal ? leftMargin : topMargin;
|
||||
}
|
||||
|
||||
function overshootStart(): real {
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
import QtQuick
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
CustomClippingRect {
|
||||
id: track
|
||||
|
||||
required property var scrollBar
|
||||
required property var mouseArea
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
implicitWidth: handle.implicitWidth
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
CustomRect {
|
||||
id: handle
|
||||
|
||||
anchors.right: parent.right
|
||||
color: Colors.palette.m3secondary
|
||||
implicitHeight: track.scrollBar.height * track.scrollBar.effectiveSize
|
||||
implicitWidth: track.mouseArea.pressed || track.mouseArea.containsMouse ? Tokens.padding.extraSmall * 2 : Tokens.padding.extraSmall
|
||||
opacity: {
|
||||
if (!track.scrollBar.enabled)
|
||||
return 0;
|
||||
if (track.scrollBar.size === 1)
|
||||
return 0;
|
||||
if (track.mouseArea.pressed)
|
||||
return 1;
|
||||
if (track.mouseArea.containsMouse)
|
||||
return 0.8;
|
||||
if (track.scrollBar.policy === CustomScrollBar.AlwaysOn || track.scrollBar.shouldBeActive)
|
||||
return 0.6;
|
||||
return 0;
|
||||
}
|
||||
radius: Tokens.rounding.full
|
||||
y: track.scrollBar.reversed ? track.scrollBar.height * (1 + track.scrollBar.nonAnimY) * track.scrollBar.travelScale : track.scrollBar.height * track.scrollBar.nonAnimY * track.scrollBar.travelScale
|
||||
|
||||
Behavior on implicitWidth {
|
||||
Anim {}
|
||||
}
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
acceptedButtons: Qt.NoButton
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
hoverEnabled: true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,7 +236,7 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.dock.enable && Config.dock.hoverToReveal && !root.visibilities.dock && !root.visibilities.launcher && root.inBottomPanel(root.panels.dock, x, y))
|
||||
if (Config.dock.enabled && Config.dock.hoverToReveal && !root.visibilities.dock && !root.visibilities.launcher && root.inBottomPanel(root.panels.dock, x, y))
|
||||
root.visibilities.dock = true;
|
||||
|
||||
if (root.geometry.barContains(x, y))
|
||||
|
||||
+3
-2
@@ -111,7 +111,7 @@ Item {
|
||||
id: toasts
|
||||
|
||||
anchors.bottom: sidebar.visible ? parent.bottom : utilities.top
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.margins: Tokens.padding.normal
|
||||
anchors.right: sidebar.left
|
||||
}
|
||||
|
||||
@@ -140,6 +140,7 @@ Item {
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
popouts: popouts
|
||||
sidebar: sidebar
|
||||
visibilities: root.visibilities
|
||||
}
|
||||
@@ -160,7 +161,7 @@ Item {
|
||||
Behavior on offsetScale {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
||||
easing: Tokens.anim.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+28
-14
@@ -11,6 +11,7 @@ import ZShell.Blobs
|
||||
import qs.Daemons
|
||||
import qs.Components
|
||||
import qs.Modules.Bar
|
||||
import qs.Modules.Bar.Popouts.Network as N
|
||||
import ZShell.Config
|
||||
import qs.Helpers
|
||||
import qs.Drawers
|
||||
@@ -55,7 +56,7 @@ CustomWindow {
|
||||
property color surfaceColor: Colors.tPalette.m3surface
|
||||
|
||||
WlrLayershell.exclusionMode: ExclusionMode.Ignore
|
||||
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.settings || visibilities.sidebar ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||
WlrLayershell.keyboardFocus: visibilities.launcher || visibilities.settings ? WlrKeyboardFocus.OnDemand : WlrKeyboardFocus.None
|
||||
WlrLayershell.layer: (fsTransitionProg > 0 && Config.general.showOverFullscreen) || (hasSpecialWorkspace && hasFullscreenOnNormalWs) ? WlrLayer.Overlay : WlrLayer.Top
|
||||
color: "transparent"
|
||||
contentItem.focus: true
|
||||
@@ -63,10 +64,12 @@ CustomWindow {
|
||||
name: "Bar"
|
||||
|
||||
Behavior on fsTransitionProg {
|
||||
Anim {}
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on surfaceColor {
|
||||
CAnim {}
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
|
||||
contentItem.Keys.onEscapePressed: {
|
||||
@@ -142,7 +145,17 @@ CustomWindow {
|
||||
HyprlandFocusGrab {
|
||||
id: focusGrab
|
||||
|
||||
active: visibilities.dock || visibilities.resources || visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.settings || visibilities.clipboard || (panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu") && (!Config.bar.tray.showOnHover || (panels.popouts.current as StackView)?.depth > 1))
|
||||
active: {
|
||||
const v = visibilities;
|
||||
const conf = Config;
|
||||
if (!N.PopupManager.closed && panels.popouts.hasCurrent)
|
||||
return true;
|
||||
if ((v.launcher && conf.launcher.enabled) || (v.sidebar && conf.sidebar.enabled) || (v.resources && conf.dashboard.performance.enabled) || (v.dashboard && conf.dashboard.enabled) || v.settings || (v.clipboard && conf.clipboard.enabled) || (v.dock && conf.dock.enabled))
|
||||
return true;
|
||||
if (panels.popouts.hasCurrent && panels.popouts.currentName.startsWith("traymenu") && (!conf.bar.tray.showOnHover || (panels.popouts.current as StackView)?.depth > 1))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
windows: [root]
|
||||
|
||||
onCleared: {
|
||||
@@ -223,7 +236,7 @@ CustomWindow {
|
||||
implicitHeight: panels.dashboard.height * (geometry.horizontal ? 1 + extraExtent : 1)
|
||||
implicitWidth: panels.dashboard.width * (geometry.horizontal ? 1 : 1 + extraExtent)
|
||||
panel: panels.dashboardWrapper
|
||||
radius: Tokens.rounding.extraLarge
|
||||
radius: Tokens.rounding.normal
|
||||
x: panels.dashboardWrapper.x + panels.dashboard.x + geometry.insetLeft(root.borderThickness) - (geometry.horizontal ? 0 : panels.dashboard.width * extraExtent)
|
||||
y: panels.dashboardWrapper.y + panels.dashboard.y + geometry.insetTop(root.borderThickness) - (geometry.horizontal && geometry.position !== "bottom" ? panels.dashboard.height * extraExtent : 0)
|
||||
}
|
||||
@@ -236,7 +249,7 @@ CustomWindow {
|
||||
deformAmount: 0.06
|
||||
implicitHeight: panels.launcher.height * (1 + extraHeight)
|
||||
panel: panels.launcher
|
||||
radius: Tokens.rounding.medium + (Tokens.padding.largeIncreased / 4)
|
||||
radius: Tokens.rounding.smallest + 5
|
||||
y: panels.launcher.y + geometry.insetTop(root.borderThickness)
|
||||
}
|
||||
|
||||
@@ -265,7 +278,7 @@ CustomWindow {
|
||||
id: notifsBg
|
||||
|
||||
panel: panels.notifications
|
||||
radius: Tokens.rounding.large
|
||||
radius: Tokens.rounding.normal
|
||||
}
|
||||
|
||||
PanelBg {
|
||||
@@ -286,12 +299,13 @@ CustomWindow {
|
||||
implicitHeight: panels.popouts.height * (geometry.horizontal ? 1 + extraExtent : 1)
|
||||
implicitWidth: panels.popouts.width * (geometry.horizontal ? 1 : 1 + extraExtent)
|
||||
panel: panels.popoutsWrapper
|
||||
radius: panels.popouts.current?.panelRadius ?? Tokens.rounding.large
|
||||
radius: panels.popouts.current?.panelRadius ?? Tokens.rounding.normal
|
||||
x: panels.popoutsWrapper.x + panels.popouts.x + geometry.insetLeft(root.borderThickness) - (geometry.horizontal ? 0 : panels.popouts.width * extraExtent)
|
||||
y: panels.popoutsWrapper.y + panels.popouts.y + geometry.insetTop(root.borderThickness) - (geometry.barOnTop ? panels.popouts.height * extraExtent : 0)
|
||||
|
||||
Behavior on extraExtent {
|
||||
Anim {}
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +316,7 @@ CustomWindow {
|
||||
implicitHeight: panels.resources.height
|
||||
implicitWidth: panels.resources.width
|
||||
panel: panels.resourcesWrapper
|
||||
radius: Tokens.rounding.largeIncreased + Tokens.padding.small
|
||||
radius: Tokens.rounding.large
|
||||
x: panels.resourcesWrapper.x + panels.resources.x + geometry.insetLeft(root.borderThickness)
|
||||
y: panels.resourcesWrapper.y + panels.resources.y + geometry.insetTop(root.borderThickness)
|
||||
}
|
||||
@@ -312,7 +326,7 @@ CustomWindow {
|
||||
|
||||
deformAmount: 0.03
|
||||
panel: panels.settings
|
||||
radius: Tokens.rounding.largeIncreased + Tokens.padding.small
|
||||
radius: Tokens.rounding.large + Tokens.padding.normal
|
||||
}
|
||||
|
||||
PanelBg {
|
||||
@@ -320,7 +334,7 @@ CustomWindow {
|
||||
|
||||
deformAmount: 0.08
|
||||
panel: panels.dock
|
||||
radius: Tokens.rounding.medium
|
||||
radius: Tokens.rounding.normal
|
||||
}
|
||||
|
||||
PanelBg {
|
||||
@@ -328,7 +342,7 @@ CustomWindow {
|
||||
|
||||
deformAmount: 0.08
|
||||
panel: panels.drawing
|
||||
radius: Tokens.rounding.medium
|
||||
radius: Tokens.rounding.normal
|
||||
}
|
||||
|
||||
PanelBg {
|
||||
@@ -459,7 +473,7 @@ CustomWindow {
|
||||
group: blobGroup
|
||||
implicitHeight: panel.height
|
||||
implicitWidth: panel.width
|
||||
radius: Tokens.rounding.small
|
||||
radius: Tokens.rounding.smallest
|
||||
x: panel.x + geometry.insetLeft(root.borderThickness)
|
||||
y: panel.y + geometry.insetTop(root.borderThickness)
|
||||
}
|
||||
|
||||
+8
-8
@@ -18,7 +18,7 @@ ColumnLayout {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: false
|
||||
Layout.preferredWidth: centerWidth
|
||||
spacing: Tokens.spacing.largeIncreased * 2
|
||||
spacing: Tokens.spacing.large * 2
|
||||
|
||||
RowLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
@@ -64,7 +64,7 @@ ColumnLayout {
|
||||
|
||||
CustomClippingRect {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: Tokens.spacing.largeIncreased * 2
|
||||
Layout.topMargin: Tokens.spacing.large * 2
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: root.centerWidth / 2
|
||||
implicitWidth: root.centerWidth / 2
|
||||
@@ -99,7 +99,7 @@ ColumnLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
focus: true
|
||||
implicitHeight: input.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: input.implicitHeight + Tokens.padding.small * 2
|
||||
implicitWidth: root.centerWidth * 0.8
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
@@ -130,11 +130,11 @@ ColumnLayout {
|
||||
id: input
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.extraSmall
|
||||
spacing: Tokens.spacing.medium
|
||||
anchors.margins: Tokens.padding.small
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
Item {
|
||||
implicitHeight: statusIcon.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: statusIcon.implicitHeight + Tokens.padding.small * 2
|
||||
implicitWidth: implicitHeight
|
||||
|
||||
MaterialIcon {
|
||||
@@ -174,7 +174,7 @@ ColumnLayout {
|
||||
|
||||
CustomRect {
|
||||
color: root.greeter.buffer && !root.greeter.launching ? Colors.palette.m3primary : Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
||||
implicitHeight: enterIcon.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: enterIcon.implicitHeight + Tokens.padding.small * 2
|
||||
implicitWidth: implicitHeight
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
@@ -200,7 +200,7 @@ ColumnLayout {
|
||||
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: -Tokens.spacing.largeIncreased
|
||||
Layout.topMargin: -Tokens.spacing.large
|
||||
implicitHeight: Math.max(message.implicitHeight, stateMessage.implicitHeight)
|
||||
|
||||
Behavior on implicitHeight {
|
||||
|
||||
+11
-11
@@ -30,11 +30,11 @@ NumberAnimation {
|
||||
if (type === Anim.DefaultSpatial)
|
||||
return Tokens.anim.durations.expressiveDefaultSpatial;
|
||||
if (type === Anim.SlowSpatial)
|
||||
return Tokens.anim.durations.expressiveSlowSpatial;
|
||||
return Tokens.anim.durations.large;
|
||||
if (type === Anim.FastEffects)
|
||||
return Tokens.anim.durations.expressiveFastEffects;
|
||||
if (type === Anim.DefaultEffects)
|
||||
return Tokens.anim.durations.expressiveDefaultEffects;
|
||||
return Tokens.anim.durations.expressiveEffects;
|
||||
if (type === Anim.SlowEffects)
|
||||
return Tokens.anim.durations.expressiveSlowEffects;
|
||||
|
||||
@@ -42,22 +42,22 @@ NumberAnimation {
|
||||
const idx = type % 4; // 0-7 are the 4 standard types
|
||||
return Tokens.anim.durations[types[idx]];
|
||||
}
|
||||
easing: {
|
||||
easing.bezierCurve: {
|
||||
if (type === Anim.FastSpatial)
|
||||
return Tokens.anim.expressiveFastSpatial;
|
||||
return Tokens.anim.curves.expressiveFastSpatial;
|
||||
if (type === Anim.DefaultSpatial)
|
||||
return Tokens.anim.expressiveDefaultSpatial;
|
||||
return Tokens.anim.curves.expressiveDefaultSpatial;
|
||||
if (type === Anim.SlowSpatial)
|
||||
return Tokens.anim.expressiveSlowSpatial;
|
||||
return Tokens.anim.curves.expressiveSlowSpatial;
|
||||
if (type === Anim.FastEffects)
|
||||
return Tokens.anim.expressiveFastEffects;
|
||||
return Tokens.anim.curves.expressiveFastEffects;
|
||||
if (type === Anim.DefaultEffects)
|
||||
return Tokens.anim.expressiveDefaultEffects;
|
||||
return Tokens.anim.curves.expressiveDefaultEffects;
|
||||
if (type === Anim.SlowEffects)
|
||||
return Tokens.anim.expressiveSlowEffects;
|
||||
return Tokens.anim.curves.expressiveSlowEffects;
|
||||
|
||||
if (type >= Anim.EmphasizedSmall && type <= Anim.EmphasizedExtraLarge)
|
||||
return Tokens.anim.emphasized;
|
||||
return Tokens.anim.standard;
|
||||
return Tokens.anim.curves.emphasized;
|
||||
return Tokens.anim.curves.standard;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,62 @@ import QtQuick
|
||||
import ZShell.Config
|
||||
|
||||
ColorAnimation {
|
||||
duration: Tokens.anim.durations.expressiveSlowEffects
|
||||
easing: Tokens.anim.expressiveSlowEffects
|
||||
enum Type {
|
||||
StandardSmall = 0,
|
||||
Standard,
|
||||
StandardLarge,
|
||||
StandardExtraLarge,
|
||||
EmphasizedSmall,
|
||||
Emphasized,
|
||||
EmphasizedLarge,
|
||||
EmphasizedExtraLarge,
|
||||
FastSpatial,
|
||||
DefaultSpatial,
|
||||
SlowSpatial,
|
||||
FastEffects,
|
||||
DefaultEffects,
|
||||
SlowEffects
|
||||
}
|
||||
|
||||
property int type: CAnim.DefaultSpatial
|
||||
|
||||
duration: {
|
||||
if (type < CAnim.StandardSmall || type > Anim.SlowEffects)
|
||||
return Tokens.anim.durations.normal;
|
||||
|
||||
if (type === CAnim.FastSpatial)
|
||||
return Tokens.anim.durations.expressiveFastSpatial;
|
||||
if (type === CAnim.DefaultSpatial)
|
||||
return Tokens.anim.durations.expressiveDefaultSpatial;
|
||||
if (type === CAnim.SlowSpatial)
|
||||
return Tokens.anim.durations.large;
|
||||
if (type === CAnim.FastEffects)
|
||||
return Tokens.anim.durations.expressiveFastEffects;
|
||||
if (type === CAnim.DefaultEffects)
|
||||
return Tokens.anim.durations.expressiveEffects;
|
||||
if (type === CAnim.SlowEffects)
|
||||
return Tokens.anim.durations.expressiveSlowEffects;
|
||||
|
||||
const types = ["small", "normal", "large", "extraLarge"];
|
||||
const idx = type % 4;
|
||||
return Tokens.anim.durations[types[idx]];
|
||||
}
|
||||
easing.bezierCurve: {
|
||||
if (type === CAnim.FastSpatial)
|
||||
return Tokens.anim.curves.expressiveFastSpatial;
|
||||
if (type === CAnim.DefaultSpatial)
|
||||
return Tokens.anim.curves.expressiveDefaultSpatial;
|
||||
if (type === CAnim.SlowSpatial)
|
||||
return Tokens.anim.curves.expressiveSlowSpatial;
|
||||
if (type === CAnim.FastEffects)
|
||||
return Tokens.anim.curves.expressiveFastEffects;
|
||||
if (type === CAnim.DefaultEffects)
|
||||
return Tokens.anim.curves.expressiveDefaultEffects;
|
||||
if (type === CAnim.SlowEffects)
|
||||
return Tokens.anim.curves.expressiveSlowEffects;
|
||||
|
||||
if (type >= CAnim.EmphasizedSmall && type <= Anim.EmphasizedExtraLarge)
|
||||
return Tokens.anim.curves.emphasized;
|
||||
return Tokens.anim.curves.standard;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ BusyIndicator {
|
||||
property real implicitSize: Tokens.font.size.normal * 3
|
||||
property real internalStrokeWidth: strokeWidth
|
||||
readonly property alias progress: manager.progress
|
||||
property real strokeWidth: Tokens.padding.extraSmall * 0.8
|
||||
property real strokeWidth: Tokens.padding.small * 0.8
|
||||
property alias type: manager.indeterminateAnimationType
|
||||
|
||||
implicitHeight: implicitSize
|
||||
|
||||
@@ -21,7 +21,7 @@ Item {
|
||||
readonly property real size: Math.min(width, height)
|
||||
property int spacing: Tokens.spacing.small
|
||||
property int startAngle: -90
|
||||
property int strokeWidth: Tokens.padding.extraSmall
|
||||
property int strokeWidth: Tokens.padding.small
|
||||
property int sweepAngle: 360
|
||||
readonly property real thickness: strokeWidth * (1 + waveAmplitude) * 2
|
||||
property real value
|
||||
|
||||
@@ -27,7 +27,7 @@ TextField {
|
||||
|
||||
color: Colors.palette.m3primary
|
||||
implicitWidth: 2
|
||||
radius: Tokens.rounding.medium
|
||||
radius: Tokens.rounding.normal
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
|
||||
@@ -81,7 +81,7 @@ MouseArea {
|
||||
|
||||
alwaysRunToEnd: true
|
||||
duration: Tokens.anim.durations.expressiveSlowEffects * 2
|
||||
easing: Tokens.anim.standard
|
||||
easing.bezierCurve: Tokens.anim.curves.standard
|
||||
property: "circleRadius"
|
||||
target: root
|
||||
to: root.endRadius
|
||||
|
||||
+7
-7
@@ -11,18 +11,18 @@ RowLayout {
|
||||
required property var greeter
|
||||
required property real screenHeight
|
||||
|
||||
spacing: Tokens.spacing.largeIncreased * 2
|
||||
spacing: Tokens.spacing.large * 2
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Tokens.spacing.medium
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: weather.implicitHeight
|
||||
radius: Tokens.rounding.small
|
||||
topLeftRadius: Tokens.rounding.largeIncreased
|
||||
topLeftRadius: Tokens.rounding.large
|
||||
|
||||
WeatherInfo {
|
||||
id: weather
|
||||
@@ -34,7 +34,7 @@ RowLayout {
|
||||
CustomClippingRect {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
bottomLeftRadius: Tokens.rounding.largeIncreased
|
||||
bottomLeftRadius: Tokens.rounding.large
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
radius: Tokens.rounding.small
|
||||
|
||||
@@ -51,15 +51,15 @@ RowLayout {
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Tokens.spacing.medium
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomRect {
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
bottomRightRadius: Tokens.rounding.largeIncreased
|
||||
bottomRightRadius: Tokens.rounding.large
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
radius: Tokens.rounding.small
|
||||
topRightRadius: Tokens.rounding.largeIncreased
|
||||
topRightRadius: Tokens.rounding.large
|
||||
|
||||
SessionDock {
|
||||
greeter: root.greeter
|
||||
|
||||
@@ -43,7 +43,7 @@ Scope {
|
||||
ParallelAnimation {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveFastSpatial
|
||||
easing: Tokens.anim.expressiveFastSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveFastSpatial
|
||||
property: "scale"
|
||||
target: lockContent
|
||||
to: 1
|
||||
@@ -65,7 +65,7 @@ Scope {
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
||||
easing: Tokens.anim.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveDefaultSpatial
|
||||
property: "scale"
|
||||
target: content
|
||||
to: 1
|
||||
@@ -74,12 +74,12 @@ Scope {
|
||||
Anim {
|
||||
property: "radius"
|
||||
target: lockBg
|
||||
to: Tokens.rounding.largeIncreased * 1.5
|
||||
to: Tokens.rounding.large * 1.5
|
||||
}
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
||||
easing: Tokens.anim.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveDefaultSpatial
|
||||
property: "implicitWidth"
|
||||
target: lockContent
|
||||
to: (win.screen?.height ?? 0) * Config.lock.sizes.heightMult * Config.lock.sizes.ratio
|
||||
@@ -87,7 +87,7 @@ Scope {
|
||||
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
||||
easing: Tokens.anim.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveDefaultSpatial
|
||||
property: "implicitHeight"
|
||||
target: lockContent
|
||||
to: (win.screen?.height ?? 0) * Config.lock.sizes.heightMult
|
||||
|
||||
@@ -113,7 +113,7 @@ Item {
|
||||
Behavior on scale {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveFastSpatial
|
||||
easing: Tokens.anim.expressiveFastSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveFastSpatial
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,17 +13,21 @@ import qs.Paths
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property M3Palette current: M3Palette {}
|
||||
readonly property M3Palette current: M3Palette {
|
||||
}
|
||||
property bool currentLight
|
||||
property string flavour
|
||||
readonly property bool light: showPreview ? previewLight : currentLight
|
||||
readonly property M3Palette palette: showPreview ? preview : current
|
||||
readonly property M3Palette preview: M3Palette {}
|
||||
readonly property M3Palette preview: M3Palette {
|
||||
}
|
||||
property bool previewLight
|
||||
property string scheme
|
||||
property bool showPreview
|
||||
readonly property M3TPalette tPalette: M3TPalette {}
|
||||
readonly property Transparency transparency: Transparency {}
|
||||
readonly property M3TPalette tPalette: M3TPalette {
|
||||
}
|
||||
readonly property Transparency transparency: Transparency {
|
||||
}
|
||||
readonly property alias wallLuminance: analyser.luminance
|
||||
|
||||
function alterColor(c: color, a: real, layer: int): color {
|
||||
@@ -108,7 +112,8 @@ Singleton {
|
||||
|
||||
function setMode(mode: string): void {
|
||||
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--mode", mode]);
|
||||
Config.colors.mode = mode;
|
||||
Config.general.color.mode = mode;
|
||||
Config.save();
|
||||
}
|
||||
|
||||
function swapRG(c: color): color {
|
||||
|
||||
@@ -13,7 +13,7 @@ ColumnLayout {
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.large
|
||||
spacing: Tokens.spacing.small
|
||||
spacing: Tokens.spacing.smaller
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
@@ -41,7 +41,7 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
sourceComponent: ColumnLayout {
|
||||
spacing: Tokens.spacing.largeIncreased
|
||||
spacing: Tokens.spacing.large
|
||||
|
||||
MaterialIcon {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
@@ -79,8 +79,8 @@ ColumnLayout {
|
||||
|
||||
anchors.left: parent?.left
|
||||
anchors.right: parent?.right
|
||||
implicitHeight: row.implicitHeight + Tokens.padding.small * 2
|
||||
radius: Tokens.rounding.medium - Tokens.padding.small
|
||||
implicitHeight: row.implicitHeight + Tokens.padding.normal * 2
|
||||
radius: Tokens.rounding.normal - Tokens.padding.smaller
|
||||
|
||||
StateLayer {
|
||||
onClicked: {
|
||||
@@ -92,8 +92,8 @@ ColumnLayout {
|
||||
id: row
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.small
|
||||
spacing: Tokens.spacing.medium
|
||||
anchors.margins: Tokens.padding.normal
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
MaterialIcon {
|
||||
color: session.index === sessions.currentIndex ? Colors.palette.m3onPrimary : Colors.palette.m3onSurfaceVariant
|
||||
@@ -129,13 +129,13 @@ ColumnLayout {
|
||||
color: Colors.palette.m3primary
|
||||
implicitHeight: sessions.currentItem?.implicitHeight ?? 0
|
||||
implicitWidth: sessions.width
|
||||
radius: Tokens.rounding.medium - Tokens.padding.small
|
||||
radius: Tokens.rounding.normal - Tokens.padding.smaller
|
||||
y: sessions.currentItem?.y ?? 0
|
||||
|
||||
Behavior on y {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.small
|
||||
easing: Tokens.anim.expressiveDefaultEffects
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ ColumnLayout {
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.large
|
||||
spacing: Tokens.spacing.small
|
||||
spacing: Tokens.spacing.smaller
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
@@ -42,7 +42,7 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
sourceComponent: ColumnLayout {
|
||||
spacing: Tokens.spacing.largeIncreased
|
||||
spacing: Tokens.spacing.large
|
||||
|
||||
MaterialIcon {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
@@ -81,8 +81,8 @@ ColumnLayout {
|
||||
|
||||
anchors.left: parent?.left
|
||||
anchors.right: parent?.right
|
||||
implicitHeight: row.implicitHeight + Tokens.padding.small * 2
|
||||
radius: Tokens.rounding.medium - Tokens.padding.small
|
||||
implicitHeight: row.implicitHeight + Tokens.padding.normal * 2
|
||||
radius: Tokens.rounding.normal - Tokens.padding.smaller
|
||||
|
||||
StateLayer {
|
||||
onClicked: {
|
||||
@@ -94,8 +94,8 @@ ColumnLayout {
|
||||
id: row
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.small
|
||||
spacing: Tokens.spacing.medium
|
||||
anchors.margins: Tokens.padding.normal
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomClippingRect {
|
||||
Layout.preferredHeight: 50
|
||||
@@ -135,13 +135,13 @@ ColumnLayout {
|
||||
color: Colors.palette.m3primary
|
||||
implicitHeight: users.currentItem?.implicitHeight ?? 0
|
||||
implicitWidth: users.width
|
||||
radius: Tokens.rounding.medium - Tokens.padding.small
|
||||
radius: Tokens.rounding.normal - Tokens.padding.smaller
|
||||
y: users.currentItem?.y ?? 0
|
||||
|
||||
Behavior on y {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveDefaultEffects
|
||||
easing: Tokens.anim.expressiveDefaultEffects
|
||||
duration: Tokens.anim.durations.small
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ ColumnLayout {
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: Tokens.spacing.largeIncreased
|
||||
spacing: Tokens.spacing.large
|
||||
|
||||
MaterialIcon {
|
||||
animate: true
|
||||
@@ -67,7 +67,7 @@ ColumnLayout {
|
||||
}
|
||||
|
||||
Loader {
|
||||
Layout.rightMargin: Tokens.padding.small
|
||||
Layout.rightMargin: Tokens.padding.smaller
|
||||
active: root.width > 400
|
||||
visible: active
|
||||
|
||||
@@ -103,12 +103,12 @@ ColumnLayout {
|
||||
|
||||
Layout.bottomMargin: Tokens.padding.large * 2
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Tokens.spacing.small
|
||||
Layout.topMargin: Tokens.spacing.smaller
|
||||
active: root.rootHeight > 820
|
||||
visible: active
|
||||
|
||||
sourceComponent: RowLayout {
|
||||
spacing: Tokens.spacing.largeIncreased
|
||||
spacing: Tokens.spacing.large
|
||||
|
||||
Repeater {
|
||||
model: {
|
||||
|
||||
@@ -9,13 +9,13 @@ Singleton {
|
||||
id: root
|
||||
|
||||
readonly property bool enabled: service.enabled
|
||||
readonly property int end: Config.display.nightlight.scheduleEnd
|
||||
readonly property int end: Config.general.color.scheduleHyprsunsetEnd
|
||||
property bool manualToggle: false
|
||||
readonly property int start: Config.display.nightlight.scheduleStart
|
||||
readonly property int temp: Config.display.nightlight.temp
|
||||
readonly property int start: Config.general.color.scheduleHyprsunsetStart
|
||||
readonly property int temp: Config.general.color.hyprsunsetTemp
|
||||
|
||||
function checkStartup(): void {
|
||||
if (!Config.display.nightlight.schedule)
|
||||
if (!Config.general.color.scheduleHyprsunset)
|
||||
return;
|
||||
|
||||
service.apply();
|
||||
@@ -26,14 +26,12 @@ Singleton {
|
||||
service.toggle();
|
||||
}
|
||||
|
||||
NightlightManager {
|
||||
HyprsunsetManager {
|
||||
id: service
|
||||
|
||||
activeAuto: Config.display.nightlight.schedule
|
||||
activeAuto: Config.general.color.scheduleHyprsunset
|
||||
endTime: root.end
|
||||
startTime: root.start
|
||||
temp: root.temp
|
||||
fadeDuration: Config.display.nightlight.fadeDuration / 1000
|
||||
useNativeNightlight: Config.display.nightlight.useNative
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,16 +77,6 @@ Singleton {
|
||||
"99": "thunderstorm"
|
||||
})
|
||||
|
||||
function getAppCategoryIcon(name: string, fallback: string): string {
|
||||
const categories = DesktopEntries.heuristicLookup(name)?.categories;
|
||||
|
||||
if (categories)
|
||||
for (const [key, value] of Object.entries(categoryIcons))
|
||||
if (categories.includes(key))
|
||||
return value;
|
||||
return fallback;
|
||||
}
|
||||
|
||||
function getAppIcon(name: string, fallback: string): string {
|
||||
const icon = DesktopEntries.heuristicLookup(name)?.icon;
|
||||
if (fallback !== "undefined")
|
||||
|
||||
@@ -11,14 +11,14 @@ import qs.Services
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property int darkEnd: Config.colors.scheduleDarkEnd
|
||||
readonly property int darkStart: Config.colors.scheduleDarkStart
|
||||
readonly property bool enabled: Config.colors.scheduleDark && Config.colors.schemeGen
|
||||
readonly property int darkEnd: Config.general.color.scheduleDarkEnd
|
||||
readonly property int darkStart: Config.general.color.scheduleDarkStart
|
||||
readonly property bool enabled: Config.general.color.scheduleDark && Config.general.color.schemeGeneration
|
||||
|
||||
function applyDarkMode() {
|
||||
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--mode", "dark"]);
|
||||
|
||||
Config.colors.mode = "dark";
|
||||
Config.general.color.mode = "dark";
|
||||
|
||||
Quickshell.execDetached(["gsettings", "set", "org.gnome.desktop.interface", "color-scheme", "'prefer-dark'"]);
|
||||
|
||||
@@ -30,13 +30,13 @@ Singleton {
|
||||
function applyLightMode() {
|
||||
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--mode", "light"]);
|
||||
|
||||
Config.colors.mode = "light";
|
||||
Config.general.color.mode = "light";
|
||||
|
||||
Quickshell.execDetached(["gsettings", "set", "org.gnome.desktop.interface", "color-scheme", "'prefer-light'"]);
|
||||
|
||||
Quickshell.execDetached(["sh", "-c", `sed -i 's/color_scheme_path=\\(.*\\)Dark.colors/color_scheme_path=\\1Light.colors/' ${Paths.home}/.config/qt6ct/qt6ct.conf`]);
|
||||
|
||||
if (Config.colors.neovimColors)
|
||||
if (Config.general.color.neovimColors)
|
||||
Quickshell.execDetached(["sed", "-i", "'s/\\(vim.cmd.colorscheme \\).*/\\1\"onelight\"/'", "~/.config/nvim/lua/config/load-colorscheme.lua"]);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Networking
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property bool active: false
|
||||
readonly property list<Network> connectedNetworks: networks.filter(n => n.connected)
|
||||
property Network connectingNetwork
|
||||
readonly property list<NetworkDevice> devices: Networking.devices.values
|
||||
property Network failedNetwork
|
||||
readonly property list<Network> knownNetworks: networks.filter(n => n.known && !n.connected)
|
||||
readonly property list<Network> networks: {
|
||||
const list = [];
|
||||
for (const d of wifiDevices) {
|
||||
for (const n of d.networks.values) {
|
||||
if (!list.includes(n))
|
||||
list.push(n);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
property bool scanning: false
|
||||
readonly property list<Network> unknownNetworks: networks.filter(n => !n.known)
|
||||
readonly property list<WifiDevice> wifiDevices: devices.filter(d => wifiDevice(d))
|
||||
readonly property bool wifiEnabled: Networking.wifiEnabled
|
||||
|
||||
signal networkConnected
|
||||
|
||||
function isSecure(security): bool {
|
||||
return (security === WifiSecurityType.WpaPsk || security === WifiSecurityType.Wpa2Psk || security === WifiSecurityType.Sae);
|
||||
}
|
||||
|
||||
function requestConnect(network: Network, secret = undefined): void {
|
||||
connectingNetwork = network;
|
||||
if (secret === undefined || secret === "") {
|
||||
network.connect();
|
||||
} else {
|
||||
(network as WifiNetwork).connectWithPsk(secret);
|
||||
}
|
||||
}
|
||||
|
||||
function setScan(value: bool): void {
|
||||
for (const d of wifiDevices) {
|
||||
d.scannerEnabled = value;
|
||||
}
|
||||
}
|
||||
|
||||
function setWifi(value: bool): void {
|
||||
Networking.wifiEnabled = value;
|
||||
}
|
||||
|
||||
function wifiDevice(dev): bool {
|
||||
return dev.type === DeviceType.Wifi;
|
||||
}
|
||||
|
||||
onActiveChanged: {
|
||||
for (const d of wifiDevices)
|
||||
d.scannerEnabled = active;
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: flushFailed
|
||||
|
||||
interval: 5000
|
||||
running: root.failedNetwork
|
||||
|
||||
onTriggered: {
|
||||
root.failedNetwork = null;
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: checkConnection
|
||||
|
||||
interval: 500
|
||||
repeat: true
|
||||
running: root.connectingNetwork
|
||||
|
||||
onTriggered: {
|
||||
var completedNetwork;
|
||||
|
||||
switch (root.connectingNetwork.state) {
|
||||
case ConnectionState.Connecting:
|
||||
break;
|
||||
case ConnectionState.Connected:
|
||||
completedNetwork = root.connectingNetwork;
|
||||
root.networkConnected();
|
||||
break;
|
||||
case ConnectionState.Disconnected:
|
||||
root.failedNetwork = root.connectingNetwork;
|
||||
completedNetwork = root.connectingNetwork;
|
||||
break;
|
||||
}
|
||||
|
||||
if (completedNetwork) {
|
||||
root.connectingNetwork = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Timer {
|
||||
interval: 10000
|
||||
running: checkConnection.running
|
||||
|
||||
onTriggered: {
|
||||
root.failedNetwork = root.connectingNetwork;
|
||||
root.connectingNetwork = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
-11
@@ -126,29 +126,33 @@ Item {
|
||||
focus: true
|
||||
opacity: 0
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
Behavior on rsx {
|
||||
enabled: !selectArea.pressed && root.mode === "select"
|
||||
|
||||
ExAnim {}
|
||||
ExAnim {
|
||||
}
|
||||
}
|
||||
Behavior on rsy {
|
||||
enabled: !selectArea.pressed && root.mode === "select"
|
||||
|
||||
ExAnim {}
|
||||
ExAnim {
|
||||
}
|
||||
}
|
||||
Behavior on sh {
|
||||
enabled: !selectArea.pressed && root.mode === "select"
|
||||
|
||||
ExAnim {}
|
||||
ExAnim {
|
||||
}
|
||||
}
|
||||
Behavior on sw {
|
||||
enabled: !selectArea.pressed && root.mode === "select"
|
||||
|
||||
ExAnim {}
|
||||
}
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
duration: 300
|
||||
ExAnim {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,7 +352,8 @@ Item {
|
||||
y: selectionRect.y - root.realBorderWidth
|
||||
|
||||
Behavior on border.color {
|
||||
Anim {}
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -386,7 +391,7 @@ Item {
|
||||
tool: root.tool
|
||||
visible: root.mode === "edit"
|
||||
x: Math.max(8, Math.min(root.rsx + root.sw / 2 - width / 2, root.screen.width - width - 8))
|
||||
y: (root.rsy + root.sh + height + Tokens.padding.small <= root.screen.height) ? root.rsy + root.sh + Tokens.padding.small : (root.rsy - height - Tokens.padding.small <= 0) ? root.rsy + root.sh - height - Tokens.padding.small : root.rsy - height - Tokens.padding.small
|
||||
y: (root.rsy + root.sh + height + Tokens.padding.normal <= root.screen.height) ? root.rsy + root.sh + Tokens.padding.normal : (root.rsy - height - Tokens.padding.normal <= 0) ? root.rsy + root.sh - height - Tokens.padding.normal : root.rsy - height - Tokens.padding.normal
|
||||
|
||||
onCancelRequested: root.cancel()
|
||||
onClearRequested: annotations.clearAll()
|
||||
@@ -397,5 +402,6 @@ Item {
|
||||
onUndoRequested: annotations.undo()
|
||||
}
|
||||
|
||||
component ExAnim: Anim {}
|
||||
component ExAnim: Anim {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,9 +49,9 @@ CustomRect {
|
||||
signal undoRequested
|
||||
|
||||
color: Colors.palette.m3surface
|
||||
height: row.implicitHeight + Tokens.padding.small * 2
|
||||
height: row.implicitHeight + Tokens.padding.normal * 2
|
||||
radius: Tokens.rounding.full
|
||||
width: row.implicitWidth + Tokens.padding.small * 2
|
||||
width: row.implicitWidth + Tokens.padding.normal * 2
|
||||
|
||||
RowLayout {
|
||||
id: row
|
||||
@@ -73,7 +73,6 @@ CustomRect {
|
||||
required property var modelData
|
||||
|
||||
color: root.tool === modelData.id ? "#3584e4" : "transparent"
|
||||
font.pointSize: Tokens.font.size.large
|
||||
icon: tool.modelData.glyph
|
||||
inactiveColor: root.tool === modelData.id ? Colors.palette.m3primary : "transparent"
|
||||
inactiveOnColor: root.tool === modelData.id ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
||||
@@ -99,11 +98,11 @@ CustomRect {
|
||||
model: root.colorPalette
|
||||
|
||||
delegate: IconButton {
|
||||
readonly property real buttonSize: toolRow.implicitHeight - Tokens.padding.small
|
||||
readonly property real buttonSize: toolRow.implicitHeight - Tokens.padding.normal
|
||||
required property color modelData
|
||||
|
||||
fillWidth: false
|
||||
font.pointSize: Tokens.font.size.large
|
||||
font.pointSize: 0
|
||||
icon: ""
|
||||
implicitHeight: buttonSize
|
||||
implicitWidth: buttonSize
|
||||
@@ -128,7 +127,6 @@ CustomRect {
|
||||
spacing: Tokens.spacing.extraSmall
|
||||
|
||||
IconButton {
|
||||
font.pointSize: Tokens.font.size.large
|
||||
icon: "undo"
|
||||
inactiveColor: "transparent"
|
||||
inactiveOnColor: Colors.palette.m3onSurface
|
||||
@@ -140,7 +138,6 @@ CustomRect {
|
||||
}
|
||||
|
||||
IconButton {
|
||||
font.pointSize: Tokens.font.size.large
|
||||
icon: "delete_history"
|
||||
inactiveColor: "transparent"
|
||||
inactiveOnColor: Colors.palette.m3onSurface
|
||||
@@ -152,7 +149,6 @@ CustomRect {
|
||||
}
|
||||
|
||||
IconButton {
|
||||
font.pointSize: Tokens.font.size.large
|
||||
icon: "content_copy"
|
||||
inactiveColor: "transparent"
|
||||
inactiveOnColor: Colors.palette.m3onSurface
|
||||
@@ -164,7 +160,6 @@ CustomRect {
|
||||
}
|
||||
|
||||
IconButton {
|
||||
font.pointSize: Tokens.font.size.large
|
||||
icon: "delete_forever"
|
||||
inactiveColor: "transparent"
|
||||
inactiveOnColor: Colors.palette.m3onSurface
|
||||
@@ -176,7 +171,6 @@ CustomRect {
|
||||
}
|
||||
|
||||
IconButton {
|
||||
font.pointSize: Tokens.font.size.large
|
||||
icon: "check"
|
||||
inactiveColor: "transparent"
|
||||
inactiveOnColor: Colors.palette.m3onSurface
|
||||
|
||||
@@ -38,7 +38,7 @@ Searcher {
|
||||
previewPath = path;
|
||||
showPreview = true;
|
||||
|
||||
if (Config.colors.schemeGen)
|
||||
if (Config.general.color.schemeGeneration)
|
||||
previewColorsProc.running = true;
|
||||
}
|
||||
|
||||
@@ -62,8 +62,8 @@ Searcher {
|
||||
WallpaperPath.currentWallpaperPath = path;
|
||||
Quickshell.screens.forEach(n => setCrop(n.name, Qt.rect(0, 0, 1, 1), 1.0));
|
||||
Quickshell.execDetached(["zshell-cli", "wallpaper", "lockscreen", "--input-image", `${root.actualCurrent}`, "--output-path", `${Paths.state}/lockscreen_bg.png`, "--blur-amount", `${Config.lock.blurAmount}`]);
|
||||
if (Config.colors.schemeGen)
|
||||
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--image-path", `${root.actualCurrent}`, "--scheme", `${Config.colors.schemeType}`, "--mode", `${Config.colors.mode}`]);
|
||||
if (Config.general.color.schemeGeneration)
|
||||
Quickshell.execDetached(["zshell-cli", "scheme", "generate", "--image-path", `${root.actualCurrent}`, "--scheme", `${Config.colors.schemeType}`, "--mode", `${Config.general.color.mode}`]);
|
||||
}
|
||||
|
||||
function stopPreview(): void {
|
||||
|
||||
@@ -205,15 +205,6 @@ GridLayout {
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "network"
|
||||
|
||||
delegate: EntryWrapper {
|
||||
NetworkWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "media"
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Item {
|
||||
required property bool fullscreen
|
||||
readonly property bool horizontal: position !== "left"
|
||||
property bool isHovered
|
||||
readonly property int padding: Math.max(Tokens.padding.small, Config.bar.border)
|
||||
readonly property int padding: Math.max(Tokens.padding.smaller, Config.bar.border)
|
||||
required property Wrapper popouts
|
||||
required property ClipWrapper popoutsWrapper
|
||||
required property string position
|
||||
|
||||
@@ -44,7 +44,7 @@ WidgetBase {
|
||||
}
|
||||
required property GridLayout loader
|
||||
required property Wrapper popouts
|
||||
readonly property real size: horizontal ? timeText.contentWidth + Tokens.padding.medium * 2 : verticalColumn.implicitHeight + Tokens.padding.medium * 2
|
||||
readonly property real size: horizontal ? timeText.contentWidth + Tokens.padding.normal * 2 : verticalColumn.implicitHeight + Tokens.padding.larger * 2
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
color: visibilities.dashboard ? Colors.palette.m3primary : Colors.tPalette.m3surfaceContainer
|
||||
@@ -57,13 +57,14 @@ WidgetBase {
|
||||
|
||||
anchors.centerIn: parent
|
||||
color: root.contentColor
|
||||
font.family: Config.appearance.font.family.clock // qmllint disable incompatible-type
|
||||
font.family: Config.appearance.font.family.mono // qmllint disable incompatible-type
|
||||
height: implicitHeight
|
||||
text: Time.dateStr
|
||||
visible: root.horizontal
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +72,7 @@ WidgetBase {
|
||||
id: verticalColumn
|
||||
|
||||
anchors.centerIn: parent
|
||||
spacing: Tokens.padding.extraSmall ?? 2
|
||||
spacing: Tokens.padding.small ?? 2
|
||||
visible: !root.horizontal
|
||||
width: root.baseSize
|
||||
|
||||
@@ -83,19 +84,20 @@ WidgetBase {
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: root.contentColor
|
||||
font.family: Config.appearance.font.family.clock // qmllint disable incompatible-type
|
||||
font.family: Config.appearance.font.family.mono // qmllint disable incompatible-type
|
||||
text: Qt.formatDateTime(Time.date, modelData)
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.bottomMargin: Tokens.padding.extraSmall ?? 2
|
||||
Layout.topMargin: Tokens.padding.extraSmall ?? 2
|
||||
Layout.bottomMargin: Tokens.padding.small ?? 2
|
||||
Layout.topMargin: Tokens.padding.small ?? 2
|
||||
color: root.contentColor
|
||||
height: 1
|
||||
implicitWidth: root.baseSize * 0.5
|
||||
@@ -112,7 +114,7 @@ WidgetBase {
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: root.contentColor
|
||||
font.family: Config.appearance.font.family.clock // qmllint disable incompatible-type
|
||||
font.family: Config.appearance.font.family.mono // qmllint disable incompatible-type
|
||||
text: {
|
||||
if (modelData.includes("h"))
|
||||
return Time.hourStr;
|
||||
@@ -124,7 +126,8 @@ WidgetBase {
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,12 +135,13 @@ WidgetBase {
|
||||
CustomText {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: root.contentColor
|
||||
font.family: Config.appearance.font.family.clock // qmllint disable incompatible-type
|
||||
font.family: Config.appearance.font.family.mono // qmllint disable incompatible-type
|
||||
text: Qt.formatDateTime(Time.date, "AP")
|
||||
visible: Config.services.useTwelveHourClock && root.formatParts.timeTokens.length > 0
|
||||
|
||||
Behavior on color {
|
||||
CAnim {}
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@ import qs.Helpers
|
||||
Row {
|
||||
id: root
|
||||
|
||||
property real batHeight: Tokens.padding.small * 2
|
||||
property real batWidth: Tokens.padding.medium * 2
|
||||
property real batHeight: Tokens.padding.smaller * 2
|
||||
property real batWidth: Tokens.padding.larger * 2
|
||||
required property string devState
|
||||
property real nubHeight: Tokens.padding.extraSmall
|
||||
property real nubHeight: Tokens.padding.small
|
||||
property real nubWidth: 2
|
||||
required property real percentage
|
||||
property real radius: Tokens.rounding.small / 2
|
||||
property real radius: Tokens.rounding.smallest / 2
|
||||
|
||||
spacing: 1
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@ WidgetBase {
|
||||
readonly property string currentMedia: (Players.active?.trackTitle ?? qsTr("No media")) || qsTr("Unknown title")
|
||||
readonly property int textWidth: Math.min(metrics.width, 200)
|
||||
|
||||
implicitHeight: horizontal ? baseSize : layout.implicitHeight + Tokens.padding.small * 2
|
||||
implicitWidth: horizontal ? layout.implicitWidth + Tokens.padding.small * 2 : baseSize
|
||||
implicitHeight: horizontal ? baseSize : layout.implicitHeight + Tokens.padding.normal * 2
|
||||
implicitWidth: horizontal ? layout.implicitWidth + Tokens.padding.normal * 2 : baseSize
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
Behavior on implicitHeight {
|
||||
@@ -39,11 +39,11 @@ WidgetBase {
|
||||
GridLayout {
|
||||
id: layout
|
||||
|
||||
anchors.bottomMargin: root.horizontal ? 0 : Tokens.padding.small
|
||||
anchors.bottomMargin: root.horizontal ? 0 : Tokens.padding.normal
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: root.horizontal ? Tokens.padding.small : 0
|
||||
anchors.rightMargin: root.horizontal ? Tokens.padding.small : 0
|
||||
anchors.topMargin: root.horizontal ? 0 : Tokens.padding.small
|
||||
anchors.leftMargin: root.horizontal ? Tokens.padding.normal : 0
|
||||
anchors.rightMargin: root.horizontal ? Tokens.padding.normal : 0
|
||||
anchors.topMargin: root.horizontal ? 0 : Tokens.padding.normal
|
||||
columns: root.horizontal ? -1 : 1
|
||||
|
||||
Behavior on implicitWidth {
|
||||
|
||||
@@ -22,7 +22,7 @@ GridLayout {
|
||||
property bool warning: percentage * 100 >= warningThreshold
|
||||
property int warningThreshold: 80
|
||||
|
||||
columnSpacing: Tokens.spacing.medium
|
||||
columnSpacing: Tokens.spacing.smaller
|
||||
columns: horizontal ? -1 : 1
|
||||
percentage: 0
|
||||
|
||||
@@ -49,7 +49,7 @@ GridLayout {
|
||||
}
|
||||
|
||||
CustomClippingRect {
|
||||
Layout.preferredHeight: root.horizontal ? icon.implicitHeight - Tokens.padding.extraSmall : 4
|
||||
Layout.preferredHeight: root.horizontal ? icon.implicitHeight - Tokens.padding.small : 4
|
||||
Layout.preferredWidth: root.horizontal ? 4 : icon.implicitWidth
|
||||
color: Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
@@ -16,8 +16,8 @@ WidgetBase {
|
||||
|
||||
clip: true
|
||||
color: visibilities.resources ? Colors.palette.m3primary : Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: horizontal ? baseSize : gridLayout.implicitHeight + Tokens.padding.medium * 2
|
||||
implicitWidth: horizontal ? gridLayout.implicitWidth + Tokens.padding.medium * 2 : baseSize
|
||||
implicitHeight: horizontal ? baseSize : gridLayout.implicitHeight + Tokens.padding.normal * 2
|
||||
implicitWidth: horizontal ? gridLayout.implicitWidth + Tokens.padding.larger * 2 : baseSize
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
StateLayer {
|
||||
@@ -32,7 +32,7 @@ WidgetBase {
|
||||
anchors.centerIn: parent
|
||||
anchors.horizontalCenterOffset: root.horizontal ? 0 : 1
|
||||
anchors.verticalCenterOffset: root.horizontal ? 0 : -3
|
||||
columnSpacing: Tokens.spacing.small
|
||||
columnSpacing: Tokens.spacing.smaller
|
||||
columns: root.horizontal ? -1 : 1
|
||||
|
||||
ServiceRef {
|
||||
|
||||
@@ -30,8 +30,8 @@ WidgetBase {
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
readonly property real size: horizontal ? grid.implicitWidth + grid.anchors.leftMargin + grid.anchors.rightMargin : grid.implicitHeight + grid.anchors.bottomMargin + grid.anchors.topMargin
|
||||
readonly property int spacing: Tokens.spacing.medium / 2
|
||||
readonly property real size: horizontal ? grid.implicitWidth + Tokens.padding.small * 2 : grid.implicitHeight + Tokens.padding.small * 2
|
||||
readonly property int spacing: Tokens.spacing.normal / 2
|
||||
|
||||
// Entries that can shrink to nothing, spacing included
|
||||
function collapsed(entry: var): bool {
|
||||
@@ -40,13 +40,13 @@ WidgetBase {
|
||||
return false;
|
||||
}
|
||||
|
||||
bottomLeftRadius: horizontal ? Tokens.rounding.small / 2 : Tokens.rounding.full
|
||||
bottomLeftRadius: horizontal ? Tokens.rounding.smallest / 2 : Tokens.rounding.full
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: horizontal ? baseSize : size
|
||||
implicitWidth: horizontal ? size : baseSize
|
||||
radius: Tokens.rounding.full
|
||||
topLeftRadius: Tokens.rounding.small / 2
|
||||
topRightRadius: horizontal ? Tokens.rounding.full : Tokens.rounding.small / 2
|
||||
topLeftRadius: Tokens.rounding.smallest / 2
|
||||
topRightRadius: horizontal ? Tokens.rounding.full : Tokens.rounding.smallest / 2
|
||||
|
||||
Behavior on implicitHeight {
|
||||
enabled: !root.horizontal
|
||||
@@ -64,11 +64,11 @@ WidgetBase {
|
||||
GridLayout {
|
||||
id: grid
|
||||
|
||||
anchors.bottomMargin: root.horizontal ? 0 : Tokens.padding.medium
|
||||
anchors.bottomMargin: root.horizontal ? 0 : Tokens.padding.small
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: root.horizontal ? Tokens.padding.extraSmall : 0
|
||||
anchors.rightMargin: root.horizontal ? Tokens.padding.extraSmall : 0
|
||||
anchors.topMargin: root.horizontal ? 0 : Tokens.padding.extraSmall
|
||||
anchors.leftMargin: root.horizontal ? Tokens.padding.small : 0
|
||||
anchors.rightMargin: root.horizontal ? Tokens.padding.small : 0
|
||||
anchors.topMargin: root.horizontal ? 0 : Tokens.padding.small
|
||||
columns: root.horizontal ? -1 : 1
|
||||
|
||||
Repeater {
|
||||
@@ -105,6 +105,28 @@ WidgetBase {
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "bluetooth"
|
||||
|
||||
delegate: EntryWrapper {
|
||||
name: "bluetooth"
|
||||
|
||||
BluetoothWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "network"
|
||||
|
||||
delegate: EntryWrapper {
|
||||
name: "network"
|
||||
|
||||
NetworkWidget {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "power"
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
import qs.Components
|
||||
|
||||
MaterialIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
animate: true
|
||||
color: Colors.palette.m3onSurface // Network.connected ? root.textColor : Colors.palette.m3error
|
||||
fill: 1
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
text: "bluetooth"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
import qs.Components
|
||||
|
||||
MaterialIcon {
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
animate: true
|
||||
color: Colors.palette.m3onSurface // Network.connected ? root.textColor : Colors.palette.m3error
|
||||
fill: 1
|
||||
font.pointSize: Tokens.font.size.larger
|
||||
text: "android_wifi_4_bar"
|
||||
}
|
||||
@@ -16,26 +16,22 @@ WidgetBase {
|
||||
readonly property alias items: repeater
|
||||
readonly property alias layout: sysGrid
|
||||
required property GridLayout loader
|
||||
readonly property int padding: Tokens.padding.extraSmall
|
||||
readonly property int padding: Tokens.padding.small
|
||||
required property Wrapper popouts
|
||||
readonly property real size: horizontal ? sysGrid.implicitWidth + sysGrid.anchors.leftMargin + sysGrid.anchors.rightMargin : sysGrid.implicitHeight + sysGrid.anchors.topMargin + sysGrid.anchors.bottomMargin
|
||||
readonly property real size: horizontal ? sysGrid.implicitWidth + Tokens.padding.small : sysGrid.implicitHeight + Tokens.padding.small
|
||||
|
||||
bottomLeftRadius: horizontal ? Tokens.rounding.full : Tokens.rounding.small / 2
|
||||
bottomRightRadius: Tokens.rounding.small / 2
|
||||
bottomLeftRadius: horizontal ? Tokens.rounding.full : Tokens.rounding.smallest / 2
|
||||
bottomRightRadius: Tokens.rounding.smallest / 2
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: horizontal ? baseSize : size
|
||||
implicitWidth: horizontal ? size : baseSize
|
||||
radius: Tokens.rounding.full
|
||||
topRightRadius: horizontal ? Tokens.rounding.small / 2 : Tokens.rounding.full
|
||||
topRightRadius: horizontal ? Tokens.rounding.smallest / 2 : Tokens.rounding.full
|
||||
|
||||
GridLayout {
|
||||
id: sysGrid
|
||||
|
||||
anchors.bottomMargin: root.horizontal ? 0 : Tokens.padding.extraSmall
|
||||
anchors.centerIn: parent
|
||||
anchors.leftMargin: root.horizontal ? Tokens.padding.extraSmall : 0
|
||||
anchors.rightMargin: root.horizontal ? Tokens.padding.extraSmall : 0
|
||||
anchors.topMargin: root.horizontal ? 0 : Tokens.padding.extraSmall
|
||||
columns: root.horizontal ? -1 : 1
|
||||
rowSpacing: -2
|
||||
|
||||
@@ -50,7 +46,6 @@ WidgetBase {
|
||||
required property int index
|
||||
required property SystemTrayItem modelData
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
|
||||
implicitHeight: 34
|
||||
implicitWidth: 34
|
||||
ind: index
|
||||
|
||||
@@ -12,7 +12,7 @@ import qs.Services
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property real activeWorkspaceMargin: Math.ceil(Tokens.padding.medium / 4)
|
||||
property real activeWorkspaceMargin: Math.ceil(Tokens.padding.small / 2)
|
||||
readonly property int effectiveActiveWorkspaceId: monitor?.activeWorkspace?.id ?? 1
|
||||
required property bool horizontal
|
||||
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen)
|
||||
|
||||
@@ -15,13 +15,12 @@ import qs.Services
|
||||
Item {
|
||||
id: root
|
||||
|
||||
readonly property int panelRadius: Tokens.rounding.largeIncreased + Tokens.padding.smaller
|
||||
readonly property int rounding: panelRadius - Tokens.padding.smaller
|
||||
readonly property int rounding: Tokens.rounding.small - Tokens.padding.small
|
||||
readonly property int topMargin: 0
|
||||
required property var wrapper
|
||||
|
||||
implicitHeight: vol.implicitHeight + Tokens.padding.smaller * 2
|
||||
implicitWidth: 500 + Tokens.padding.smaller * 2
|
||||
implicitHeight: vol.implicitHeight + Tokens.padding.small * 2
|
||||
implicitWidth: 500 + Tokens.padding.small * 2
|
||||
|
||||
CustomRect {
|
||||
anchors.left: parent.left
|
||||
@@ -29,7 +28,7 @@ Item {
|
||||
anchors.top: parent.top
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: parent.implicitHeight
|
||||
radius: root.rounding
|
||||
radius: Tokens.rounding.small
|
||||
y: parent.y
|
||||
|
||||
Behavior on implicitHeight {
|
||||
@@ -42,7 +41,7 @@ Item {
|
||||
id: vol
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Tokens.padding.smaller
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
@@ -52,17 +51,17 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 65 + Tokens.spacing.small * 2
|
||||
Layout.preferredHeight: 65 + Tokens.spacing.smaller * 2
|
||||
Layout.topMargin: root.topMargin
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
radius: root.rounding - vol.anchors.margins
|
||||
radius: root.rounding
|
||||
|
||||
ColumnLayout {
|
||||
anchors.bottomMargin: Tokens.padding.small
|
||||
anchors.bottomMargin: Tokens.padding.smaller
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.rightMargin: Tokens.padding.small
|
||||
anchors.topMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.larger
|
||||
anchors.rightMargin: Tokens.padding.larger
|
||||
anchors.topMargin: Tokens.padding.smaller
|
||||
|
||||
RowLayout {
|
||||
Layout.fillHeight: true
|
||||
@@ -83,12 +82,12 @@ Item {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Tokens.spacing.largeIncreased
|
||||
spacing: Tokens.spacing.large
|
||||
|
||||
CustomMouseArea {
|
||||
Layout.bottomMargin: Tokens.padding.small
|
||||
Layout.bottomMargin: Tokens.padding.normal
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Tokens.padding.medium * 3
|
||||
Layout.preferredHeight: Tokens.padding.larger * 3
|
||||
|
||||
CustomSlider {
|
||||
anchors.left: parent.left
|
||||
@@ -110,7 +109,7 @@ Item {
|
||||
}
|
||||
|
||||
CustomSwitch {
|
||||
Layout.bottomMargin: Tokens.padding.small
|
||||
Layout.bottomMargin: Tokens.padding.normal
|
||||
checked: !Audio.muted
|
||||
|
||||
onToggled: {
|
||||
@@ -125,10 +124,10 @@ Item {
|
||||
|
||||
CustomClippingRect {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 65 + Tokens.spacing.small * 2
|
||||
Layout.preferredHeight: 65 + Tokens.spacing.smaller * 2
|
||||
Layout.topMargin: root.topMargin
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
radius: root.rounding - vol.anchors.margins
|
||||
radius: root.rounding
|
||||
|
||||
PwNodePeakMonitor {
|
||||
id: sourcePeak
|
||||
@@ -152,11 +151,11 @@ Item {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
anchors.bottomMargin: Tokens.padding.small
|
||||
anchors.bottomMargin: Tokens.padding.smaller
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.rightMargin: Tokens.padding.small
|
||||
anchors.topMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.larger
|
||||
anchors.rightMargin: Tokens.padding.larger
|
||||
anchors.topMargin: Tokens.padding.smaller
|
||||
|
||||
RowLayout {
|
||||
Layout.fillHeight: true
|
||||
@@ -177,12 +176,12 @@ Item {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Tokens.spacing.largeIncreased
|
||||
spacing: Tokens.spacing.large
|
||||
|
||||
CustomMouseArea {
|
||||
Layout.bottomMargin: Tokens.padding.small
|
||||
Layout.bottomMargin: Tokens.padding.normal
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Tokens.padding.medium * 3
|
||||
Layout.preferredHeight: Tokens.padding.larger * 3
|
||||
|
||||
CustomSlider {
|
||||
anchors.left: parent.left
|
||||
@@ -204,7 +203,7 @@ Item {
|
||||
}
|
||||
|
||||
CustomSwitch {
|
||||
Layout.bottomMargin: Tokens.padding.small
|
||||
Layout.bottomMargin: Tokens.padding.normal
|
||||
checked: !Audio.sourceMuted
|
||||
|
||||
onToggled: {
|
||||
@@ -237,10 +236,10 @@ Item {
|
||||
required property var modelData
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 65 + Tokens.spacing.small * 2
|
||||
Layout.preferredHeight: 65 + Tokens.spacing.smaller * 2
|
||||
Layout.topMargin: root.topMargin
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
radius: root.rounding - vol.anchors.margins
|
||||
radius: root.rounding
|
||||
|
||||
PwNodePeakMonitor {
|
||||
id: peak
|
||||
@@ -272,11 +271,11 @@ Item {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
anchors.bottomMargin: Tokens.padding.small
|
||||
anchors.bottomMargin: Tokens.padding.smaller
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.rightMargin: Tokens.padding.small
|
||||
anchors.topMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.larger
|
||||
anchors.rightMargin: Tokens.padding.larger
|
||||
anchors.topMargin: Tokens.padding.smaller
|
||||
|
||||
RowLayout {
|
||||
Layout.fillHeight: true
|
||||
@@ -298,12 +297,12 @@ Item {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
spacing: Tokens.spacing.largeIncreased
|
||||
spacing: Tokens.spacing.large
|
||||
|
||||
CustomMouseArea {
|
||||
Layout.bottomMargin: Tokens.padding.small
|
||||
Layout.bottomMargin: Tokens.padding.normal
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Tokens.padding.medium * 3
|
||||
Layout.preferredHeight: Tokens.padding.larger * 3
|
||||
|
||||
CustomSlider {
|
||||
anchors.left: parent.left
|
||||
@@ -325,7 +324,7 @@ Item {
|
||||
}
|
||||
|
||||
CustomSwitch {
|
||||
Layout.bottomMargin: Tokens.padding.small
|
||||
Layout.bottomMargin: Tokens.padding.normal
|
||||
checked: !appBox.modelData.audio.muted
|
||||
|
||||
onToggled: {
|
||||
|
||||
@@ -0,0 +1,385 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQml.Models
|
||||
import Quickshell
|
||||
import Quickshell.Bluetooth
|
||||
import ZShell.Components
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
import qs.Components
|
||||
import qs.Helpers
|
||||
|
||||
CustomClippingRect {
|
||||
id: root
|
||||
|
||||
readonly property list<var> btConnected: Bluetooth.devices.values.filter(d => d.connected)
|
||||
|
||||
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
|
||||
implicitWidth: 500
|
||||
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.larger
|
||||
spacing: Tokens.spacing.extraSmall / 2
|
||||
|
||||
CustomText {
|
||||
Layout.rightMargin: Tokens.padding.extraSmall
|
||||
Layout.topMargin: Tokens.padding.normal
|
||||
font.pointSize: Tokens.font.size.large
|
||||
text: qsTr("Bluetooth")
|
||||
}
|
||||
|
||||
Toggle {
|
||||
checked: Bluetooth.defaultAdapter?.enabled ?? false // qmllint disable unresolved-type
|
||||
first: true
|
||||
subtext: qsTr("Toggle bluetooth device state")
|
||||
text: checked ? qsTr("Enabled") : qsTr("Disabled")
|
||||
|
||||
onToggled: {
|
||||
const adapter = Bluetooth.defaultAdapter; // qmllint disable unresolved-type
|
||||
if (adapter)
|
||||
adapter.enabled = checked;
|
||||
}
|
||||
}
|
||||
|
||||
Toggle {
|
||||
checked: Bluetooth.defaultAdapter?.discovering ?? false // qmllint disable unresolved-type
|
||||
last: root.btConnected.length === 0
|
||||
subtext: qsTr("Enable scanning for new devices")
|
||||
text: qsTr("Discover")
|
||||
|
||||
onToggled: {
|
||||
const adapter = Bluetooth.defaultAdapter; // qmllint disable unresolved-type
|
||||
if (adapter)
|
||||
adapter.discovering = checked;
|
||||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: rows
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: contentHeight
|
||||
interactive: false
|
||||
section.property: "connected"
|
||||
spacing: Tokens.spacing.extraSmall / 2
|
||||
|
||||
add: Transition {
|
||||
Anim {
|
||||
from: 0
|
||||
property: "opacity"
|
||||
to: 1
|
||||
}
|
||||
}
|
||||
delegate: DelegateChooser {
|
||||
role: "isDivider"
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: true
|
||||
|
||||
delegate: StatusDivider {
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
delegate: BluetoothItem {
|
||||
list: rows
|
||||
width: rows.width
|
||||
}
|
||||
}
|
||||
}
|
||||
displaced: Transition {
|
||||
Anim {
|
||||
easing.type: Easing.OutCubic
|
||||
property: "y"
|
||||
}
|
||||
}
|
||||
model: ScriptModel {
|
||||
objectProp: "address"
|
||||
values: {
|
||||
const byName = (a, b) => a.name.localeCompare(b.name);
|
||||
return [...[...Bluetooth.devices.values].filter(d => d.connected).sort(byName).slice(0, 5),
|
||||
{
|
||||
isDivider: true
|
||||
},
|
||||
...[...Bluetooth.devices.values].filter(d => !d.connected).sort(byName).slice(0, 5)];
|
||||
}
|
||||
}
|
||||
move: Transition {
|
||||
Anim {
|
||||
easing.type: Easing.OutCubic
|
||||
property: "y"
|
||||
}
|
||||
}
|
||||
remove: Transition {
|
||||
Anim {
|
||||
property: "opacity"
|
||||
to: 0
|
||||
}
|
||||
}
|
||||
section.delegate: Rectangle {
|
||||
required property string section
|
||||
|
||||
color: "transparent"
|
||||
height: childrenRect.height
|
||||
width: ListView.view.width
|
||||
|
||||
CustomText {
|
||||
text: parent.section
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component BluetoothItem: ConnectedRect {
|
||||
id: btItem
|
||||
|
||||
readonly property int connectedCount: root.btConnected.length
|
||||
readonly property bool connecting: Network.connectingNetwork === modelData
|
||||
property int horizontalPadding: Tokens.padding.largeIncreased
|
||||
readonly property bool inConnectedGroup: index < connectedCount
|
||||
required property int index
|
||||
required property ListView list
|
||||
readonly property bool loading: modelData.state === BluetoothDeviceState.Connecting || modelData.state === BluetoothDeviceState.Disconnecting // qmllint disable unresolved-type
|
||||
|
||||
required property BluetoothDevice modelData
|
||||
property int verticalPadding: Tokens.padding.smaller
|
||||
|
||||
first: !inConnectedGroup && index === connectedCount + 1
|
||||
implicitHeight: rowLayout.implicitHeight + verticalPadding * 2
|
||||
last: inConnectedGroup ? index === connectedCount - 1 : index === list.count - 1
|
||||
radius: Tokens.rounding.small
|
||||
|
||||
Timer {
|
||||
interval: 50
|
||||
running: btItem.ListView.delayRemove
|
||||
|
||||
onTriggered: btItem.ListView.delayRemove = false
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onConnectedChanged(): void {
|
||||
if (!btItem.modelData.connected)
|
||||
btItem.ListView.delayRemove = true;
|
||||
}
|
||||
|
||||
function onPairedChanged(): void {
|
||||
if (btItem.modelData.paired)
|
||||
btItem.modelData.connect();
|
||||
}
|
||||
|
||||
target: btItem.modelData
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: btItem.horizontalPadding
|
||||
anchors.rightMargin: btItem.horizontalPadding
|
||||
|
||||
Column {
|
||||
id: column
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Tokens.spacing.extraSmall
|
||||
Layout.rightMargin: Tokens.spacing.extraSmall
|
||||
elide: Text.ElideRight
|
||||
text: btItem.modelData.name
|
||||
}
|
||||
|
||||
CustomText {
|
||||
id: subtext
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: Colors.palette.m3outline
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Tokens.font.size.small
|
||||
text: btItem.modelData.connected ? (btItem.modelData.batteryAvailable ? qsTr("%1 battery left").arg(Math.round(btItem.modelData.battery * 100) + "%") : qsTr("Battery status unknown")) : btItem.modelData.address
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
implicitHeight: icon.height
|
||||
implicitWidth: icon.width
|
||||
|
||||
MaterialIcon {
|
||||
id: icon
|
||||
|
||||
font.pointSize: Tokens.font.size.large
|
||||
opacity: btItem.connecting ? 0 : 1
|
||||
text: btItem.modelData.batteryAvailable ? Icons.getBatteryIcon(btItem.modelData.battery) : "battery_unknown"
|
||||
visible: btItem.modelData.state === BluetoothDeviceState.Connected // qmllint disable unresolved-type
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: opacity > 0
|
||||
anchors.fill: parent
|
||||
opacity: btItem.connecting ? 1 : 0
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
sourceComponent: CircularIndicator {
|
||||
bgColor: "transparent"
|
||||
running: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ButtonRow {
|
||||
spacing: Tokens.spacing.small
|
||||
|
||||
IconTextButton {
|
||||
font.pointSize: Tokens.font.size.small
|
||||
icon: btItem.modelData.connected ? "link_off" : btItem.modelData.paired ? "link" : "add_link"
|
||||
text: btItem.modelData.connected ? qsTr("Disconnect") : btItem.modelData.paired ? qsTr("Connect") : qsTr("Pair")
|
||||
|
||||
onClicked: {
|
||||
if (btItem.modelData.connected)
|
||||
btItem.modelData.disconnect();
|
||||
else if (btItem.modelData.paired)
|
||||
btItem.modelData.connect();
|
||||
else if (!btItem.modelData.paired)
|
||||
btItem.modelData.pair();
|
||||
else if (btItem.modelData.pairing)
|
||||
btItem.modelData.cancelPair();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
component ConnectedRect: CustomRect {
|
||||
id: bg
|
||||
|
||||
property bool first
|
||||
property bool last
|
||||
|
||||
bottomLeftRadius: last ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
bottomRightRadius: last ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
topLeftRadius: first ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
topRightRadius: first ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
|
||||
Behavior on bottomLeftRadius {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on bottomRightRadius {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on topLeftRadius {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
Behavior on topRightRadius {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
}
|
||||
component StatusDivider: CustomText {
|
||||
bottomPadding: Tokens.spacing.extraSmall
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.smaller
|
||||
text: {
|
||||
const devices = Bluetooth.devices.values; // qmllint disable unresolved-type
|
||||
const connectedCount = devices.filter(d => d.connected).length;
|
||||
let available = qsTr("%1 device%2 available").arg(devices.length - connectedCount).arg(devices.length === 1 ? "" : "s");
|
||||
return available;
|
||||
}
|
||||
topPadding: Tokens.spacing.small
|
||||
}
|
||||
component Toggle: CustomSwitch {
|
||||
id: toggleItem
|
||||
|
||||
readonly property alias bg: bg
|
||||
property alias first: bg.first
|
||||
property alias last: bg.last
|
||||
property string subtext
|
||||
|
||||
Layout.fillWidth: true
|
||||
cLayer: 2
|
||||
horizontalPadding: Tokens.padding.largeIncreased
|
||||
implicitHeight: Math.max(implicitContentHeight, implicitIndicatorHeight) + verticalPadding * 2
|
||||
implicitWidth: implicitContentWidth + implicitIndicatorWidth + horizontalPadding * 2
|
||||
indicator.anchors.right: right
|
||||
indicator.anchors.rightMargin: toggleItem.horizontalPadding
|
||||
indicator.anchors.verticalCenter: verticalCenter
|
||||
verticalPadding: Tokens.padding.normal
|
||||
|
||||
background: ConnectedRect {
|
||||
id: bg
|
||||
|
||||
StateLayer {
|
||||
id: stateLayer
|
||||
|
||||
manualPressOverride: toggleItem.pressed
|
||||
}
|
||||
}
|
||||
contentItem: Item {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: toggleItem.horizontalPadding
|
||||
anchors.right: toggleItem.indicator.left
|
||||
anchors.rightMargin: Tokens.spacing.normal
|
||||
implicitHeight: column.implicitHeight
|
||||
implicitWidth: column.implicitWidth
|
||||
|
||||
Column {
|
||||
id: column
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 0
|
||||
|
||||
CustomText {
|
||||
id: label
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
elide: Text.ElideRight
|
||||
font: {
|
||||
const f = Qt.font(label.font);
|
||||
f.pointSize = Tokens.font.size.smaller;
|
||||
return f;
|
||||
}
|
||||
text: toggleItem.text
|
||||
}
|
||||
|
||||
CustomText {
|
||||
id: subtext
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: Colors.palette.m3outline
|
||||
elide: Text.ElideRight
|
||||
font: {
|
||||
const f = Qt.font(subtext.font);
|
||||
f.pointSize = Tokens.font.size.small;
|
||||
return f;
|
||||
}
|
||||
text: toggleItem.subtext
|
||||
visible: toggleItem.subtext
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onPressed: stateLayer.press(stateLayer.mouseX, stateLayer.mouseY)
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ Item {
|
||||
|
||||
Anim {
|
||||
duration: content.animLength
|
||||
easing: content.animCurve
|
||||
easing.bezierCurve: content.animCurve
|
||||
}
|
||||
}
|
||||
Behavior on y {
|
||||
@@ -66,7 +66,7 @@ Item {
|
||||
|
||||
Anim {
|
||||
duration: content.animLength
|
||||
easing: content.animCurve
|
||||
easing.bezierCurve: content.animCurve
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,6 @@ Item {
|
||||
anchors.top: root.position === "top" ? parent.top : undefined
|
||||
anchors.topMargin: (-implicitHeight - 5) * root.offsetScale
|
||||
anchors.verticalCenter: root.horizontal ? undefined : parent.verticalCenter
|
||||
horizontal: root.horizontal
|
||||
offsetScale: root.offsetScale
|
||||
screen: root.screen
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@ Item {
|
||||
|
||||
readonly property Item current: currentPopout?.item ?? null
|
||||
readonly property Popout currentPopout: content.children.find(c => c.shouldBeActive) ?? null
|
||||
required property bool horizontal
|
||||
required property PopoutState popouts
|
||||
|
||||
implicitHeight: (currentPopout?.implicitHeight ?? 0) + Tokens.padding.smaller * 2
|
||||
implicitWidth: (currentPopout?.implicitWidth ?? 0) + Tokens.padding.smaller * 2
|
||||
implicitHeight: (currentPopout?.implicitHeight ?? 0) + Tokens.padding.small * 2
|
||||
implicitWidth: (currentPopout?.implicitWidth ?? 0) + Tokens.padding.small * 2
|
||||
|
||||
Item {
|
||||
id: content
|
||||
@@ -70,7 +69,6 @@ Item {
|
||||
name: "upower"
|
||||
|
||||
sourceComponent: UPowerPopout {
|
||||
horizontal: root.horizontal
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +80,13 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Popout {
|
||||
name: "bluetooth"
|
||||
|
||||
sourceComponent: BluetoothPopout {
|
||||
}
|
||||
}
|
||||
|
||||
Popout {
|
||||
name: "updates"
|
||||
|
||||
@@ -101,7 +106,7 @@ Item {
|
||||
anchors.centerIn: opacity === 1 ? undefined : parent
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.top: opacity === 1 ? parent.top : undefined
|
||||
anchors.topMargin: Tokens.padding.smaller
|
||||
anchors.topMargin: 5
|
||||
opacity: 0
|
||||
scale: 0.8
|
||||
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
import QtQuick
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
import qs.Helpers
|
||||
import qs.Components
|
||||
|
||||
CustomRect {
|
||||
id: root
|
||||
|
||||
readonly property bool closing: PopupManager.closed
|
||||
readonly property url currentPopup: PopupManager.currentPopup
|
||||
property bool shouldBeVisible: loader.status === Loader.Ready
|
||||
|
||||
color: Qt.alpha(Colors.palette.m3shadow, 0.3)
|
||||
opacity: shouldBeVisible && !closing ? 1 : 0
|
||||
visible: opacity > 0
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible) {
|
||||
PopupManager.requestClose();
|
||||
PopupManager.currentPopup = "";
|
||||
}
|
||||
}
|
||||
|
||||
CustomMouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
preventStealing: true
|
||||
propagateComposedEvents: false
|
||||
|
||||
onClicked: {
|
||||
const insideItemWidth = mouseX < loader.x + loader.item.width && mouseX > loader.x;
|
||||
const insideItemHeight = mouseY < loader.y + loader.item.height && mouseY > loader.y;
|
||||
if (insideItemHeight && insideItemWidth)
|
||||
return;
|
||||
|
||||
PopupManager.requestClose();
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: loader
|
||||
|
||||
anchors.centerIn: parent
|
||||
|
||||
Connections {
|
||||
function onCurrentPopupChanged(): void {
|
||||
if (PopupManager.currentPopup) {
|
||||
loader.setSource(PopupManager.currentPopup, PopupManager.currentPopupProps);
|
||||
} else {
|
||||
loader.source = null;
|
||||
}
|
||||
}
|
||||
|
||||
target: PopupManager
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
function onNetworkConnected(): void {
|
||||
PopupManager.requestClose();
|
||||
}
|
||||
|
||||
target: Network
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import ZShell.Components
|
||||
import ZShell.Config
|
||||
import qs.Services
|
||||
import qs.Components
|
||||
import qs.Helpers
|
||||
|
||||
CustomClippingRect {
|
||||
id: root
|
||||
|
||||
required property var network
|
||||
|
||||
color: Colors.palette.m3surfaceContainer
|
||||
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
|
||||
implicitWidth: layout.implicitWidth + layout.anchors.margins * 2
|
||||
radius: Tokens.rounding.large
|
||||
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.extraLarge
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
MaterialIcon {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
font.pointSize: Tokens.font.size.extraLarge * 2
|
||||
text: "lock"
|
||||
}
|
||||
|
||||
CustomText {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
text: qsTr("Connect to %1").arg(root.network.name)
|
||||
}
|
||||
|
||||
CustomTextField {
|
||||
id: passwordField
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredWidth: 400
|
||||
echoMode: CustomTextField.Password
|
||||
errorText: qsTr("Failed to connect with given password")
|
||||
isError: Network.failedNetwork
|
||||
leadingIcon: "lock"
|
||||
passwordMaskDelay: 5000
|
||||
placeholderText: qsTr("Input password")
|
||||
}
|
||||
|
||||
ButtonRow {
|
||||
id: buttonRow
|
||||
|
||||
Layout.fillWidth: true
|
||||
spacing: Tokens.spacing.smaller
|
||||
|
||||
IconTextButton {
|
||||
fillWidth: true
|
||||
font.pointSize: Tokens.font.size.normal
|
||||
icon: "close"
|
||||
inactiveColor: Colors.layer(Colors.palette.m3surfaceContainerHighest, 2)
|
||||
inactiveOnColor: Colors.palette.m3onSurfaceVariant
|
||||
isRound: true
|
||||
isToggle: false
|
||||
shapeMorph: true
|
||||
text: "Cancel"
|
||||
|
||||
onClicked: PopupManager.requestClose()
|
||||
}
|
||||
|
||||
IconTextButton {
|
||||
fillWidth: true
|
||||
font.pointSize: Tokens.font.size.normal
|
||||
icon: Network.connectingNetwork ? "" : "check"
|
||||
inactiveColor: Network.connectingNetwork ? Colors.palette.m3primaryContainer : Network.failedNetwork ? Colors.palette.m3error : Colors.palette.m3primary
|
||||
inactiveOnColor: Network.connectingNetwork ? Colors.palette.m3onPrimaryContainer : Network.failedNetwork ? Colors.palette.m3onError : Colors.palette.m3onPrimary
|
||||
isRound: true
|
||||
isToggle: false
|
||||
shapeMorph: true
|
||||
text: Network.connectingNetwork ? "" : "Apply"
|
||||
|
||||
onClicked: Network.requestConnect(root.network, passwordField.text)
|
||||
|
||||
Loader {
|
||||
active: opacity > 0
|
||||
anchors.centerIn: parent
|
||||
opacity: Network.connectingNetwork ? 1 : 0
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
sourceComponent: CircularIndicator {
|
||||
bgColor: "transparent"
|
||||
implicitSize: buttonRow.height - Tokens.padding.normal
|
||||
running: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
pragma Singleton
|
||||
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
property bool closed: true
|
||||
property url currentPopup: ""
|
||||
property var currentPopupProps: ({})
|
||||
|
||||
function requestClose(): void {
|
||||
closed = true;
|
||||
}
|
||||
|
||||
function requestOpen(source: url, properties = {}): void {
|
||||
currentPopupProps = properties;
|
||||
currentPopup = source;
|
||||
closed = false;
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,362 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Networking
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs.Components
|
||||
import Quickshell
|
||||
import ZShell.Components
|
||||
import ZShell.Config
|
||||
import qs.Modules
|
||||
import qs.Helpers as Helpers
|
||||
import qs.Services
|
||||
import qs.Modules.Bar.Popouts.Network
|
||||
import qs.Components
|
||||
import qs.Helpers
|
||||
|
||||
Item {
|
||||
CustomClippingRect {
|
||||
id: root
|
||||
|
||||
required property var wrapper
|
||||
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
implicitHeight: networkPopContent.height + networkPopContent.anchors.margins * 2
|
||||
implicitWidth: 500 + 8 * 2
|
||||
radius: (20 - Tokens.padding.small) * Tokens.rounding.scale
|
||||
|
||||
Component.onCompleted: Network.active = true
|
||||
Component.onDestruction: Network.active = false
|
||||
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
id: networkPopContent
|
||||
|
||||
spacing: 8
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Tokens.padding.large
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
spacing: Tokens.spacing.extraSmall / 2
|
||||
|
||||
Repeater {
|
||||
model: Helpers.Network.devices
|
||||
CustomText {
|
||||
Layout.preferredHeight: visible ? implicitHeight : 0
|
||||
Layout.rightMargin: Tokens.padding.extraSmall
|
||||
font.pointSize: Tokens.font.size.large
|
||||
text: qsTr("Wifi")
|
||||
}
|
||||
|
||||
CustomRadioButton {
|
||||
id: network
|
||||
Toggle {
|
||||
Layout.preferredHeight: visible ? implicitHeight : 0
|
||||
checked: Network.wifiEnabled
|
||||
first: true
|
||||
last: Network.connectedNetworks.length === 0
|
||||
subtext: qsTr("Toggle WiFi device state")
|
||||
text: checked ? qsTr("Enabled") : qsTr("Disabled")
|
||||
|
||||
required property NetworkDevice modelData
|
||||
onToggled: Network.setWifi(checked)
|
||||
}
|
||||
|
||||
checked: Helpers.Network.activeDevice?.name === modelData.name
|
||||
text: modelData.description
|
||||
visible: modelData.name !== "lo"
|
||||
ListView {
|
||||
id: rows
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: contentHeight
|
||||
interactive: false
|
||||
section.property: "connected"
|
||||
spacing: Tokens.spacing.extraSmall / 2
|
||||
|
||||
add: Transition {
|
||||
Anim {
|
||||
from: 0
|
||||
property: "opacity"
|
||||
to: 1
|
||||
}
|
||||
}
|
||||
delegate: DelegateChooser {
|
||||
role: "isDivider"
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: true
|
||||
|
||||
delegate: StatusDivider {
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
delegate: NetworkItem {
|
||||
list: rows
|
||||
width: rows.width
|
||||
}
|
||||
}
|
||||
}
|
||||
displaced: Transition {
|
||||
Anim {
|
||||
easing.type: Easing.OutCubic
|
||||
property: "y"
|
||||
}
|
||||
}
|
||||
model: ScriptModel {
|
||||
values: {
|
||||
const byStrengthName = (a, b) => b.signalStrength - a.signalStrength || a.name.localeCompare(b.name);
|
||||
const cNetworks = [...Network.connectedNetworks];
|
||||
const kNetworks = [...Network.knownNetworks];
|
||||
const uNetworks = [...Network.unknownNetworks];
|
||||
|
||||
return [...cNetworks.sort(byStrengthName), ...(kNetworks.length > 0 ? [
|
||||
{
|
||||
isDivider: true,
|
||||
type: "known"
|
||||
},
|
||||
...kNetworks.sort(byStrengthName)] : []), ...(uNetworks.length > 0 ? [
|
||||
{
|
||||
isDivider: true,
|
||||
type: "unknown"
|
||||
},
|
||||
...uNetworks.sort(byStrengthName)] : [])];
|
||||
}
|
||||
}
|
||||
move: Transition {
|
||||
Anim {
|
||||
easing.type: Easing.OutCubic
|
||||
property: "y"
|
||||
}
|
||||
}
|
||||
remove: Transition {
|
||||
Anim {
|
||||
property: "opacity"
|
||||
to: 0
|
||||
}
|
||||
}
|
||||
section.delegate: Rectangle {
|
||||
required property string section
|
||||
|
||||
color: "transparent"
|
||||
height: childrenRect.height
|
||||
width: ListView.view.width
|
||||
|
||||
CustomText {
|
||||
text: parent.section
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NetworkOverlay {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
component ConnectedRect: CustomRect {
|
||||
id: bg
|
||||
|
||||
property bool first
|
||||
property bool last
|
||||
|
||||
bottomLeftRadius: last ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
bottomRightRadius: last ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
topLeftRadius: first ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
topRightRadius: first ? Tokens.rounding.large : Tokens.rounding.extraSmall
|
||||
}
|
||||
component NetworkItem: ConnectedRect {
|
||||
id: networkItem
|
||||
|
||||
readonly property int connectedCount: Network.connectedNetworks.length
|
||||
readonly property bool connecting: Network.connectingNetwork === modelData
|
||||
property int horizontalPadding: Tokens.padding.largeIncreased
|
||||
readonly property bool inConnectedGroup: index < connectedCount
|
||||
// sectioning first / last item in list reminder
|
||||
// if index === network.connectedNetworks.length - 1
|
||||
// if index === network.connectedNetworks.length - 1 + network.knownNetworks.length - 2
|
||||
// if index === network.connectedNetworks.length - 1 + network.knownNetworks.length
|
||||
// list.model.values.length - 1
|
||||
required property int index
|
||||
readonly property bool isSecure: Network.isSecure(modelData.security)
|
||||
required property ListView list
|
||||
required property var modelData
|
||||
property int verticalPadding: Tokens.padding.smaller
|
||||
|
||||
Layout.fillWidth: true
|
||||
first: !inConnectedGroup && index === connectedCount + 1
|
||||
implicitHeight: rowLayout.implicitHeight + verticalPadding * 2
|
||||
last: inConnectedGroup ? index === connectedCount - 1 : index === list.count - 1
|
||||
radius: Tokens.rounding.small
|
||||
|
||||
RowLayout {
|
||||
id: rowLayout
|
||||
|
||||
Layout.preferredHeight: visible ? rowLayout.implicitHeight + Tokens.padding.smaller * 2 : 0
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: networkItem.horizontalPadding
|
||||
anchors.rightMargin: networkItem.horizontalPadding
|
||||
|
||||
Column {
|
||||
id: column
|
||||
|
||||
Layout.fillWidth: true
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Tokens.spacing.extraSmall
|
||||
Layout.rightMargin: Tokens.spacing.extraSmall
|
||||
color: networkItem.modelData.active ? Colors.palette.m3primary : Colors.palette.m3onSurface
|
||||
elide: Text.ElideRight
|
||||
text: networkItem.modelData.name
|
||||
}
|
||||
|
||||
CustomText {
|
||||
id: subtext
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: Colors.palette.m3outline
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: Tokens.font.size.small
|
||||
text: networkItem.modelData.connected ? qsTr("Connected: %1 strength").arg(Math.round(networkItem.modelData.signalStrength * 100) + "%") : qsTr("%1 strength").arg(Math.round(networkItem.modelData.signalStrength * 100) + "%")
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
implicitHeight: icon.height
|
||||
implicitWidth: icon.width
|
||||
|
||||
MaterialIcon {
|
||||
id: icon
|
||||
|
||||
color: networkItem.modelData.active ? Colors.palette.m3primary : Colors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.large
|
||||
opacity: networkItem.connecting ? 0 : 1
|
||||
text: Icons.getNetworkIcon(networkItem.modelData.signalStrength * 100, networkItem.isSecure)
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: opacity > 0
|
||||
anchors.fill: parent
|
||||
opacity: networkItem.connecting ? 1 : 0
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
}
|
||||
}
|
||||
sourceComponent: CircularIndicator {
|
||||
bgColor: "transparent"
|
||||
running: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StateLayer {
|
||||
color: networkItem.modelData.active ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
||||
|
||||
onClicked: {
|
||||
if (networkItem.isSecure && !networkItem.known) {
|
||||
PopupManager.requestOpen(Qt.resolvedUrl("Network/PSKOverlay.qml"), {
|
||||
network: networkItem.modelData
|
||||
});
|
||||
} else {
|
||||
Network.requestConnect(networkItem.modelData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
component StatusDivider: CustomText {
|
||||
required property var modelData
|
||||
|
||||
bottomPadding: Tokens.spacing.extraSmall
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.smaller
|
||||
text: {
|
||||
if (modelData.type === "known") {
|
||||
const count = Network.knownNetworks.filter(n => !n.connected).length;
|
||||
|
||||
return qsTr("%1 known network%2").arg(count).arg(count === 1 ? "" : "s");
|
||||
}
|
||||
|
||||
if (modelData.type === "unknown") {
|
||||
const count = Network.unknownNetworks.filter(n => !n.connected).length;
|
||||
|
||||
return qsTr("%1 network%2 available").arg(count).arg(count === 1 ? "" : "s");
|
||||
}
|
||||
|
||||
return qsTr("object unknown");
|
||||
}
|
||||
topPadding: Tokens.spacing.small
|
||||
}
|
||||
component Toggle: CustomSwitch {
|
||||
id: toggleItem
|
||||
|
||||
readonly property alias bg: bg
|
||||
property alias first: bg.first
|
||||
property alias last: bg.last
|
||||
property string subtext
|
||||
|
||||
Layout.fillWidth: true
|
||||
cLayer: 2
|
||||
horizontalPadding: Tokens.padding.largeIncreased
|
||||
implicitHeight: Math.max(implicitContentHeight, implicitIndicatorHeight) + verticalPadding * 2
|
||||
implicitWidth: implicitContentWidth + implicitIndicatorWidth + horizontalPadding * 2
|
||||
indicator.anchors.right: right
|
||||
indicator.anchors.rightMargin: toggleItem.horizontalPadding
|
||||
indicator.anchors.verticalCenter: verticalCenter
|
||||
verticalPadding: Tokens.padding.normal
|
||||
|
||||
background: ConnectedRect {
|
||||
id: bg
|
||||
|
||||
StateLayer {
|
||||
id: stateLayer
|
||||
|
||||
manualPressOverride: toggleItem.pressed
|
||||
}
|
||||
}
|
||||
contentItem: Item {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: toggleItem.horizontalPadding
|
||||
anchors.right: toggleItem.indicator.left
|
||||
anchors.rightMargin: Tokens.spacing.normal
|
||||
implicitHeight: column.implicitHeight
|
||||
implicitWidth: column.implicitWidth
|
||||
|
||||
Column {
|
||||
id: column
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 0
|
||||
|
||||
CustomText {
|
||||
id: label
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
elide: Text.ElideRight
|
||||
font: {
|
||||
const f = Qt.font(label.font);
|
||||
f.pointSize = Tokens.font.size.smaller;
|
||||
return f;
|
||||
}
|
||||
text: toggleItem.text
|
||||
}
|
||||
|
||||
CustomText {
|
||||
id: subtext
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
color: Colors.palette.m3outline
|
||||
elide: Text.ElideRight
|
||||
font: {
|
||||
const f = Qt.font(subtext.font);
|
||||
f.pointSize = Tokens.font.size.small;
|
||||
return f;
|
||||
}
|
||||
text: toggleItem.subtext
|
||||
visible: toggleItem.subtext
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onPressed: stateLayer.press(stateLayer.mouseX, stateLayer.mouseY)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ StackView {
|
||||
id: root
|
||||
|
||||
readonly property int itemHeight: 30
|
||||
readonly property int panelRadius: ((itemHeight / 2) + Tokens.padding.extraSmall) * Tokens.rounding.scale
|
||||
readonly property int panelRadius: ((itemHeight / 2) + Tokens.padding.small) * Tokens.rounding.scale
|
||||
required property PopoutState popouts
|
||||
property int rootWidth: 0
|
||||
required property QsMenuHandle trayItem
|
||||
@@ -88,10 +88,10 @@ StackView {
|
||||
required property QsMenuEntry modelData
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: modelData?.isSeparator ?? false ? Tokens.padding.small : 0
|
||||
Layout.rightMargin: modelData?.isSeparator ?? false ? Tokens.padding.small : 0
|
||||
color: modelData?.isSeparator ?? false ? Colors.palette.m3outlineVariant : "transparent"
|
||||
implicitHeight: modelData?.isSeparator ?? false ? (visible ? 1 : 0) : childrenLoader.item?.implicitHeight ?? 0
|
||||
Layout.leftMargin: modelData.isSeparator ? Tokens.padding.normal : 0
|
||||
Layout.rightMargin: modelData.isSeparator ? Tokens.padding.normal : 0
|
||||
color: modelData.isSeparator ? Colors.palette.m3outlineVariant : "transparent"
|
||||
implicitHeight: modelData.isSeparator ? (visible ? 1 : 0) : childrenLoader.item.implicitHeight
|
||||
implicitWidth: childrenLoader.item?.implicitWidth ?? 0
|
||||
radius: Tokens.rounding.full
|
||||
visible: index !== (menuOpener.children.values.length - 1) ? true : (modelData.isSeparator ? false : true)
|
||||
@@ -99,18 +99,18 @@ StackView {
|
||||
Loader {
|
||||
id: childrenLoader
|
||||
|
||||
active: !item.modelData?.isSeparator ?? false
|
||||
active: !item.modelData.isSeparator
|
||||
anchors.fill: parent
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: Item {
|
||||
property int iconWidth: icon.active ? icon.width + Tokens.spacing.medium + icon.anchors.rightMargin : 0
|
||||
property int iconWidth: icon.active ? icon.width + Tokens.spacing.normal + icon.anchors.rightMargin : 0
|
||||
|
||||
implicitHeight: root.itemHeight
|
||||
implicitWidth: label.width + label.anchors.leftMargin * 2 + iconWidth + (expand.item?.width ?? 0)
|
||||
|
||||
StateLayer {
|
||||
enabled: item.modelData?.enabled ?? false
|
||||
enabled: item.modelData.enabled
|
||||
radius: item.radius
|
||||
|
||||
onClicked: {
|
||||
@@ -130,7 +130,7 @@ StackView {
|
||||
Loader {
|
||||
id: icon
|
||||
|
||||
active: item.modelData?.icon ?? "" !== ""
|
||||
active: item.modelData.icon !== ""
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
@@ -144,7 +144,7 @@ StackView {
|
||||
id: iconImage
|
||||
|
||||
implicitSize: parent.implicitHeight
|
||||
source: item.modelData?.icon ?? Qt.url("")
|
||||
source: item.modelData.icon
|
||||
visible: false
|
||||
}
|
||||
|
||||
@@ -163,20 +163,20 @@ StackView {
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 10
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: item.modelData?.enabled ?? false ? Colors.palette.m3onSurface : Colors.palette.m3outline
|
||||
text: item.modelData?.text ?? ""
|
||||
color: item.modelData.enabled ? Colors.palette.m3onSurface : Colors.palette.m3outline
|
||||
text: item.modelData.text
|
||||
}
|
||||
|
||||
Loader {
|
||||
id: expand
|
||||
|
||||
active: item.modelData?.hasChildren ?? false
|
||||
active: item.modelData.hasChildren
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
asynchronous: true
|
||||
|
||||
sourceComponent: MaterialIcon {
|
||||
color: item.modelData?.enabled ?? false ? Colors.palette.m3onSurface : Colors.palette.m3outline
|
||||
color: item.modelData.enabled ? Colors.palette.m3onSurface : Colors.palette.m3outline
|
||||
text: "chevron_right"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,10 +12,9 @@ import qs.Services
|
||||
Column {
|
||||
id: root
|
||||
|
||||
required property bool horizontal
|
||||
readonly property int panelRadius: ((profiles.height / 2) + Tokens.padding.extraSmall) * Tokens.rounding.scale
|
||||
readonly property int panelRadius: ((profiles.height / 2) + Tokens.padding.small) * Tokens.rounding.scale
|
||||
|
||||
spacing: Tokens.spacing.medium
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
Loader {
|
||||
active: Battery.isLaptop
|
||||
@@ -25,13 +24,6 @@ Column {
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: padding
|
||||
|
||||
implicitHeight: root.horizontal ? 0 : Tokens.padding.small
|
||||
implicitWidth: 1
|
||||
}
|
||||
|
||||
Repeater {
|
||||
model: Battery.allPeripherals
|
||||
|
||||
@@ -41,9 +33,9 @@ Column {
|
||||
required property var modelData
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.normal
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Tokens.padding.small
|
||||
anchors.rightMargin: Tokens.padding.normal
|
||||
|
||||
CustomText {
|
||||
Layout.fillWidth: true
|
||||
@@ -75,7 +67,7 @@ Column {
|
||||
}
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.normal
|
||||
text: Battery.isLaptop ? qsTr("Time %1: %2").arg(Battery.onBattery ? "remaining" : "until charged").arg(Battery.onBattery ? formatSeconds(Battery.timeToEmpty, "Calculating...") : formatSeconds(Battery.timeToFull, "Fully charged!")) : qsTr("Power profile: %1").arg(PowerProfile.toString(PowerProfiles.profile))
|
||||
}
|
||||
|
||||
@@ -88,8 +80,8 @@ Column {
|
||||
sourceComponent: CustomRect {
|
||||
color: Colors.palette.m3error
|
||||
implicitHeight: child.implicitHeight + Tokens.padding.large
|
||||
implicitWidth: child.implicitWidth + Tokens.padding.small * 2
|
||||
radius: Tokens.rounding.largeIncreased
|
||||
implicitWidth: child.implicitWidth + Tokens.padding.larger * 2
|
||||
radius: Tokens.rounding.large
|
||||
|
||||
Column {
|
||||
id: child
|
||||
@@ -146,7 +138,7 @@ Column {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: indicator.height + Tokens.padding.extraSmall * 2
|
||||
implicitWidth: saver.implicitHeight + balance.implicitHeight + perf.implicitHeight + Tokens.padding.small * 2 + Tokens.spacing.small * 8
|
||||
implicitWidth: saver.implicitHeight + balance.implicitHeight + perf.implicitHeight + Tokens.padding.larger * 2 + Tokens.spacing.small * 8
|
||||
radius: Tokens.rounding.full
|
||||
|
||||
CustomRect {
|
||||
@@ -227,8 +219,8 @@ Column {
|
||||
required property string icon
|
||||
required property int profile
|
||||
|
||||
implicitHeight: icon.implicitHeight + Tokens.padding.extraSmall
|
||||
implicitWidth: icon.implicitHeight + Tokens.padding.extraSmall
|
||||
implicitHeight: icon.implicitHeight + Tokens.padding.small
|
||||
implicitWidth: icon.implicitHeight + Tokens.padding.small
|
||||
|
||||
StateLayer {
|
||||
color: profiles.current === parent.icon ? Colors.palette.m3onPrimary : Colors.palette.m3onSurface
|
||||
|
||||
@@ -13,13 +13,13 @@ CustomClippingRect {
|
||||
id: root
|
||||
|
||||
readonly property bool hasUpdates: Object.keys(Updates.updates)?.length > 0
|
||||
readonly property int itemHeight: 50 + Tokens.padding.small * 2
|
||||
readonly property int itemHeight: 50 + Tokens.padding.smaller * 2
|
||||
required property var wrapper
|
||||
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: hasUpdates ? updatesListLoader.item?.implicitHeight + Tokens.padding.extraSmall * 2 : noUpdatesLoader.item.height
|
||||
implicitWidth: hasUpdates ? updatesListLoader.item?.contentWidth + Tokens.padding.extraSmall * 2 : noUpdatesLoader.item.width
|
||||
radius: Tokens.rounding.large - Tokens.padding.smaller
|
||||
implicitHeight: hasUpdates ? updatesListLoader.item?.implicitHeight + Tokens.padding.small * 2 : noUpdatesLoader.item.height
|
||||
implicitWidth: hasUpdates ? updatesListLoader.item?.contentWidth + Tokens.padding.small * 2 : noUpdatesLoader.item.width
|
||||
radius: Tokens.rounding.small
|
||||
|
||||
Loader {
|
||||
id: noUpdatesLoader
|
||||
@@ -70,7 +70,7 @@ CustomClippingRect {
|
||||
displayMarginEnd: root.itemHeight
|
||||
implicitHeight: Math.min(contentHeight, (root.itemHeight + spacing) * 5 - spacing)
|
||||
implicitWidth: contentWidth
|
||||
spacing: Tokens.spacing.medium
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
delegate: CustomRect {
|
||||
id: update
|
||||
@@ -81,12 +81,12 @@ CustomClippingRect {
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitHeight: root.itemHeight
|
||||
implicitWidth: 600
|
||||
radius: root.radius - Tokens.padding.extraSmall
|
||||
radius: Tokens.rounding.small - Tokens.padding.small
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.rightMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
anchors.rightMargin: Tokens.padding.smaller
|
||||
|
||||
MaterialIcon {
|
||||
font.pointSize: Tokens.font.size.large * 2
|
||||
|
||||
@@ -8,7 +8,7 @@ import ZShell.Config
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property var animCurve: Tokens.anim.expressiveDefaultSpatial
|
||||
property list<real> animCurve: Tokens.anim.curves.expressiveDefaultSpatial
|
||||
property int animLength: Tokens.anim.durations.expressiveDefaultSpatial
|
||||
readonly property alias content: content
|
||||
readonly property Item current: (content.item as Content)?.current ?? null
|
||||
@@ -16,7 +16,6 @@ Item {
|
||||
property alias currentName: popoutState.currentName
|
||||
property string detachedMode
|
||||
property alias hasCurrent: popoutState.hasCurrent
|
||||
required property bool horizontal
|
||||
readonly property real nonAnimHeight: content.implicitHeight || 150
|
||||
readonly property real nonAnimWidth: children.find(c => c.shouldBeActive)?.implicitWidth ?? content.implicitWidth
|
||||
required property real offsetScale
|
||||
@@ -36,7 +35,7 @@ Item {
|
||||
|
||||
Anim {
|
||||
duration: root.animLength
|
||||
easing: root.animCurve
|
||||
easing.bezierCurve: root.animCurve
|
||||
}
|
||||
}
|
||||
Behavior on implicitWidth {
|
||||
@@ -44,7 +43,7 @@ Item {
|
||||
|
||||
Anim {
|
||||
duration: root.animLength
|
||||
easing: root.animCurve
|
||||
easing.bezierCurve: root.animCurve
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +58,6 @@ Item {
|
||||
shouldBeActive: root.hasCurrent
|
||||
|
||||
sourceComponent: Content {
|
||||
horizontal: root.horizontal
|
||||
popouts: popoutState
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ Item {
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: entries.right
|
||||
anchors.leftMargin: Tokens.spacing.medium
|
||||
anchors.leftMargin: Tokens.spacing.normal
|
||||
anchors.top: parent.top
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
implicitWidth: ClipHistory.previewIsImage ? Math.max(Math.min(imagePreview.sourceSize.width + Tokens.padding.large * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth) : Math.max(Math.min(textPreviewColumn.width + textPreviewColumn.anchors.margins * 2, Config.clipboard.sizes.previewWidth), Config.clipboard.sizes.minPreviewWidth)
|
||||
@@ -75,7 +75,7 @@ Item {
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 0
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.margins: Tokens.padding.normal
|
||||
anchors.top: parent.top
|
||||
visible: !ClipHistory.previewIsImage
|
||||
|
||||
@@ -90,7 +90,7 @@ Item {
|
||||
required property int index
|
||||
required property var modelData
|
||||
|
||||
spacing: Tokens.spacing.medium
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomRect {
|
||||
color: lineRow.index % 2 ? Colors.tPalette.m3surfaceContainer : "transparent"
|
||||
@@ -192,7 +192,7 @@ Item {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.top: search.bottom
|
||||
anchors.topMargin: Tokens.spacing.medium
|
||||
anchors.topMargin: Tokens.spacing.normal
|
||||
implicitWidth: Config.clipboard.sizes.width
|
||||
|
||||
CustomListView {
|
||||
@@ -204,7 +204,7 @@ Item {
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
preferredHighlightBegin: 0
|
||||
preferredHighlightEnd: height
|
||||
spacing: Tokens.spacing.medium
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
CustomScrollBar.vertical: CustomScrollBar {
|
||||
flickable: view
|
||||
@@ -250,7 +250,7 @@ Item {
|
||||
id: icon
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.margins: Tokens.padding.normal
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
font.pointSize: Tokens.font.size.large
|
||||
text: clipItem.isImage ? "image" : "text_fields"
|
||||
@@ -260,7 +260,7 @@ Item {
|
||||
id: text
|
||||
|
||||
anchors.left: icon.right
|
||||
anchors.margins: Tokens.spacing.medium
|
||||
anchors.margins: Tokens.spacing.normal
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
elide: Text.ElideRight
|
||||
text: clipItem.isImage ? qsTr("Image") : ClipHistory.displayText(clipItem.modelData)
|
||||
@@ -292,7 +292,7 @@ Item {
|
||||
|
||||
IconButton {
|
||||
Layout.fillHeight: true
|
||||
Layout.margins: Tokens.padding.small
|
||||
Layout.margins: Tokens.padding.normal
|
||||
Layout.preferredWidth: height
|
||||
icon: "delete"
|
||||
inactiveColor: Qt.alpha(Colors.palette.m3error, 0.8)
|
||||
@@ -320,7 +320,7 @@ Item {
|
||||
Behavior on y {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.small
|
||||
easing: Tokens.anim.expressiveDefaultEffects
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,15 +15,15 @@ Item {
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
anchors.bottomMargin: (-implicitHeight - 5) * offsetScale
|
||||
implicitHeight: content.implicitHeight + Tokens.padding.small * 2
|
||||
implicitWidth: content.implicitWidth + Tokens.padding.small * 2 || 400
|
||||
implicitHeight: content.implicitHeight + Tokens.padding.normal * 2
|
||||
implicitWidth: content.implicitWidth + Tokens.padding.normal * 2 || 400
|
||||
opacity: 1 - offsetScale
|
||||
visible: offsetScale < 1
|
||||
|
||||
Behavior on offsetScale {
|
||||
Anim {
|
||||
duration: Tokens.anim.durations.expressiveDefaultSpatial
|
||||
easing: Tokens.anim.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Tokens.anim.curves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ Item {
|
||||
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.margins: Tokens.padding.smaller
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
color: "transparent"
|
||||
radius: Tokens.rounding.extraLarge - anchors.margins
|
||||
radius: Tokens.rounding.normal - anchors.margins
|
||||
|
||||
Item {
|
||||
id: view
|
||||
|
||||
@@ -13,11 +13,11 @@ GridLayout {
|
||||
|
||||
required property PersistentProperties dashState
|
||||
readonly property bool dashboardVisible: visibilities.dashboard
|
||||
property int radius: Tokens.rounding.medium
|
||||
property int radius: Tokens.rounding.smallest
|
||||
required property PersistentProperties visibilities
|
||||
|
||||
columnSpacing: Tokens.spacing.small
|
||||
rowSpacing: Tokens.spacing.small
|
||||
columnSpacing: Tokens.spacing.smaller
|
||||
rowSpacing: Tokens.spacing.smaller
|
||||
|
||||
ParallelAnimation {
|
||||
id: openAnim
|
||||
@@ -104,13 +104,12 @@ GridLayout {
|
||||
}
|
||||
}
|
||||
|
||||
CustomClippingRect {
|
||||
Rect {
|
||||
Layout.column: 0
|
||||
Layout.columnSpan: 5
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: media.implicitHeight
|
||||
Layout.row: 2
|
||||
color: Colors.tPalette.m3surfaceContainer
|
||||
radius: root.radius
|
||||
|
||||
Media {
|
||||
|
||||
@@ -132,7 +132,7 @@ CustomMouseArea {
|
||||
|
||||
IconButton {
|
||||
icon: "chevron_left"
|
||||
padding: Tokens.padding.extraSmall
|
||||
padding: Tokens.padding.small
|
||||
type: IconButton.Text
|
||||
|
||||
onClicked: root.dashState.currentDate = new Date(root.realCurrYear, root.realCurrMonth - 1, 1)
|
||||
@@ -150,7 +150,7 @@ CustomMouseArea {
|
||||
const now = new Date();
|
||||
return root.realCurrMonth !== now.getMonth() || root.realCurrYear !== now.getFullYear();
|
||||
}
|
||||
radius: pressed ? Tokens.rounding.small : Tokens.rounding.largeIncreased
|
||||
radius: pressed ? Tokens.rounding.small : Tokens.rounding.large
|
||||
|
||||
Behavior on radius {
|
||||
Anim {
|
||||
@@ -203,7 +203,7 @@ CustomMouseArea {
|
||||
|
||||
IconButton {
|
||||
icon: "chevron_right"
|
||||
padding: Tokens.padding.extraSmall
|
||||
padding: Tokens.padding.small
|
||||
type: IconButton.Text
|
||||
|
||||
onClicked: root.dashState.currentDate = new Date(root.realCurrYear, root.realCurrMonth + 1, 1)
|
||||
@@ -259,7 +259,7 @@ CustomMouseArea {
|
||||
|
||||
required property var model
|
||||
|
||||
implicitHeight: text.implicitHeight + Tokens.padding.small * 2
|
||||
implicitHeight: text.implicitHeight + Tokens.padding.normal * 2
|
||||
implicitWidth: implicitHeight
|
||||
|
||||
CustomText {
|
||||
|
||||
@@ -9,7 +9,6 @@ import QtQuick.Effects
|
||||
import ZShell.Components
|
||||
import ZShell.Services
|
||||
import ZShell.Config
|
||||
import qs.Modules.Dashboard.Dash.Media
|
||||
import qs.Daemons
|
||||
import qs.Components
|
||||
import qs.Helpers
|
||||
@@ -26,7 +25,7 @@ Item {
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
implicitHeight: layout.implicitHeight + layout.anchors.margins * 2
|
||||
implicitHeight: layout.implicitHeight
|
||||
function lengthStr(length: int): string {
|
||||
if (length < 0)
|
||||
return "-1:-1";
|
||||
@@ -58,18 +57,14 @@ Item {
|
||||
service: Audio.cava
|
||||
}
|
||||
|
||||
BackgroundShapes {
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
Shape {
|
||||
id: visualizer
|
||||
|
||||
readonly property int bars: Config.services.visualizerBars
|
||||
property color color: Qt.alpha(Colors.palette.m3primary, 0.5)
|
||||
property color fillColor: Qt.alpha(color, 0.1)
|
||||
property color color: Colors.palette.m3tertiary
|
||||
property color fillColor: Qt.alpha(color, 0.25)
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.fill: layout
|
||||
anchors.leftMargin: -(shape.strokeWidth / 2)
|
||||
layer.enabled: true
|
||||
asynchronous: true
|
||||
@@ -92,15 +87,15 @@ Item {
|
||||
if (n < 2)
|
||||
return "";
|
||||
|
||||
const h = root.height + shape.strokeWidth / 2;
|
||||
const w = root.width + shape.strokeWidth;
|
||||
const h = layout.height + shape.strokeWidth / 2;
|
||||
const w = layout.width + shape.strokeWidth;
|
||||
|
||||
function x(i) {
|
||||
return i * w / (n - 1);
|
||||
}
|
||||
|
||||
function y(i) {
|
||||
return h - (values[i] * Config.dashboard.sizes.mediaVisualizerSize) / 2;
|
||||
return h - values[i] * Config.dashboard.sizes.mediaVisualizerSize;
|
||||
}
|
||||
|
||||
let d = `M 0 ${h} `;
|
||||
@@ -147,21 +142,48 @@ Item {
|
||||
RowLayout {
|
||||
id: layout
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: Tokens.padding.large
|
||||
anchors.leftMargin: Tokens.padding.extraLarge
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
CoverVisualizer {
|
||||
Layout.fillHeight: true
|
||||
implicitWidth: Config.dashboard.sizes.mediaCoverArtSize
|
||||
CustomClippingRect {
|
||||
id: cover
|
||||
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
Layout.bottomMargin: Tokens.padding.large + Config.dashboard.sizes.mediaProgressThickness + Tokens.spacing.small
|
||||
Layout.leftMargin: Tokens.padding.large + Config.dashboard.sizes.mediaProgressThickness + Tokens.spacing.small
|
||||
Layout.preferredHeight: Config.dashboard.sizes.mediaCoverArtSize
|
||||
Layout.preferredWidth: Config.dashboard.sizes.mediaCoverArtSize
|
||||
Layout.topMargin: Tokens.padding.large + Config.dashboard.sizes.mediaProgressThickness + Tokens.spacing.small
|
||||
color: Colors.tPalette.m3surfaceContainerHigh
|
||||
radius: Infinity
|
||||
|
||||
MaterialIcon {
|
||||
anchors.centerIn: parent
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
font.pointSize: (parent.width * 0.4) || 1
|
||||
grade: 200
|
||||
text: "art_track"
|
||||
}
|
||||
|
||||
Image {
|
||||
id: image
|
||||
|
||||
anchors.fill: parent
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
source: Players.active?.trackArtUrl ?? ""
|
||||
sourceSize.height: Math.floor(height)
|
||||
sourceSize.width: Math.floor(width)
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Tokens.spacing.largeIncreased
|
||||
Layout.rightMargin: Tokens.spacing.largeIncreased
|
||||
Layout.leftMargin: Tokens.spacing.large
|
||||
Layout.rightMargin: Tokens.spacing.large
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
|
||||
spacing: Tokens.spacing.small
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
MarqueeText {
|
||||
id: title
|
||||
@@ -200,7 +222,7 @@ Item {
|
||||
|
||||
RowLayout {
|
||||
id: positionSliderLayout
|
||||
Layout.topMargin: Tokens.spacing.large
|
||||
Layout.topMargin: Tokens.spacing.extraLargeIncreased
|
||||
Layout.fillWidth: true
|
||||
spacing: Tokens.spacing.small
|
||||
|
||||
@@ -267,6 +289,7 @@ Item {
|
||||
checked: Players.active?.shuffle ?? false
|
||||
enabled: Players.active?.shuffleSupported
|
||||
onClicked: Players.active.shuffle = !Players.active?.shuffle
|
||||
implicitWidth: Math.round(implicitHeight * 0.9)
|
||||
}
|
||||
|
||||
IconButton {
|
||||
@@ -278,7 +301,6 @@ Item {
|
||||
shapeMorph: true
|
||||
enabled: Players.active?.canGoPrevious
|
||||
onClicked: Players.active?.previous()
|
||||
font.pointSize: Tokens.font.size.large
|
||||
}
|
||||
|
||||
IconButton {
|
||||
@@ -291,7 +313,6 @@ Item {
|
||||
checked: Players.active?.isPlaying ?? false
|
||||
enabled: Players.active?.canTogglePlaying
|
||||
onClicked: Players.active?.togglePlaying()
|
||||
font.pointSize: Tokens.font.size.large
|
||||
}
|
||||
|
||||
IconButton {
|
||||
@@ -303,7 +324,6 @@ Item {
|
||||
shapeMorph: true
|
||||
enabled: Players.active?.canGoNext
|
||||
onClicked: Players.active?.next()
|
||||
font.pointSize: Tokens.font.size.large
|
||||
}
|
||||
|
||||
IconButton {
|
||||
@@ -322,6 +342,7 @@ Item {
|
||||
else
|
||||
Players.active.loopState = MprisLoopState.None;
|
||||
}
|
||||
implicitWidth: Math.round(implicitHeight * 0.9)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import M3Shapes
|
||||
import qs.Components
|
||||
import qs.Services
|
||||
import qs.Helpers
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property int count: 14
|
||||
property list<real> darkOpacities: [0.10, 0.20, 0.10, 0.20]
|
||||
property list<real> lightOpacities: [0.34, 0.34, 0.08, 0.2]
|
||||
property real maxRotSpeed: 12
|
||||
property real maxSize: 124
|
||||
property real maxSpeed: 18
|
||||
property real minRotSpeed: -12
|
||||
property real minSize: 36
|
||||
property real minSpeed: 4
|
||||
readonly property list<int> shapePool: [MaterialShape.Circle, MaterialShape.Cookie4Sided, MaterialShape.Cookie6Sided, MaterialShape.Cookie7Sided, MaterialShape.Cookie9Sided, MaterialShape.Cookie12Sided, MaterialShape.Sunny, MaterialShape.VerySunny, MaterialShape.SoftBurst, MaterialShape.Pentagon, MaterialShape.Gem, MaterialShape.Arch, MaterialShape.Arrow, MaterialShape.Pill, MaterialShape.Triangle, MaterialShape.Fan, MaterialShape.Oval]
|
||||
|
||||
function rand(min: real, max: real): real {
|
||||
return min + Math.random() * (max - min);
|
||||
}
|
||||
|
||||
function signedRand(min: real, max: real): real {
|
||||
return rand(min, max) * (Math.random() < 0.5 ? -1 : 1);
|
||||
}
|
||||
|
||||
Component.onCompleted: shapes.model = count
|
||||
|
||||
Repeater {
|
||||
id: shapes
|
||||
|
||||
DriftingShape {
|
||||
}
|
||||
}
|
||||
|
||||
FrameAnimation {
|
||||
running: root.visible && root.width > 0 && root.height > 0 && (Players.active?.isPlaying ?? false)
|
||||
|
||||
onTriggered: {
|
||||
const dt = frameTime;
|
||||
for (let i = 0; i < shapes.count; i++) {
|
||||
const s = shapes.itemAt(i) as DriftingShape;
|
||||
if (!s)
|
||||
continue;
|
||||
|
||||
s.x += s.vx * dt;
|
||||
s.y += s.vy * dt;
|
||||
s.rotation += s.vr * dt;
|
||||
|
||||
if (s.x + s.width < 0)
|
||||
s.x = root.width;
|
||||
else if (s.x > root.width)
|
||||
s.x = -s.width;
|
||||
|
||||
if (s.y + s.height < 0)
|
||||
s.y = root.height;
|
||||
else if (s.y > root.height)
|
||||
s.y = -s.height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component DriftingShape: MaterialShape {
|
||||
id: shapeItem
|
||||
|
||||
readonly property int colorIdx: Math.floor(Math.random() * 4)
|
||||
required property int index
|
||||
property real vr: root.rand(root.minRotSpeed, root.maxRotSpeed)
|
||||
property real vx: root.signedRand(root.minSpeed, root.maxSpeed)
|
||||
property real vy: root.signedRand(root.minSpeed, root.maxSpeed)
|
||||
|
||||
color: [Colors.palette.m3primaryContainer, Colors.palette.m3secondaryContainer, Colors.palette.m3tertiaryContainer, Colors.palette.m3outlineVariant][colorIdx]
|
||||
implicitSize: root.minSize + (index / root.count) * (root.maxSize - root.minSize)
|
||||
opacity: Colors.light ? root.lightOpacities[colorIdx] : root.darkOpacities[colorIdx]
|
||||
rotation: root.rand(0, 360)
|
||||
shape: root.shapePool[Math.floor(Math.random() * root.shapePool.length)]
|
||||
|
||||
Behavior on color {
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
type: Anim.SlowEffects
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
x = root.rand(0, root.width - implicitSize);
|
||||
y = root.rand(0, root.height - implicitSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import M3Shapes
|
||||
import qs.Helpers
|
||||
import qs.Effects
|
||||
import qs.Components
|
||||
import qs.Services
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property color fallbackColor: Colors.layer(Colors.palette.m3surfaceContainerHighest, 2)
|
||||
property bool hadPrevious
|
||||
readonly property alias shape: shape
|
||||
|
||||
layer.enabled: true
|
||||
|
||||
Behavior on fallbackColor {
|
||||
CAnim {
|
||||
}
|
||||
}
|
||||
layer.effect: MultiEffect {
|
||||
blurMax: 1
|
||||
shadowColor: Colors.palette.m3outline
|
||||
shadowEnabled: true
|
||||
shadowOpacity: 0.3
|
||||
}
|
||||
|
||||
Item {
|
||||
id: shapeWrapper
|
||||
|
||||
anchors.fill: parent
|
||||
layer.enabled: true
|
||||
opacity: root.fallbackColor.a
|
||||
|
||||
MaterialShape {
|
||||
id: shape
|
||||
|
||||
color: Qt.alpha(root.fallbackColor, 1)
|
||||
implicitSize: root.width
|
||||
shape: MaterialShape.Cookie12Sided
|
||||
|
||||
Anim on rotation {
|
||||
duration: 23500
|
||||
easing.type: Easing.Linear
|
||||
from: 360
|
||||
loops: Animation.Infinite
|
||||
paused: !Players.active?.isPlaying
|
||||
running: true
|
||||
to: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MaterialIcon {
|
||||
anchors.centerIn: parent
|
||||
animate: true
|
||||
color: Colors.palette.m3onSurfaceVariant
|
||||
grade: 200
|
||||
opacity: image.status === Image.Null || image.status === Image.Error ? 1 : 0
|
||||
text: image.status === Image.Error ? "broken_image" : "art_track"
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
active: opacity > 0
|
||||
anchors.centerIn: parent
|
||||
asynchronous: true
|
||||
opacity: image.status === Image.Loading ? 1 : 0
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
type: Anim.DefaultEffects
|
||||
}
|
||||
}
|
||||
sourceComponent: LoadingIndicator {
|
||||
color: Colors.palette.m3primaryContainer
|
||||
implicitSize: root.width * 0.3
|
||||
}
|
||||
}
|
||||
|
||||
FadeImage {
|
||||
id: image
|
||||
|
||||
anchors.fill: parent
|
||||
layer.enabled: true
|
||||
source: Players.getArtUrl(Players.active)
|
||||
|
||||
layer.effect: Mask {
|
||||
maskSource: shapeWrapper
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import M3Shapes
|
||||
import ZShell.Config
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
CoverArt {
|
||||
id: cover
|
||||
|
||||
anchors.centerIn: parent
|
||||
implicitHeight: Config.dashboard.sizes.mediaCoverArtSize
|
||||
implicitWidth: Config.dashboard.sizes.mediaCoverArtSize
|
||||
shape.shape: MaterialShape.Cookie9Sided
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ Item {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.margins: Tokens.padding.large
|
||||
anchors.top: parent.top
|
||||
spacing: Tokens.spacing.medium
|
||||
spacing: Tokens.spacing.normal
|
||||
|
||||
Resource {
|
||||
fgColor: Colors.palette.m3primary
|
||||
|
||||
@@ -18,7 +18,7 @@ Row {
|
||||
color: Colors.layer(Colors.palette.m3surfaceContainerHigh, 2)
|
||||
implicitHeight: info.implicitHeight
|
||||
implicitWidth: info.implicitHeight
|
||||
radius: Tokens.rounding.small
|
||||
radius: Tokens.rounding.smallest
|
||||
|
||||
MaterialIcon {
|
||||
anchors.centerIn: parent
|
||||
|
||||
@@ -27,7 +27,7 @@ Item {
|
||||
id: info
|
||||
|
||||
anchors.left: icon.right
|
||||
anchors.leftMargin: Tokens.spacing.largeIncreased
|
||||
anchors.leftMargin: Tokens.spacing.large
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
spacing: 8
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ Item {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
color: "transparent"
|
||||
implicitHeight: parent.height + 8 * 2
|
||||
radius: Tokens.rounding.small
|
||||
radius: Tokens.rounding.smallest
|
||||
|
||||
CustomRect {
|
||||
id: stateLayer
|
||||
|
||||
@@ -32,7 +32,7 @@ Item {
|
||||
y: root.menuY
|
||||
|
||||
color: Colors.tPalette.m3surface
|
||||
radius: Tokens.rounding.medium
|
||||
radius: Tokens.rounding.normal
|
||||
|
||||
implicitWidth: menuLayout.implicitWidth + padding * 2
|
||||
implicitHeight: menuLayout.implicitHeight + padding * 2
|
||||
@@ -48,13 +48,13 @@ Item {
|
||||
CustomRect {
|
||||
Layout.preferredWidth: 200
|
||||
radius: popupBackground.radius - popupBackground.padding
|
||||
implicitHeight: openTerminalRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: openTerminalRow.implicitHeight + Tokens.padding.small * 2
|
||||
|
||||
RowLayout {
|
||||
id: openTerminalRow
|
||||
spacing: 8
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
|
||||
MaterialIcon { text: "terminal"; font.pointSize: 20 }
|
||||
CustomText { text: "Open terminal"; Layout.fillWidth: true }
|
||||
@@ -81,13 +81,13 @@ Item {
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
radius: popupBackground.radius - popupBackground.padding
|
||||
implicitHeight: settingsRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: settingsRow.implicitHeight + Tokens.padding.small * 2
|
||||
|
||||
RowLayout {
|
||||
id: settingsRow
|
||||
spacing: 8
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
|
||||
MaterialIcon { text: "settings"; font.pointSize: 20 }
|
||||
CustomText { text: "ZShell settings"; Layout.fillWidth: true }
|
||||
@@ -115,13 +115,13 @@ Item {
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
radius: popupBackground.radius - popupBackground.padding
|
||||
implicitHeight: logoutRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: logoutRow.implicitHeight + Tokens.padding.small * 2
|
||||
|
||||
RowLayout {
|
||||
id: logoutRow
|
||||
spacing: 8
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
|
||||
MaterialIcon { text: "logout"; font.pointSize: 20 }
|
||||
CustomText { text: "Logout"; Layout.fillWidth: true }
|
||||
@@ -148,13 +148,13 @@ Item {
|
||||
// CustomRect {
|
||||
// Layout.fillWidth: true
|
||||
// radius: popupBackground.radius - popupBackground.padding
|
||||
// implicitHeight: desktopIconsRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
// implicitHeight: desktopIconsRow.implicitHeight + Tokens.padding.small * 2
|
||||
//
|
||||
// RowLayout {
|
||||
// id: desktopIconsRow
|
||||
// spacing: 8
|
||||
// anchors.fill: parent
|
||||
// anchors.leftMargin: Tokens.padding.small
|
||||
// anchors.leftMargin: Tokens.padding.smaller
|
||||
//
|
||||
// MaterialIcon { text: Config.options.background.showDesktopIcons ? "visibility_off" : "visibility"; font.pointSize: 20 }
|
||||
// CustomText { text: Config.options.background.showDesktopIcons ? "Hide icons" : "Show icons"; Layout.fillWidth: true }
|
||||
|
||||
@@ -43,13 +43,13 @@ Item {
|
||||
CustomClippingRect {
|
||||
id: popupBackground
|
||||
|
||||
readonly property real padding: Tokens.padding.extraSmall
|
||||
readonly property real padding: Tokens.padding.small
|
||||
|
||||
color: Colors.tPalette.m3surface
|
||||
implicitHeight: menuLayout.implicitHeight + padding * 2
|
||||
implicitWidth: menuLayout.implicitWidth + padding * 2
|
||||
opacity: contextMenu.visible ? 1 : 0
|
||||
radius: Tokens.rounding.medium
|
||||
radius: Tokens.rounding.normal
|
||||
x: contextMenu.menuX
|
||||
y: contextMenu.menuY
|
||||
|
||||
@@ -66,14 +66,14 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
Layout.preferredWidth: 160
|
||||
implicitHeight: openRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: openRow.implicitHeight + Tokens.padding.small * 2
|
||||
radius: popupBackground.radius - popupBackground.padding
|
||||
|
||||
RowLayout {
|
||||
id: openRow
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
@@ -109,14 +109,14 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: openWithRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: openWithRow.implicitHeight + Tokens.padding.small * 2
|
||||
radius: popupBackground.radius - popupBackground.padding
|
||||
|
||||
RowLayout {
|
||||
id: openWithRow
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
@@ -154,14 +154,14 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: copyPathRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: copyPathRow.implicitHeight + Tokens.padding.small * 2
|
||||
radius: popupBackground.radius - popupBackground.padding
|
||||
|
||||
RowLayout {
|
||||
id: copyPathRow
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
@@ -187,7 +187,7 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: renameRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: renameRow.implicitHeight + Tokens.padding.small * 2
|
||||
radius: popupBackground.radius - popupBackground.padding
|
||||
visible: contextMenu.targetPaths.length === 1
|
||||
|
||||
@@ -195,7 +195,7 @@ Item {
|
||||
id: renameRow
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
@@ -229,14 +229,14 @@ Item {
|
||||
|
||||
CustomRect {
|
||||
Layout.fillWidth: true
|
||||
implicitHeight: deleteRow.implicitHeight + Tokens.padding.extraSmall * 2
|
||||
implicitHeight: deleteRow.implicitHeight + Tokens.padding.small * 2
|
||||
radius: popupBackground.radius - popupBackground.padding
|
||||
|
||||
RowLayout {
|
||||
id: deleteRow
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: Tokens.padding.small
|
||||
anchors.leftMargin: Tokens.padding.smaller
|
||||
spacing: 8
|
||||
|
||||
MaterialIcon {
|
||||
|
||||
@@ -205,7 +205,7 @@ Item {
|
||||
anchors.margins: 4
|
||||
color: "white"
|
||||
opacity: root.iconsRoot.selectedIcons.includes(root.filePath) ? 0.2 : 0.0
|
||||
radius: Tokens.rounding.small
|
||||
radius: Tokens.rounding.smallest
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
@@ -265,7 +265,7 @@ Item {
|
||||
anchors.margins: 4
|
||||
color: "white"
|
||||
opacity: parent.containsMouse ? 0.1 : 0.0
|
||||
radius: Tokens.rounding.small
|
||||
radius: Tokens.rounding.smallest
|
||||
|
||||
Behavior on opacity {
|
||||
Anim {
|
||||
|
||||
@@ -22,10 +22,10 @@ Item {
|
||||
property string draggedAppId: ""
|
||||
property var draggedModelData: null
|
||||
property bool dropAnimating: false
|
||||
readonly property int padding: Tokens.padding.extraSmall
|
||||
readonly property int padding: Tokens.padding.small
|
||||
required property var panels
|
||||
property var pendingCommitIds: []
|
||||
readonly property int rounding: Tokens.rounding.largeIncreased
|
||||
readonly property int rounding: Tokens.rounding.large
|
||||
required property ShellScreen screen
|
||||
required property PersistentProperties visibilities
|
||||
property var visualIds: []
|
||||
@@ -247,7 +247,7 @@ Item {
|
||||
property bool enableAddAnimation: false
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Tokens.padding.extraSmall
|
||||
anchors.margins: Tokens.padding.small
|
||||
anchors.top: parent.top
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
height: Config.dock.height
|
||||
@@ -255,7 +255,7 @@ Item {
|
||||
interactive: !(root.dragActive || root.dropAnimating)
|
||||
model: visualModel
|
||||
orientation: ListView.Horizontal
|
||||
spacing: Tokens.padding.small
|
||||
spacing: Tokens.padding.smaller
|
||||
|
||||
add: Transition {
|
||||
ParallelAnimation {
|
||||
|
||||
@@ -23,7 +23,7 @@ CustomRect {
|
||||
|
||||
implicitHeight: Config.dock.height
|
||||
implicitWidth: isSeparator ? 1 : implicitHeight
|
||||
radius: Tokens.rounding.medium - Tokens.padding.extraSmall
|
||||
radius: Tokens.rounding.normal - Tokens.padding.small
|
||||
|
||||
Loader {
|
||||
active: !isSeparator
|
||||
|
||||
@@ -5,9 +5,9 @@ import ZShell.Config
|
||||
import qs.Services
|
||||
|
||||
CustomRect {
|
||||
Layout.bottomMargin: dockRow.padding + Tokens.rounding.medium
|
||||
Layout.bottomMargin: dockRow.padding + Tokens.rounding.normal
|
||||
Layout.fillHeight: true
|
||||
Layout.topMargin: dockRow.padding + Tokens.rounding.medium
|
||||
Layout.topMargin: dockRow.padding + Tokens.rounding.normal
|
||||
color: Colors.palette.m3outlineVariant
|
||||
implicitWidth: 1
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user