internal: fix null errors
This commit is contained in:
parent
72101f4e86
commit
4ca23da8e1
5 changed files with 14 additions and 15 deletions
|
|
@ -11,14 +11,14 @@ Item {
|
||||||
|
|
||||||
implicitHeight: LauncherConfig.sizes.itemHeight
|
implicitHeight: LauncherConfig.sizes.itemHeight
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent?.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent?.right
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
|
|
||||||
function onClicked(): void {
|
function onClicked(): void {
|
||||||
root.modelData.onClicked(root.list);
|
root.modelData?.onClicked(root.list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,7 +31,7 @@ Item {
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
text: root.modelData.icon
|
text: root.modelData?.icon ?? ""
|
||||||
font.pointSize: Appearance.font.size.extraLarge
|
font.pointSize: Appearance.font.size.extraLarge
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
@ -48,12 +48,12 @@ Item {
|
||||||
StyledText {
|
StyledText {
|
||||||
id: name
|
id: name
|
||||||
|
|
||||||
text: root.modelData.name
|
text: root.modelData?.name ?? ""
|
||||||
font.pointSize: Appearance.font.size.normal
|
font.pointSize: Appearance.font.size.normal
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: root.modelData.desc
|
text: root.modelData?.desc ?? ""
|
||||||
font.pointSize: Appearance.font.size.small
|
font.pointSize: Appearance.font.size.small
|
||||||
color: Colours.alpha(Colours.palette.m3outline, true)
|
color: Colours.alpha(Colours.palette.m3outline, true)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ Item {
|
||||||
|
|
||||||
implicitHeight: LauncherConfig.sizes.itemHeight
|
implicitHeight: LauncherConfig.sizes.itemHeight
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent?.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent?.right
|
||||||
|
|
||||||
StateLayer {
|
StateLayer {
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
|
|
@ -34,7 +34,7 @@ Item {
|
||||||
IconImage {
|
IconImage {
|
||||||
id: icon
|
id: icon
|
||||||
|
|
||||||
source: Quickshell.iconPath(root.modelData.icon, "image-missing")
|
source: Quickshell.iconPath(root.modelData?.icon, "image-missing")
|
||||||
implicitSize: parent.height * 0.8
|
implicitSize: parent.height * 0.8
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
@ -51,12 +51,12 @@ Item {
|
||||||
StyledText {
|
StyledText {
|
||||||
id: name
|
id: name
|
||||||
|
|
||||||
text: root.modelData.name
|
text: root.modelData?.name ?? ""
|
||||||
font.pointSize: Appearance.font.size.normal
|
font.pointSize: Appearance.font.size.normal
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
text: root.modelData.comment || root.modelData.genericName || root.modelData.name
|
text: (root.modelData?.comment || root.modelData?.genericName || root.modelData?.name) ?? ""
|
||||||
font.pointSize: Appearance.font.size.small
|
font.pointSize: Appearance.font.size.small
|
||||||
color: Colours.alpha(Colours.palette.m3outline, true)
|
color: Colours.alpha(Colours.palette.m3outline, true)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,8 @@ Item {
|
||||||
Item {
|
Item {
|
||||||
id: empty
|
id: empty
|
||||||
|
|
||||||
opacity: root.currentList.count === 0 ? 1 : 0
|
opacity: root.currentList?.count === 0 ? 1 : 0
|
||||||
scale: root.currentList.count === 0 ? 1 : 0.5
|
scale: root.currentList?.count === 0 ? 1 : 0.5
|
||||||
|
|
||||||
implicitWidth: icon.width + text.width + Appearance.spacing.small
|
implicitWidth: icon.width + text.width + Appearance.spacing.small
|
||||||
implicitHeight: icon.height
|
implicitHeight: icon.height
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ StyledRect {
|
||||||
|
|
||||||
scale: 0.5
|
scale: 0.5
|
||||||
opacity: 0
|
opacity: 0
|
||||||
z: PathView.z
|
z: PathView.z ?? 0
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
scale = Qt.binding(() => PathView.isCurrentItem ? 1 : PathView.onPath ? 0.8 : 0);
|
scale = Qt.binding(() => PathView.isCurrentItem ? 1 : PathView.onPath ? 0.8 : 0);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,6 @@ PathView {
|
||||||
preferredHighlightBegin: 0.5
|
preferredHighlightBegin: 0.5
|
||||||
preferredHighlightEnd: 0.5
|
preferredHighlightEnd: 0.5
|
||||||
highlightRangeMode: PathView.StrictlyEnforceRange
|
highlightRangeMode: PathView.StrictlyEnforceRange
|
||||||
highlightMoveDuration: Appearance.anim.durations.short
|
|
||||||
|
|
||||||
delegate: WallpaperItem {
|
delegate: WallpaperItem {
|
||||||
visibilities: root.visibilities
|
visibilities: root.visibilities
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue