Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
168 lines (158 sloc) 5.39 KB
diff --git a/PowerKeyMenu.qml b/PowerKeyMenu.qml
index 40929e3..5fa7a4f 100644
--- a/usr/share/lipstick-jolla-home-qt5/powerkey/PowerKeyMenu.qml
+++ b/usr/share/lipstick-jolla-home-qt5/powerkey/PowerKeyMenu.qml
@@ -9,6 +9,7 @@ import com.jolla.lipstick 0.1
import org.freedesktop.contextkit 1.0
import org.nemomobile.notifications 1.0 as SystemNotifications
import org.nemomobile.configuration 1.0
+import org.coderus.powermenu 1.0
SilicaListView {
id: powerMenu
@@ -86,104 +87,73 @@ SilicaListView {
category: "x-jolla.ambience.preview"
}
+ Connections {
+ target: Lipstick.compositor.powerKeyLayer.edgeFilter
+ onGestureCanceled: {
+ if (Lipstick.compositor.powerKeyLayer.edgeFilter.progress > 0 && !Lipstick.compositor.powerKeyPressed && !Lipstick.compositor.appLayer.window) {
+ Lipstick.compositor.setDisplayOff()
+ }
+ }
+ }
+
header: Item {
id: headerItem
width: powerMenu.width
- height: powerMenu.itemHeight
+ height: column.height
z: powerMenu.count+1
+ property int __silica_page
- clip: powerTransition.running
-
- states: [
- State {
- name: "no-power"
- when: Lipstick.compositor.powerKeyLayer.active && !shutdownButton.visible
- }, State {
- name: "power"
- when: shutdownButton.visible
- PropertyChanges {
- target: lockButton
- offset: -lockButton.height
- }
- }
- ]
- transitions: Transition {
- id: powerTransition
- from: "no-power"
- to: "power"
- NumberAnimation {
- target: lockButton
- property: "offset"
- duration: 400
- easing.type: Easing.InOutQuad
- }
- }
+ onHeightChanged: powerMenu.contentY = 0 - headerItem.height
Wallpaper {
- anchors.fill: shutdownOptions
+ anchors.fill: column
horizontalOffset: powerMenu.x
}
- Row {
- id: shutdownOptions
-
- width: powerMenu.width
- height: powerMenu.itemHeight
- clip: powerTransition.running
- visible: Lipstick.compositor.powerKeyPressed
- opacity: Math.max(0.0, Math.min(1.0,
- (powerMenu.exposure - headerItem.y + powerMenu.contentY)
- / headerItem.height))
-
- PowerButton {
- id: shutdownButton
-
- width: parent.width / (rebootButton.visible ? 2 : 1)
- height: parent.height
-
- offset: lockButton.offset + height
- onClicked: powerMenu.shutdown()
-
- iconSource: "image://theme/graphic-power-off"
+ Column {
+ id: column
+ width: parent.width
+
+ ControlRow {
+ id: controlRow1
+ itemWidth: headerItem.width / 3
+ powermenu: Lipstick.compositor.powerKeyPressed
+ closeVisible: !powermenu && !Desktop.settings.close_from_top && Lipstick.compositor.appLayer.window
+ anchors.horizontalCenter: parent.horizontalCenter
+ onCloseClicked: {
+ Lipstick.compositor.appLayer._closeDismissedWindow = true
+ Lipstick.compositor.appLayer.closed()
+ Lipstick.compositor.powerKeyLayer.hide()
+ }
+
+ Connections {
+ target: powerMenu
+ onExposedChanged: {
+ controlRow1.editMode = false
+ }
+ }
}
- PowerButton {
- id: rebootButton
-
- visible: rebootActionConfig.value
- width: parent.width/2
- height: parent.height
-
- offset: lockButton.offset + height
- onClicked: powerMenu.reboot()
-
- iconSource: "image://theme/graphic-reboot"
-
- ConfigurationValue {
- id: rebootActionConfig
+ TogglesArea {
+ id: togglesArea
+ height: togglesArea.contentHeight + togglesArea.expandedHeight
+ width: headerItem.width - sideMargin
+ editMode: controlRow1.editMode
+ onHideWithCare: Lipstick.compositor.powerKeyLayer.hide()
+
+ Connections {
+ target: powerMenu
+ onExposedChanged: {
+ togglesArea.collapse()
+ }
+ }
- key: "/desktop/jolla/reboot_action_enabled"
- defaultValue: false
+ Behavior on height {
+ NumberAnimation { duration: 200 }
}
}
}
-
- PowerButton {
- id: lockButton
-
- width: powerMenu.width
- height: powerMenu.itemHeight
-
- clip: powerTransition.running
- visible: !shutdownButton.visible || powerTransition.running
-
- onClicked: Lipstick.compositor.setDisplayOff()
-
- iconSource: "image://theme/graphic-display-blank"
-
- opacity: shutdownButton.opacity
- }
}
delegate: Item {
You can’t perform that action at this time.