Commit 6830370b authored by Devin Lin's avatar Devin Lin 🎨
Browse files

quicksettings: Scale animation on delegate tap

parent 37b0e709
Pipeline #160573 passed with stages
in 1 minute and 2 seconds
......@@ -40,6 +40,22 @@ Components.BaseItem {
readonly property color disabledButtonColor: PlasmaCore.Theme.backgroundColor
readonly property color disabledButtonPressedColor: Qt.darker(disabledButtonColor, 1.1)
// scale animation on press
property real zoomScale: 1
Behavior on zoomScale {
NumberAnimation {
duration: 200
easing.type: Easing.OutExpo
}
}
transform: Scale {
origin.x: root.width / 2;
origin.y: root.height / 2;
xScale: root.zoomScale
yScale: root.zoomScale
}
function delegateClick() {
if (root.toggle) {
root.toggle();
......
......@@ -22,8 +22,13 @@ QuickSettingsDelegate {
padding: PlasmaCore.Units.smallSpacing * 2
iconItem: icon
// scale animation on press
zoomScale: mouseArea.pressed ? 0.9 : 1
background: Rectangle {
anchors.fill: parent
radius: PlasmaCore.Units.smallSpacing
border.width: 1
border.color: root.enabled ? root.enabledButtonBorderColor : root.disabledButtonBorderColor
color: {
if (root.enabled) {
......@@ -38,6 +43,7 @@ QuickSettingsDelegate {
id: mouseArea
onClicked: root.delegateClick()
onPressAndHold: root.delegatePressAndHold()
cursorShape: Qt.PointingHandCursor
PlasmaCore.IconItem {
id: icon
......
......@@ -20,6 +20,9 @@ QuickSettingsDelegate {
iconItem: icon
// scale animation on press
zoomScale: mouseArea.pressed ? 0.9 : 1
background: Rectangle {
radius: PlasmaCore.Units.smallSpacing
border.color: root.enabled ? root.enabledButtonBorderColor : root.disabledButtonBorderColor
......
......@@ -75,6 +75,7 @@ Item {
DragHandler {
id: dragHandler
target: parent
cursorShape: Qt.PointingHandCursor
yAxis.enabled: true
xAxis.enabled: false
......@@ -233,7 +234,6 @@ Item {
TapHandler {
id: tapHandler
cursorShape: Qt.PointingHandCursor
onTapped: delegate.activateApp()
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment