lock: show status on small screens
Hide notifs but show status
This commit is contained in:
parent
b3e9bcfc2d
commit
0b520dc28b
2 changed files with 99 additions and 97 deletions
|
|
@ -69,8 +69,8 @@ WlSessionLockSurface {
|
|||
weatherWidth: weather.implicitWidth
|
||||
buttonsWidth: buttons.item?.nonAnimWidth ?? 0
|
||||
buttonsHeight: buttons.item?.nonAnimHeight ?? 0
|
||||
statusWidth: status.item?.nonAnimWidth ?? 0
|
||||
statusHeight: status.item?.nonAnimHeight ?? 0
|
||||
statusWidth: status.nonAnimWidth ?? 0
|
||||
statusHeight: status.nonAnimHeight ?? 0
|
||||
isNormal: root.screen.width > Config.lock.sizes.smallScreenWidth
|
||||
isLarge: root.screen.width > Config.lock.sizes.largeScreenWidth
|
||||
|
||||
|
|
@ -162,17 +162,15 @@ WlSessionLockSurface {
|
|||
sourceComponent: Buttons {}
|
||||
}
|
||||
|
||||
Loader {
|
||||
Status {
|
||||
id: status
|
||||
|
||||
active: root.screen.width > Config.lock.sizes.largeScreenWidth
|
||||
|
||||
anchors.bottom: parent.top
|
||||
anchors.left: parent.right
|
||||
anchors.bottomMargin: -backgrounds.statusBottom
|
||||
anchors.leftMargin: -backgrounds.statusLeft
|
||||
|
||||
sourceComponent: Status {}
|
||||
showNotifs: root.screen.width > Config.lock.sizes.largeScreenWidth
|
||||
}
|
||||
|
||||
component Anim: NumberAnimation {
|
||||
|
|
|
|||
|
|
@ -10,13 +10,15 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
|
||||
WrapperItem {
|
||||
readonly property real nonAnimWidth: (notifs.count > 0 ? Config.notifs.sizes.width : status.implicitWidth) + margin
|
||||
property alias showNotifs: notifs.active
|
||||
|
||||
readonly property real nonAnimWidth: (notifs.item?.count > 0 ? Config.notifs.sizes.width : status.implicitWidth) + margin
|
||||
readonly property real nonAnimHeight: {
|
||||
if (notifs.count > 0) {
|
||||
const count = Math.min(notifs.count, Config.lock.maxNotifs);
|
||||
if (notifs.active && notifs.item.count > 0) {
|
||||
const count = Math.min(notifs.item.count, Config.lock.maxNotifs);
|
||||
let height = status.implicitHeight + Appearance.spacing.normal + Appearance.spacing.smaller * (count - 1);
|
||||
for (let i = 0; i < count; i++)
|
||||
height += notifs.itemAtIndex(i)?.nonAnimHeight ?? 0;
|
||||
height += notifs.item.itemAtIndex(i)?.nonAnimHeight ?? 0;
|
||||
return height + margin;
|
||||
}
|
||||
|
||||
|
|
@ -33,7 +35,7 @@ WrapperItem {
|
|||
Timer {
|
||||
running: true
|
||||
interval: 10
|
||||
onTriggered: notifs.countChanged()
|
||||
onTriggered: notifs.item?.countChanged()
|
||||
}
|
||||
|
||||
Behavior on implicitWidth {
|
||||
|
|
@ -118,12 +120,13 @@ WrapperItem {
|
|||
}
|
||||
}
|
||||
|
||||
ListView {
|
||||
Loader {
|
||||
id: notifs
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
sourceComponent: ListView {
|
||||
model: ScriptModel {
|
||||
values: [...Notifs.list].reverse()
|
||||
}
|
||||
|
|
@ -227,6 +230,7 @@ WrapperItem {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
component Anim: NumberAnimation {
|
||||
duration: Appearance.anim.durations.normal
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue