mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
widgets/notifications: Use smaller button text, and adjust sizing
Fixes an issue where the ListView was sometimes not tall enough to hold the content despite the list not overflowing. Also adjusts button text to be smaller.
This commit is contained in:
parent
8b6095c864
commit
0a76701af5
1 changed files with 15 additions and 22 deletions
|
|
@ -145,11 +145,10 @@ Item {
|
|||
readonly property int animationDuration: MobileShell.MobileShellSettings.animationsEnabled ? PlasmaCore.Units.longDuration : 0
|
||||
|
||||
// If a screen overflow occurs, fix height in order to maintain tool buttons in place.
|
||||
readonly property bool listOverflowing: contentItem.childrenRect.height + toolButtons.height + bottomMargin + spacing >= root.height
|
||||
readonly property bool listOverflowing: contentItem.childrenRect.height + toolButtons.height + spacing >= root.height
|
||||
|
||||
bottomMargin: spacing * 2
|
||||
|
||||
height: count === 0 ? 0 : listOverflowing ? root.height - toolButtons.height - bottomMargin : contentItem.childrenRect.height + spacing
|
||||
bottomMargin: spacing
|
||||
height: count === 0 ? 0 : (listOverflowing ? root.height - toolButtons.height : contentItem.childrenRect.height + bottomMargin)
|
||||
|
||||
anchors {
|
||||
top: parent.top
|
||||
|
|
@ -334,12 +333,11 @@ Item {
|
|||
|
||||
Item {
|
||||
id: toolButtons
|
||||
height: spacer.height + toolLayout.height + toolLayout.anchors.topMargin + toolLayout.anchors.bottomMargin
|
||||
|
||||
// do not show on lockscreen
|
||||
visible: !root.actionsRequireUnlock
|
||||
|
||||
width: root.width
|
||||
height: toolLayout.implicitHeight + spacer.height
|
||||
|
||||
anchors {
|
||||
top: list.bottom
|
||||
left: parent.left
|
||||
|
|
@ -348,17 +346,11 @@ Item {
|
|||
|
||||
Rectangle {
|
||||
id: spacer
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
visible: list.listOverflowing
|
||||
|
||||
anchors {
|
||||
top: toolButtons.top
|
||||
left: toolButtons.left
|
||||
right: toolButtons.right
|
||||
}
|
||||
|
||||
height: 1
|
||||
|
||||
opacity: 0.25
|
||||
color: PlasmaCore.Theme.textColor
|
||||
}
|
||||
|
|
@ -368,12 +360,11 @@ Item {
|
|||
|
||||
anchors {
|
||||
top: spacer.bottom
|
||||
topMargin: list.spacing
|
||||
left: parent.left
|
||||
leftMargin: PlasmaCore.Units.smallSpacing
|
||||
right: parent.right
|
||||
rightMargin: PlasmaCore.Units.smallSpacing
|
||||
bottom: parent.bottom
|
||||
left: parent.left
|
||||
leftMargin: PlasmaCore.Units.largeSpacing
|
||||
rightMargin: PlasmaCore.Units.largeSpacing
|
||||
topMargin: list.spacing
|
||||
bottomMargin: list.spacing
|
||||
}
|
||||
|
||||
|
|
@ -383,6 +374,7 @@ Item {
|
|||
Layout.alignment: hasNotifications ? Qt.AlignLeft : Qt.AlignHCenter
|
||||
|
||||
font.bold: true
|
||||
font.pointSize: Kirigami.Theme.smallFont.pointSize
|
||||
|
||||
icon.name: doNotDisturbModeEnabled ? "notifications" : "notifications-disabled"
|
||||
text: doNotDisturbModeEnabled ? "Enable Notifications" : "Do Not Disturb"
|
||||
|
|
@ -397,6 +389,7 @@ Item {
|
|||
visible: hasNotifications
|
||||
|
||||
font.bold: true
|
||||
font.pointSize: Kirigami.Theme.smallFont.pointSize
|
||||
|
||||
icon.name: "edit-clear-history"
|
||||
text: "Clear All Notifications"
|
||||
|
|
|
|||
Loading…
Reference in a new issue