chore: fix sidebar linter warnings
This commit is contained in:
parent
53109b28e6
commit
8090f21499
7 changed files with 292 additions and 285 deletions
|
|
@ -8,7 +8,7 @@ Item {
|
|||
id: root
|
||||
|
||||
required property Props props
|
||||
required property var visibilities
|
||||
required property DrawerVisibilities visibilities
|
||||
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
|
|
|
|||
|
|
@ -13,9 +13,9 @@ StyledRect {
|
|||
required property NotifData modelData
|
||||
required property Props props
|
||||
required property bool expanded
|
||||
required property var visibilities
|
||||
required property DrawerVisibilities visibilities
|
||||
|
||||
readonly property StyledText body: expandedContent.item?.body ?? null
|
||||
readonly property StyledText body: (expandedContent.item as ExpandedBody)?.body ?? null
|
||||
readonly property real nonAnimHeight: expanded ? summary.implicitHeight + expandedContent.implicitHeight + expandedContent.anchors.topMargin + Appearance.padding.normal * 2 : summaryHeightMetrics.height
|
||||
|
||||
implicitHeight: nonAnimHeight
|
||||
|
|
@ -118,13 +118,23 @@ StyledRect {
|
|||
anchors.right: parent.right
|
||||
anchors.topMargin: Appearance.spacing.small / 2
|
||||
|
||||
sourceComponent: ColumnLayout {
|
||||
readonly property alias body: body
|
||||
sourceComponent: ExpandedBody {}
|
||||
}
|
||||
|
||||
Behavior on implicitHeight {
|
||||
Anim {
|
||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
|
||||
component ExpandedBody: ColumnLayout {
|
||||
readonly property alias body: bodyText
|
||||
|
||||
spacing: Appearance.spacing.smaller
|
||||
|
||||
StyledText {
|
||||
id: body
|
||||
id: bodyText
|
||||
|
||||
Layout.fillWidth: true
|
||||
textFormat: Text.MarkdownText
|
||||
|
|
@ -142,14 +152,6 @@ StyledRect {
|
|||
notif: root.modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on implicitHeight {
|
||||
Anim {
|
||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
|
||||
component WrappedLoader: Loader {
|
||||
required property bool shouldBeActive
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ Item {
|
|||
id: root
|
||||
|
||||
required property Props props
|
||||
required property var visibilities
|
||||
required property DrawerVisibilities visibilities
|
||||
readonly property int notifCount: Notifs.list.reduce((acc, n) => n.closed ? acc : acc + 1, 0)
|
||||
|
||||
anchors.fill: parent
|
||||
|
|
@ -156,15 +156,16 @@ Item {
|
|||
let next = null;
|
||||
for (let i = 0; i < notifList.repeater.count; i++) {
|
||||
next = notifList.repeater.itemAt(i);
|
||||
if (!next?.closed)
|
||||
if (!next?.closed) // qmllint disable missing-property
|
||||
break;
|
||||
}
|
||||
if (next)
|
||||
next.closeAll();
|
||||
else
|
||||
if (next) {
|
||||
next.closeAll(); // qmllint disable missing-property
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loader {
|
||||
asynchronous: true
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Item {
|
|||
|
||||
required property Props props
|
||||
required property Flickable container
|
||||
required property var visibilities
|
||||
required property DrawerVisibilities visibilities
|
||||
|
||||
readonly property alias repeater: repeater
|
||||
readonly property int spacing: Appearance.spacing.small
|
||||
|
|
@ -39,7 +39,10 @@ Item {
|
|||
onValuesChanged: root.flagChanged()
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
delegate: NotifGroupDelegate {}
|
||||
}
|
||||
|
||||
component NotifGroupDelegate: MouseArea {
|
||||
id: notif
|
||||
|
||||
required property int index
|
||||
|
|
@ -58,8 +61,8 @@ Item {
|
|||
root.flag; // Force update
|
||||
let y = 0;
|
||||
for (let i = 0; i < index; i++) {
|
||||
const item = repeater.itemAt(i);
|
||||
if (!item.closed)
|
||||
const item = repeater.itemAt(i) as NotifGroupDelegate;
|
||||
if (item && !item.closed)
|
||||
y += item.nonAnimHeight + root.spacing;
|
||||
}
|
||||
return y;
|
||||
|
|
@ -164,4 +167,3 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ StyledRect {
|
|||
required property string modelData
|
||||
required property Props props
|
||||
required property Flickable container
|
||||
required property var visibilities
|
||||
required property DrawerVisibilities visibilities
|
||||
|
||||
readonly property list<var> notifs: Notifs.list.filter(n => n.appName === modelData)
|
||||
readonly property var groupProps: {
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ Item {
|
|||
required property list<var> notifs
|
||||
required property bool expanded
|
||||
required property Flickable container
|
||||
required property var visibilities
|
||||
required property DrawerVisibilities visibilities
|
||||
|
||||
readonly property real nonAnimHeight: {
|
||||
let h = -root.spacing;
|
||||
for (let i = 0; i < repeater.count; i++) {
|
||||
const item = repeater.itemAt(i);
|
||||
if (!item.modelData.closed && !item.previewHidden)
|
||||
const item = repeater.itemAt(i) as NotifDelegate;
|
||||
if (item && !item.modelData.closed && !item.previewHidden)
|
||||
h += item.nonAnimHeight + root.spacing;
|
||||
}
|
||||
return h;
|
||||
|
|
@ -59,7 +59,17 @@ Item {
|
|||
onValuesChanged: root.flagChanged()
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
delegate: NotifDelegate {}
|
||||
}
|
||||
|
||||
Behavior on implicitHeight {
|
||||
Anim {
|
||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
|
||||
component NotifDelegate: MouseArea {
|
||||
id: notif
|
||||
|
||||
required property int index
|
||||
|
|
@ -83,8 +93,8 @@ Item {
|
|||
root.flag; // Force update
|
||||
let y = 0;
|
||||
for (let i = 0; i < index; i++) {
|
||||
const item = repeater.itemAt(i);
|
||||
if (!item.modelData.closed && !item.previewHidden)
|
||||
const item = repeater.itemAt(i) as NotifDelegate;
|
||||
if (item && !item.modelData.closed && !item.previewHidden)
|
||||
y += item.nonAnimHeight + root.spacing;
|
||||
}
|
||||
return y;
|
||||
|
|
@ -203,11 +213,3 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on implicitHeight {
|
||||
Anim {
|
||||
duration: Appearance.anim.durations.expressiveDefaultSpatial
|
||||
easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ import QtQuick
|
|||
Item {
|
||||
id: root
|
||||
|
||||
required property var visibilities
|
||||
required property DrawerVisibilities visibilities
|
||||
required property var panels
|
||||
readonly property Props props: Props {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue