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