Skip to content

Commit

Permalink
Merge pull request #786 from Yamakuzure/fix_session_index
Browse files Browse the repository at this point in the history
Fix session selection in Elarun
  • Loading branch information
davidedmundson committed Sep 14, 2017
2 parents d08afa7 + 02ce1e8 commit 983c70c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
15 changes: 4 additions & 11 deletions data/themes/elarun/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Rectangle {
LayoutMirroring.enabled: Qt.locale().textDirection == Qt.RightToLeft
LayoutMirroring.childrenInherit: true

property int sessionIndex: session.index

TextConstants { id: textConstants }

Connections {
Expand Down Expand Up @@ -132,7 +134,7 @@ Rectangle {

Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(user_entry.text, pw_entry.text, menu_session.index)
sddm.login(user_entry.text, pw_entry.text, sessionIndex)
event.accepted = true
}
}
Expand All @@ -148,7 +150,7 @@ Rectangle {

source: "images/login_normal.png"

onClicked: sddm.login(user_entry.text, pw_entry.text, menu_session.index)
onClicked: sddm.login(user_entry.text, pw_entry.text, sessionIndex)

KeyNavigation.backtab: pw_entry; KeyNavigation.tab: session_button
}
Expand Down Expand Up @@ -221,15 +223,6 @@ Rectangle {
font.bold: true
font.pixelSize: 12
}

Menu {
id: menu_session
width: 200; height: 0
anchors.top: buttonRow.bottom; anchors.left: buttonRow.left

model: sessionModel
index: sessionModel.lastIndex
}
}
}
}
Expand Down
8 changes: 5 additions & 3 deletions data/themes/maldives/Main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Rectangle {
LayoutMirroring.enabled: Qt.locale().textDirection == Qt.RightToLeft
LayoutMirroring.childrenInherit: true

property int sessionIndex: session.index

TextConstants { id: textConstants }

Connections {
Expand Down Expand Up @@ -121,7 +123,7 @@ Rectangle {

Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(name.text, password.text, session.index)
sddm.login(name.text, password.text, sessionIndex)
event.accepted = true
}
}
Expand All @@ -148,7 +150,7 @@ Rectangle {

Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(name.text, password.text, session.index)
sddm.login(name.text, password.text, sessionIndex)
event.accepted = true
}
}
Expand Down Expand Up @@ -237,7 +239,7 @@ Rectangle {
text: textConstants.login
width: parent.btnWidth

onClicked: sddm.login(name.text, password.text, session.index)
onClicked: sddm.login(name.text, password.text, sessionIndex)

KeyNavigation.backtab: layoutBox; KeyNavigation.tab: shutdownButton
}
Expand Down

0 comments on commit 983c70c

Please sign in to comment.