mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Merge pull request #738 from bokicoder/patch-1
SessionMenu: add hibernate option
This commit is contained in:
@@ -1188,6 +1188,54 @@ Loader {
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Settings.data.general.compactLockScreen ? 36 : 48
|
||||
radius: Settings.data.general.compactLockScreen ? 18 : 24
|
||||
color: hibernateButtonArea.containsMouse ? Color.mHover : "transparent"
|
||||
border.color: Color.mOutline
|
||||
border.width: 1
|
||||
|
||||
RowLayout {
|
||||
anchors.centerIn: parent
|
||||
spacing: 6
|
||||
|
||||
NIcon {
|
||||
icon: "hibernate"
|
||||
pointSize: Settings.data.general.compactLockScreen ? Style.fontSizeM : Style.fontSizeL
|
||||
color: hibernateButtonArea.containsMouse ? Color.mOnHover : Color.mOnSurfaceVariant
|
||||
}
|
||||
|
||||
NText {
|
||||
text: I18n.tr("session-menu.hibernate")
|
||||
pointSize: Settings.data.general.compactLockScreen ? Style.fontSizeS : Style.fontSizeM
|
||||
color: hibernateButtonArea.containsMouse ? Color.mOnHover : Color.mOnSurfaceVariant
|
||||
font.weight: Font.Medium
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: hibernateButtonArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: CompositorService.hibernate()
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on border.color {
|
||||
ColorAnimation {
|
||||
duration: 200
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Settings.data.general.compactLockScreen ? 36 : 48
|
||||
|
||||
@@ -65,6 +65,11 @@ SmartPanel {
|
||||
"title": I18n.tr("session-menu.suspend"),
|
||||
"isShutdown": false
|
||||
},
|
||||
"hibernate": {
|
||||
"icon": "hibernate",
|
||||
"title": I18n.tr("session-menu.hibernate"),
|
||||
"isShutdown": false
|
||||
},
|
||||
"reboot": {
|
||||
"icon": "reboot",
|
||||
"title": I18n.tr("session-menu.reboot"),
|
||||
@@ -159,6 +164,9 @@ SmartPanel {
|
||||
CompositorService.suspend()
|
||||
}
|
||||
break
|
||||
case "hibernate":
|
||||
CompositorService.hibernate()
|
||||
break
|
||||
case "reboot":
|
||||
CompositorService.reboot()
|
||||
break
|
||||
|
||||
@@ -22,6 +22,11 @@ ColumnLayout {
|
||||
"text": I18n.tr("session-menu.suspend"),
|
||||
"enabled": true,
|
||||
"required": false
|
||||
}, {
|
||||
"id": "hibernate",
|
||||
"text": I18n.tr("session-menu.hibernate"),
|
||||
"enabled": true,
|
||||
"required": false
|
||||
}, {
|
||||
"id": "reboot",
|
||||
"text": I18n.tr("session-menu.reboot"),
|
||||
|
||||
Reference in New Issue
Block a user