Fix: fixed array out of range in system buttons, added ability to bypass checks.

This commit is contained in:
Keyitdev
2024-12-23 16:10:54 +01:00
parent 8ac616a827
commit 7123e3870b
2 changed files with 4 additions and 23 deletions
+1 -2
View File
@@ -384,9 +384,8 @@ Column {
height: root.font.pointSize * 9
width: parent.width / 2
anchors.horizontalCenter: parent.horizontalCenter
visible: config.HideLoginButton == "true" ? false : true
visible: config.HideLoginButton == "true" ? false : true
Button {
id: loginButton
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
+3 -21
View File
@@ -32,24 +32,21 @@ RowLayout {
icon.width: 2 * Math.round((root.font.pointSize * 3) / 2)
icon.color: config.SystemButtonsIconsColor
display: AbstractButton.TextUnderIcon
visible: config.HideSystemButtons != "true" && modelData[2]
visible: config.HideSystemButtons != "true" && (config.BypassSystemButtonsChecks == "true" ? 1 : modelData[2])
hoverEnabled: true
palette.buttonText: config.SystemButtonsIconsColor
background: Rectangle {
height: 2
color: "transparent"
width: parent.width
border.width: parent.activeFocus ? 1 : 0
border.color: "transparent"
anchors.top: parent.bottom
}
Keys.onReturnPressed: clicked()
onClicked: {
parent.forceActiveFocus()
index == 0 ? sddm.powerOff() : index == 1 ? sddm.reboot() : index == 2 ? sddm.suspend() : sddm.hibernate()
}
KeyNavigation.up: exposedSession
KeyNavigation.left: parent.children[index-1]
KeyNavigation.left: index > 0 ? parent.children[index-1] : null
states: [
State {
@@ -60,11 +57,6 @@ RowLayout {
icon.color: root.palette.buttonText
palette.buttonText: Qt.darker(root.palette.buttonText, 1.1)
}
PropertyChanges {
target: parent.children[index].background
icon.color: root.palette.buttonText
border.color: Qt.darker(root.palette.buttonText, 1.1)
}
},
State {
name: "hovered"
@@ -74,11 +66,6 @@ RowLayout {
icon.color: root.palette.buttonText
palette.buttonText: Qt.lighter(root.palette.buttonText, 1.1)
}
PropertyChanges {
target: parent.children[index].background
icon.color: root.palette.buttonText
border.color: Qt.lighter(root.palette.buttonText, 1.1)
}
},
State {
name: "focused"
@@ -88,11 +75,6 @@ RowLayout {
icon.color: root.palette.buttonText
palette.buttonText: root.palette.buttonText
}
PropertyChanges {
target: parent.children[index].background
icon.color: root.palette.buttonText
border.color: root.palette.buttonText
}
}
]