homescreens/halcyon: Make back button clickable

This commit is contained in:
Devin Lin 2022-07-11 22:59:18 -04:00
parent cb71a7779f
commit c3fd538dd5

View file

@ -52,23 +52,42 @@ MobileShell.GridView {
} }
} }
contentItem: RowLayout { contentItem: RowLayout {
spacing: PlasmaCore.Units.gridUnit spacing: PlasmaCore.Units.smallSpacing * 2
Kirigami.Icon {
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: PlasmaCore.Units.iconSizes.small
Layout.preferredWidth: PlasmaCore.Units.iconSizes.small
isMask: true
color: 'white'
source: 'arrow-left'
layer.enabled: true // close button
layer.effect: DropShadow { MouseArea {
verticalOffset: 1 id: button
radius: 4 Layout.alignment: Qt.AlignVCenter
samples: 6 implicitHeight: PlasmaCore.Units.iconSizes.small + PlasmaCore.Units.largeSpacing
color: Qt.rgba(0, 0, 0, 0.5) implicitWidth: PlasmaCore.Units.iconSizes.small + PlasmaCore.Units.largeSpacing
cursorShape: Qt.PointingHandCursor
onClicked: root.closeRequested()
Rectangle {
anchors.fill: parent
color: Qt.rgba(255, 255, 255, button.pressed ? 0.2 : 0)
radius: button.width / 2
}
Kirigami.Icon {
anchors.centerIn: parent
implicitHeight: PlasmaCore.Units.iconSizes.small
implicitWidth: PlasmaCore.Units.iconSizes.small
isMask: true
color: 'white'
source: 'arrow-left'
layer.enabled: true
layer.effect: DropShadow {
verticalOffset: 1
radius: 4
samples: 6
color: Qt.rgba(0, 0, 0, 0.5)
}
} }
} }
QQC2.Label { QQC2.Label {
Layout.fillWidth: true Layout.fillWidth: true
text: root.folderName text: root.folderName