diff --git a/sddm/QTStep.source/main.qml b/sddm/QTStep.source/main.qml index d6312c7..ed9d82b 100644 --- a/sddm/QTStep.source/main.qml +++ b/sddm/QTStep.source/main.qml @@ -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 @@ -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" } } @@ -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) { @@ -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 @@ -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 @@ -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 @@ -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