Verified Commit 2740ee01 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[applets/userswitcher] Fix some sizing issues in full representation

Wrong sizing and constraints sometimes caused the popup to be too small.
parent d5e3677e
......@@ -29,10 +29,11 @@ Item {
property Item highlight
// sizing: top-down explicit width, bottom-up implicit height
implicitHeight: row.implicitHeight + 2 * PlasmaCore.Units.smallSpacing
implicitWidth: row.implicitWidth
Layout.fillWidth: true
height: row.height + 2 * PlasmaCore.Units.smallSpacing
MouseArea {
id: area
anchors.fill: parent
......
......@@ -107,7 +107,11 @@ Item {
id: fullRoot
Layout.preferredWidth: PlasmaCore.Units.gridUnit * 12
Layout.preferredHeight: Math.min(Screen.height * 0.5, column.contentHeight)
Layout.preferredHeight: column.implicitContentHeight
Layout.minimumWidth: Layout.preferredWidth
Layout.minimumHeight: Layout.preferredHeight
Layout.maximumWidth: Layout.preferredWidth
Layout.maximumHeight: Screen.height / 2
PlasmaCore.DataSource {
id: pmEngine
......@@ -135,13 +139,19 @@ Item {
id: column
// there doesn't seem a more sensible way of getting this due to the expanding ListView
readonly property int contentHeight: currentUserItem.height + userList.contentHeight + PlasmaCore.Units.smallSpacing
+ (newSessionButton.visible ? newSessionButton.height : 0)
+ (lockScreenButton.visible ? lockScreenButton.height : 0)
+ leaveButton.height
readonly property real implicitContentHeight: {
let h = currentUserItem.implicitHeight;
h += userList.contentHeight;
if (newSessionButton.visible) {
h += newSessionButton.implicitHeight;
}
if (lockScreenButton.visible) {
h += lockScreenButton.implicitHeight;
}
h += leaveButton.implicitHeight;
}
anchors.fill: parent
spacing: 0
ListDelegate {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment