mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 21:42:51 -05:00
powermenu: support keyboard shortcuts
This commit is contained in:
@@ -149,6 +149,30 @@ DankModal {
|
||||
event.accepted = true
|
||||
}
|
||||
break
|
||||
case Qt.Key_R:
|
||||
selectOption("reboot")
|
||||
event.accepted = true
|
||||
break
|
||||
case Qt.Key_X:
|
||||
selectOption("logout")
|
||||
event.accepted = true
|
||||
break
|
||||
case Qt.Key_P:
|
||||
selectOption("poweroff")
|
||||
event.accepted = true
|
||||
break
|
||||
case Qt.Key_L:
|
||||
selectOption("lock")
|
||||
event.accepted = true
|
||||
break
|
||||
case Qt.Key_S:
|
||||
selectOption("suspend")
|
||||
event.accepted = true
|
||||
break
|
||||
case Qt.Key_H:
|
||||
selectOption(SessionService.hibernateSupported ? "hibernate" : "restart")
|
||||
event.accepted = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -204,6 +228,22 @@ DankModal {
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 20
|
||||
height: 16
|
||||
radius: 4
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.1)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StyledText {
|
||||
text: "R"
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||
font.weight: Font.Medium
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -254,6 +294,22 @@ DankModal {
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 20
|
||||
height: 16
|
||||
radius: 4
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.1)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StyledText {
|
||||
text: "X"
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||
font.weight: Font.Medium
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -304,6 +360,22 @@ DankModal {
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 20
|
||||
height: 16
|
||||
radius: 4
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.1)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StyledText {
|
||||
text: "P"
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||
font.weight: Font.Medium
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -354,6 +426,22 @@ DankModal {
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 20
|
||||
height: 16
|
||||
radius: 4
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.1)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StyledText {
|
||||
text: "L"
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||
font.weight: Font.Medium
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -404,6 +492,22 @@ DankModal {
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 20
|
||||
height: 16
|
||||
radius: 4
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.1)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StyledText {
|
||||
text: "S"
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||
font.weight: Font.Medium
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
@@ -454,6 +558,22 @@ DankModal {
|
||||
font.weight: Font.Medium
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: 20
|
||||
height: 16
|
||||
radius: 4
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.1)
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StyledText {
|
||||
text: "H"
|
||||
font.pixelSize: Theme.fontSizeSmall - 1
|
||||
color: Qt.rgba(Theme.surfaceText.r, Theme.surfaceText.g, Theme.surfaceText.b, 0.6)
|
||||
font.weight: Font.Medium
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
|
||||
@@ -1754,7 +1754,7 @@
|
||||
{
|
||||
"term": "Hibernate",
|
||||
"context": "Hibernate",
|
||||
"reference": "Modals/PowerMenuModal.qml:63, Modals/PowerMenuModal.qml:451, Modules/Lock/LockPowerMenu.qml:312",
|
||||
"reference": "Modals/PowerMenuModal.qml:63, Modals/PowerMenuModal.qml:555, Modules/Lock/LockPowerMenu.qml:312",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2048,7 +2048,7 @@
|
||||
{
|
||||
"term": "Lock",
|
||||
"context": "Lock",
|
||||
"reference": "Modals/PowerMenuModal.qml:351",
|
||||
"reference": "Modals/PowerMenuModal.qml:423",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2072,7 +2072,7 @@
|
||||
{
|
||||
"term": "Log Out",
|
||||
"context": "Log Out",
|
||||
"reference": "Modals/PowerMenuModal.qml:55, Modals/PowerMenuModal.qml:251, Modules/Lock/LockPowerMenu.qml:209, Modules/ControlCenter/PowerMenu.qml:14",
|
||||
"reference": "Modals/PowerMenuModal.qml:55, Modals/PowerMenuModal.qml:291, Modules/Lock/LockPowerMenu.qml:209, Modules/ControlCenter/PowerMenu.qml:14",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2846,7 +2846,7 @@
|
||||
{
|
||||
"term": "Power Off",
|
||||
"context": "Power Off",
|
||||
"reference": "Modals/PowerMenuModal.qml:71, Modals/PowerMenuModal.qml:301, Modules/Lock/LockPowerMenu.qml:432, Modules/ControlCenter/PowerMenu.qml:17",
|
||||
"reference": "Modals/PowerMenuModal.qml:71, Modals/PowerMenuModal.qml:357, Modules/Lock/LockPowerMenu.qml:432, Modules/ControlCenter/PowerMenu.qml:17",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -2978,7 +2978,7 @@
|
||||
{
|
||||
"term": "Reboot",
|
||||
"context": "Reboot",
|
||||
"reference": "Modals/PowerMenuModal.qml:67, Modals/PowerMenuModal.qml:201, Modules/Lock/LockPowerMenu.qml:372, Modules/ControlCenter/PowerMenu.qml:16",
|
||||
"reference": "Modals/PowerMenuModal.qml:67, Modals/PowerMenuModal.qml:225, Modules/Lock/LockPowerMenu.qml:372, Modules/ControlCenter/PowerMenu.qml:16",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3038,7 +3038,7 @@
|
||||
{
|
||||
"term": "Restart",
|
||||
"context": "Restart",
|
||||
"reference": "Modals/PowerMenuModal.qml:451",
|
||||
"reference": "Modals/PowerMenuModal.qml:555",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
@@ -3524,7 +3524,7 @@
|
||||
{
|
||||
"term": "Suspend",
|
||||
"context": "Suspend",
|
||||
"reference": "Modals/PowerMenuModal.qml:59, Modals/PowerMenuModal.qml:401, Modules/Lock/LockPowerMenu.qml:260, Modules/ControlCenter/PowerMenu.qml:15",
|
||||
"reference": "Modals/PowerMenuModal.qml:59, Modals/PowerMenuModal.qml:489, Modules/Lock/LockPowerMenu.qml:260, Modules/ControlCenter/PowerMenu.qml:15",
|
||||
"comment": ""
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user