Themes: fix deprecated signal handler declarations

Fixes following warnings:
```
QML Connections: Implicitly defined onFoo properties in Connections are deprecated. Use this syntax instead: function onFoo(<arguments>) { ... }
Parameter "event" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead.
```
This commit is contained in:
Aleksei Bavshin 2024-02-26 21:11:01 -08:00 committed by Fabian Vogt
parent 391baf22f5
commit 82af253421
9 changed files with 29 additions and 26 deletions

View File

@ -111,7 +111,7 @@ Rectangle {
onReleased: { container.focus = true; container.released() }
}
Keys.onPressed: {
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Space) {
container.spaceDown = true;
container.pressed()
@ -122,7 +122,7 @@ Rectangle {
}
}
Keys.onReleased: {
Keys.onReleased: function (event) {
if (event.key === Qt.Key_Space) {
container.spaceDown = false;
container.released()

View File

@ -134,7 +134,7 @@ FocusScope {
}
}
Keys.onPressed: {
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Up) {
listView.decrementCurrentIndex()
} else if (event.key === Qt.Key_Down) {

View File

@ -77,7 +77,7 @@ Image {
onReleased: { container.focus = true; container.released() }
}
Keys.onPressed: {
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Space) {
container.spaceDown = true;
container.pressed()
@ -88,7 +88,7 @@ Image {
}
}
Keys.onReleased: {
Keys.onReleased: function (event) {
if (event.key === Qt.Key_Space) {
container.spaceDown = false;
container.released()

View File

@ -30,12 +30,16 @@ ComboBox {
model: keyboard.layouts
index: keyboard.currentLayout
onValueChanged: keyboard.currentLayout = id
function onValueChanged(id) {
keyboard.currentLayout = id
}
Connections {
target: keyboard
onCurrentLayoutChanged: combo.index = keyboard.currentLayout
function onCurrentLayoutChanged() {
combo.index = keyboard.currentLayout
}
}
rowDelegate: Rectangle {

View File

@ -105,7 +105,7 @@ FocusScope {
focus: true
visible: showPassword
Keys.onPressed: {
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
container.login();
event.accepted = true

View File

@ -39,11 +39,11 @@ Rectangle {
Connections {
target: sddm
onLoginSucceeded: {
function onLoginSucceeded() {
}
onInformationMessage: {
function onInformationMessage(message) {
}
onLoginFailed: {
function onLoginFailed() {
pw_entry.text = ""
}
}
@ -135,7 +135,7 @@ Rectangle {
KeyNavigation.backtab: user_entry; KeyNavigation.tab: login_button
Keys.onPressed: {
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(user_entry.text, pw_entry.text, sessionIndex)
event.accepted = true

View File

@ -40,17 +40,16 @@ Rectangle {
Connections {
target: sddm
onLoginSucceeded: {
function onLoginSucceeded() {
errorMessage.color = "steelblue"
errorMessage.text = textConstants.loginSucceeded
}
onLoginFailed: {
function onLoginFailed() {
password.text = ""
errorMessage.color = "red"
errorMessage.text = textConstants.loginFailed
}
onInformationMessage: {
function onInformationMessage(message) {
errorMessage.color = "red"
errorMessage.text = message
}
@ -126,7 +125,7 @@ Rectangle {
KeyNavigation.backtab: rebootButton; KeyNavigation.tab: password
Keys.onPressed: {
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(name.text, password.text, sessionIndex)
event.accepted = true
@ -153,7 +152,7 @@ Rectangle {
KeyNavigation.backtab: name; KeyNavigation.tab: session
Keys.onPressed: {
Keys.onPressed: function (event) {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(name.text, password.text, sessionIndex)
event.accepted = true

View File

@ -75,7 +75,7 @@ Rectangle {
Connections {
target: sddm
onLoginSucceeded: {
function onLoginSucceeded() {
prompt_bg.color = successText
prompt_txt.text = textConstants.loginSucceeded
@ -84,7 +84,7 @@ Rectangle {
anim_success.start()
}
onLoginFailed: {
function onLoginFailed() {
prompt_bg.color = failureText
prompt_txt.text = textConstants.loginFailed
@ -93,7 +93,7 @@ Rectangle {
anim_failure.start()
}
onInformationMessage: {
function onInformationMessage(message) {
prompt_bg.color = failureText
prompt_txt.text = message
@ -505,7 +505,7 @@ Rectangle {
KeyNavigation.tab : maya_login
KeyNavigation.backtab : maya_username
Keys.onPressed: {
Keys.onPressed: function (event) {
if ((event.key === Qt.Key_Return) || (event.key === Qt.Key_Enter)) {
maya_root.tryLogin()
@ -546,7 +546,7 @@ Rectangle {
onClicked: maya_root.tryLogin()
Keys.onPressed: {
Keys.onPressed: function (event) {
if ((event.key === Qt.Key_Return) || (event.key === Qt.Key_Enter)) {
maya_root.tryLogin()

View File

@ -40,15 +40,15 @@ Rectangle {
Connections {
target: sddm
onLoginSucceeded: {
function onLoginSucceeded() {
}
onLoginFailed: {
function onLoginFailed() {
txtMessage.text = textConstants.loginFailed
listView.currentItem.password = ""
}
onInformationMessage: {
function onInformationMessage(message) {
txtMessage.text = message
}
}