mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-29 07:03:08 +00:00
better layout when the space is scarce
This commit is contained in:
parent
58bc75eef4
commit
c52a96e984
1 changed files with 41 additions and 13 deletions
|
|
@ -97,11 +97,8 @@ MouseArea {
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents.Label {
|
||||||
id: appLabel
|
id: appLabel
|
||||||
anchors {
|
anchors.leftMargin: units.gridUnit * 3
|
||||||
left: parent.left
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
leftMargin: units.gridUnit * 3
|
|
||||||
}
|
|
||||||
color: PlasmaCore.ColorScope.textColor
|
color: PlasmaCore.ColorScope.textColor
|
||||||
text: model.appName
|
text: model.appName
|
||||||
}
|
}
|
||||||
|
|
@ -109,23 +106,24 @@ MouseArea {
|
||||||
Column {
|
Column {
|
||||||
id: messageLayout
|
id: messageLayout
|
||||||
anchors {
|
anchors {
|
||||||
left: appLabel.right
|
|
||||||
right: icon.left
|
|
||||||
verticalCenter: parent.verticalCenter
|
verticalCenter: parent.verticalCenter
|
||||||
rightMargin: units.smallSpacing
|
left: parent.left
|
||||||
|
right: icon.left
|
||||||
|
leftMargin: units.gridUnit * 3
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents.Label {
|
||||||
anchors {
|
id: summaryLabel
|
||||||
right: parent.right
|
anchors.right: parent.right
|
||||||
left: parent.left
|
width: messageLayout.width - appLabel.width
|
||||||
}
|
|
||||||
horizontalAlignment: Qt.AlignRight
|
horizontalAlignment: Qt.AlignRight
|
||||||
verticalAlignment: Qt.AlignVCenter
|
verticalAlignment: Qt.AlignVCenter
|
||||||
text: summary + (!notificationItem.expanded && body ? "..." : "")
|
text: summary + (!notificationItem.expanded && body ? "..." : "")
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents.Label {
|
||||||
|
id: bodyLabel
|
||||||
anchors {
|
anchors {
|
||||||
right: parent.right
|
right: parent.right
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
|
@ -136,9 +134,9 @@ MouseArea {
|
||||||
text: body
|
text: body
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
PlasmaCore.IconItem {
|
||||||
id: icon
|
id: icon
|
||||||
anchors {
|
anchors {
|
||||||
|
|
@ -174,4 +172,34 @@ MouseArea {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "large"
|
||||||
|
when: appLabel.width + bodyLabel.paintedWidth < messageLayout.width
|
||||||
|
AnchorChanges {
|
||||||
|
target: appLabel
|
||||||
|
anchors {
|
||||||
|
verticalCenter: parent.verticalCenter
|
||||||
|
top: undefined
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PropertyChanges {
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "compact"
|
||||||
|
when: notificationItem.state != "large"
|
||||||
|
AnchorChanges {
|
||||||
|
target: appLabel
|
||||||
|
anchors {
|
||||||
|
verticalCenter: undefined
|
||||||
|
top: messageLayout.top
|
||||||
|
left: parent.left
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue