Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
170 changes: 84 additions & 86 deletions sddm/QTStep.source/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@
*
***************************************************************************/

import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls 1.4 as QQC
import QtQuick.Controls.Styles 1.4
import QtQuick
import QtQuick.Controls
import QtQuick.Controls as QQC
import QtQuick.Layouts 1.3
import SddmComponents 2.0

Expand Down Expand Up @@ -285,17 +284,15 @@ Rectangle {
Layout.preferredHeight: font.pixelSize + 10
font.family: "Liberation Sans"
font.pixelSize: 19 * container.scalingFactor
textColor: "#101000"
style: TextFieldStyle {
background: BorderImage {
border.left: 2
border.right: 1
border.top: 2
border.bottom: 1
smooth: false
source: control.focus ? "entry-focused.svg"
: "entry.svg"
}
color: "#101000"
background: BorderImage {
border.left: 2
border.right: 1
border.top: 2
border.bottom: 1
smooth: false
source: parent.focus ? "entry-focused.svg"
: "entry.svg"
}
}

Expand All @@ -314,17 +311,15 @@ Rectangle {
Layout.preferredHeight: font.pixelSize + 10
font.family: "Liberation Sans"
font.pixelSize: 19 * container.scalingFactor
textColor: "#101000"
style: TextFieldStyle {
background: BorderImage {
border.left: 2
border.right: 1
border.top: 2
border.bottom: 1
smooth: false
source: control.focus ? "entry-focused.svg"
: "entry.svg"
}
color: "#101000"
background: BorderImage {
border.left: 2
border.right: 1
border.top: 2
border.bottom: 1
smooth: false
source: parent.focus ? "entry-focused.svg"
: "entry.svg"
}
Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
Expand Down Expand Up @@ -357,38 +352,47 @@ Rectangle {
id: sessionbutton
property int currentIndex: -1

style: ButtonStyle {
padding.right: 7
label: RowLayout {
Label {
Layout.fillWidth: true
text: instantiator.objectAt(sessionbutton.currentIndex).text || ""
font.family: "Liberation Sans"
font.pixelSize: 19 * container.scalingFactor
color: "#111111"
}
Image {
source: "combo-indicator.svg"
}
contentItem: RowLayout {
Label {
Layout.fillWidth: true
text: instantiator.objectAt(sessionbutton.currentIndex).text || ""
font.family: "Liberation Sans"
font.pixelSize: 19 * container.scalingFactor
color: "#111111"
}
background: BorderImage {
border.left: 1
border.right: 2
border.top: 1
border.bottom: 2
smooth: false
source: control.pressed ? "button-pressed.svg"
: control.hovered ? "button-hover.svg"
: control.focus ? "button-hover.svg"
: "button.svg"
Image {
source: "combo-indicator.svg"
}
}

background: BorderImage {
border.left: 1
border.right: 2
border.top: 1
border.bottom: 2
smooth: false
source: parent.pressed ? "button-pressed.svg"
: parent.hovered ? "button-hover.svg"
: parent.focus ? "button-hover.svg"
: "button.svg"
}
rightPadding: 7

Component.onCompleted: {
currentIndex = sessionModel.lastIndex
}

checkable: true
checked: sessionmenu.opened
onToggled: {
if (checked) {
sessionmenu.popup(sessionbutton, 0, 0)
} else {
sessionmenu.dismiss()
}
}

menu: QQC.Menu {
QQC.Menu {
id: sessionmenu
Instantiator {
id: instantiator
Expand Down Expand Up @@ -424,18 +428,16 @@ Rectangle {
Layout.preferredWidth: suspend_button_content.width + 7
Layout.minimumWidth: suspend_button_content.height + 13
Layout.preferredHeight: suspend_button_content.height + 13
style: ButtonStyle {
background: BorderImage {
border.left: 1
border.right: 2
border.top: 1
border.bottom: 2
smooth: false
source: control.pressed ? "button-pressed.svg"
: control.hovered ? "button-hover.svg"
: control.focus ? "button-hover.svg"
: "button.svg"
}
background: BorderImage {
border.left: 1
border.right: 2
border.top: 1
border.bottom: 2
smooth: false
source: parent.pressed ? "button-pressed.svg"
: parent.hovered ? "button-hover.svg"
: parent.focus ? "button-hover.svg"
: "button.svg"
}
ColumnLayout {
id: suspend_button_content
Expand Down Expand Up @@ -465,18 +467,16 @@ Rectangle {
Layout.preferredWidth: reboot_button_content.width + 7
Layout.minimumWidth: reboot_button_content.height + 13
Layout.preferredHeight: reboot_button_content.height + 13
style: ButtonStyle {
background: BorderImage {
border.left: 1
border.right: 2
border.top: 1
border.bottom: 2
smooth: false
source: control.pressed ? "button-pressed.svg"
: control.hovered ? "button-hover.svg"
: control.focus ? "button-hover.svg"
: "button.svg"
}
background: BorderImage {
border.left: 1
border.right: 2
border.top: 1
border.bottom: 2
smooth: false
source: parent.pressed ? "button-pressed.svg"
: parent.hovered ? "button-hover.svg"
: parent.focus ? "button-hover.svg"
: "button.svg"
}
ColumnLayout {
id: reboot_button_content
Expand Down Expand Up @@ -506,18 +506,16 @@ Rectangle {
Layout.preferredWidth: shutdown_button_content.width + 7
Layout.minimumWidth: shutdown_button_content.height + 13
Layout.preferredHeight: shutdown_button_content.height + 13
style: ButtonStyle {
background: BorderImage {
border.left: 1
border.right: 2
border.top: 1
border.bottom: 2
smooth: false
source: control.pressed ? "button-pressed.svg"
: control.hovered ? "button-hover.svg"
: control.focus ? "button-hover.svg"
: "button.svg"
}
background: BorderImage {
border.left: 1
border.right: 2
border.top: 1
border.bottom: 2
smooth: false
source: parent.pressed ? "button-pressed.svg"
: parent.hovered ? "button-hover.svg"
: parent.focus ? "button-hover.svg"
: "button.svg"
}
ColumnLayout {
id: shutdown_button_content
Expand Down