summaryrefslogtreecommitdiffstats
path: root/components/SessionManagementScreen.qml
diff options
context:
space:
mode:
Diffstat (limited to 'components/SessionManagementScreen.qml')
-rw-r--r--components/SessionManagementScreen.qml44
1 files changed, 19 insertions, 25 deletions
diff --git a/components/SessionManagementScreen.qml b/components/SessionManagementScreen.qml
index 58110c5..0e87d26 100644
--- a/components/SessionManagementScreen.qml
+++ b/components/SessionManagementScreen.qml
@@ -1,21 +1,8 @@
/*
- * Copyright 2016 David Edmundson <davidedmundson@kde.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+ SPDX-FileCopyrightText: 2016 David Edmundson <davidedmundson@kde.org>
+
+ SPDX-License-Identifier: LGPL-2.0-or-later
+*/
import QtQuick 2.2
@@ -25,7 +12,7 @@ import QtQuick.Controls 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 3.0 as PlasmaComponents3
-Item {
+FocusScope {
id: root
/*
@@ -56,7 +43,7 @@ Item {
* Self explanatory
*/
property alias userListCurrentIndex: userListView.currentIndex
- property var userListCurrentModelData: userListView.currentItem === null ? [] : userListView.currentItem.m
+ property alias userListCurrentItem: userListView.currentItem
property bool showUserList: true
property alias userList: userListView
@@ -65,11 +52,18 @@ Item {
default property alias _children: innerLayout.children
+ // FIXME: move this component into a layout, rather than abusing
+ // anchors and implicitly relying on other components' built-in
+ // whitespace to avoid items being overlapped.
UserList {
id: userListView
visible: showUserList && y > 0
anchors {
bottom: parent.verticalCenter
+ // We only need an extra bottom margin when text is constrained,
+ // since only in this case can the username label be a multi-line
+ // string that would otherwise overflow.
+ bottomMargin: constrainText ? PlasmaCore.Units.gridUnit * 3 : 0
left: parent.left
right: parent.right
}
@@ -82,14 +76,14 @@ Item {
ColumnLayout {
id: prompts
anchors.top: parent.verticalCenter
- anchors.topMargin: units.gridUnit * 0.5
+ anchors.topMargin: PlasmaCore.Units.gridUnit * 0.5
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
PlasmaComponents3.Label {
id: notificationsLabel
font.pointSize: root.fontSize
- Layout.maximumWidth: units.gridUnit * 16
+ Layout.maximumWidth: PlasmaCore.Units.gridUnit * 16
Layout.alignment: Qt.AlignHCenter
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
@@ -98,8 +92,8 @@ Item {
}
ColumnLayout {
Layout.minimumHeight: implicitHeight
- Layout.maximumHeight: units.gridUnit * 10
- Layout.maximumWidth: units.gridUnit * 16
+ Layout.maximumHeight: PlasmaCore.Units.gridUnit * 10
+ Layout.maximumWidth: PlasmaCore.Units.gridUnit * 16
Layout.alignment: Qt.AlignHCenter
ColumnLayout {
id: innerLayout
@@ -112,8 +106,8 @@ Item {
}
Row { //deliberately not rowlayout as I'm not trying to resize child items
id: actionItemsLayout
- spacing: units.largeSpacing / 2
- Layout.alignment: Qt.AlignHCenter
+ spacing: PlasmaCore.Units.largeSpacing / 2
+ Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
}
Item {
Layout.fillHeight: true