action center: toggle pages

This commit is contained in:
end-4
2025-11-18 23:08:51 +01:00
parent b650120fd4
commit 4cbb0f23c6
27 changed files with 283 additions and 105 deletions
@@ -148,5 +148,13 @@ Singleton {
easing.bezierCurve: transition.easing.bezierCurve.easeIn
}
}
property Component longMovement: Component {
NumberAnimation {
duration: 1000
easing.type: Easing.BezierSpline
easing.bezierCurve: transition.easing.bezierCurve.easeIn
}
}
}
}
@@ -1,5 +1,6 @@
import QtQuick
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import Quickshell
import qs
import qs.services
@@ -9,10 +10,10 @@ import qs.modules.waffle.looks
Item {
id: root
signal closed()
signal closed
property alias border: borderRect
required default property Item contentItem
default required property Item contentItem
property real visualMargin: 12
function close() {
@@ -26,6 +27,7 @@ Item {
Rectangle {
id: borderRect
z: 1
color: "transparent"
radius: Looks.radius.large
@@ -33,7 +35,6 @@ Item {
border.width: 1
implicitWidth: contentItem.implicitWidth + border.width * 2
implicitHeight: contentItem.implicitHeight + border.width * 2
children: [root.contentItem]
anchors {
left: parent.left
@@ -76,4 +77,20 @@ Item {
}
}
}
Item {
id: contentArea
z: 0
anchors.fill: borderRect
anchors.margins: borderRect.border.width
layer.enabled: true
layer.effect: OpacityMask {
maskSource: Rectangle {
width: contentArea.width
height: contentArea.height
radius: borderRect.radius - borderRect.border.width
}
}
children: [root.contentItem]
}
}
@@ -16,6 +16,24 @@ Button {
property color colBackgroundToggledHover: Looks.colors.accentHover
property color colBackgroundToggledActive: Looks.colors.accentActive
property alias backgroundOpacity: backgroundRect.opacity
property color color: {
if (root.checked) {
if (root.down) {
return root.colBackgroundToggledActive;
} else if (root.hovered && !root.down) {
return root.colBackgroundToggledHover;
} else {
return root.colBackgroundToggled;
}
}
if (root.down) {
return root.colBackgroundActive;
} else if (root.hovered && !root.down) {
return root.colBackgroundHover;
} else {
return root.colBackground;
}
}
property alias monochromeIcon: buttonIcon.monochrome
property bool forceShowIcon: false
@@ -42,24 +60,7 @@ Button {
background: Rectangle {
id: backgroundRect
radius: Looks.radius.medium
color: {
if (root.checked) {
if (root.down) {
return root.colBackgroundToggledActive;
} else if (root.hovered && !root.down) {
return root.colBackgroundToggledHover;
} else {
return root.colBackgroundToggled;
}
}
if (root.down) {
return root.colBackgroundActive;
} else if (root.hovered && !root.down) {
return root.colBackgroundHover;
} else {
return root.colBackground;
}
}
color: root.color
Behavior on color {
animation: Looks.transition.color.createObject(this)
}
@@ -55,7 +55,7 @@ Singleton {
property string powerProfileIcon: {
switch(PowerProfiles.profile) {
case PowerProfile.PowerSaver: return "leaf-two";
case PowerProfile.Balanced: return "settings-cog-multiple";
case PowerProfile.Balanced: return "flash-on";
case PowerProfile.Performance: return "fire";
}
}
@@ -46,8 +46,8 @@ Slider {
right: parent.right
verticalCenter: parent.verticalCenter
}
topLeftRadius: root.trackWidth / 2
bottomLeftRadius: root.trackWidth / 2
topRightRadius: root.trackWidth / 2
bottomRightRadius: root.trackWidth / 2
color: Looks.colors.controlBg
implicitHeight: root.trackWidth
width: background.width * (1 - root.visualPosition)