mirror of https://code.videolan.org/videolan/vlc
qml: use nullish coalescence and optional chaining to simplify conditions
optional chaining was introduced in 6.2 nullish coalescence was introduced in 5.15 no functional changes
This commit is contained in:
parent
e50ca0c0b4
commit
04a49bff37
|
@ -70,8 +70,7 @@ Item {
|
||||||
text: {
|
text: {
|
||||||
const text = modelData.name
|
const text = modelData.name
|
||||||
|
|
||||||
if (!!MainCtx.controlbarProfileModel.currentModel &&
|
if (MainCtx.controlbarProfileModel.currentModel?.getModel(identifier).dirty)
|
||||||
MainCtx.controlbarProfileModel.currentModel.getModel(identifier).dirty)
|
|
||||||
return _markDirty(text)
|
return _markDirty(text)
|
||||||
else
|
else
|
||||||
return text
|
return text
|
||||||
|
@ -188,7 +187,7 @@ Item {
|
||||||
rightMetric.width) * 1.25
|
rightMetric.width) * 1.25
|
||||||
: 0
|
: 0
|
||||||
|
|
||||||
readonly property int count: !!item ? item.count : 0
|
readonly property int count: item?.count ?? 0
|
||||||
|
|
||||||
sourceComponent: Rectangle {
|
sourceComponent: Rectangle {
|
||||||
color: theme.bg.primary
|
color: theme.bg.primary
|
||||||
|
@ -304,6 +303,6 @@ Item {
|
||||||
Util.ViewDragAutoScrollHandler {
|
Util.ViewDragAutoScrollHandler {
|
||||||
id: dragAutoScrollHandler
|
id: dragAutoScrollHandler
|
||||||
|
|
||||||
view: _viewThatContainsDrag ? _viewThatContainsDrag : null
|
view: _viewThatContainsDrag ?? null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,16 +67,13 @@ FocusScope {
|
||||||
const item = stackView.currentItem
|
const item = stackView.currentItem
|
||||||
|
|
||||||
sourcesBanner.localMenuDelegate = Qt.binding(function () {
|
sourcesBanner.localMenuDelegate = Qt.binding(function () {
|
||||||
return !!item.localMenuDelegate ? item.localMenuDelegate : null
|
return item.localMenuDelegate ?? null
|
||||||
})
|
})
|
||||||
|
|
||||||
// NOTE: sortMenu is declared with the SortMenu type, so when it's undefined we have to
|
// NOTE: sortMenu is declared with the SortMenu type, so when it's undefined we have to
|
||||||
// return null to avoid a QML warning.
|
// return null to avoid a QML warning.
|
||||||
sourcesBanner.sortMenu = Qt.binding(function () {
|
sourcesBanner.sortMenu = Qt.binding(function () {
|
||||||
if (item.sortMenu)
|
return item.sortMenu ?? null
|
||||||
return item.sortMenu
|
|
||||||
else
|
|
||||||
return null
|
|
||||||
})
|
})
|
||||||
|
|
||||||
MainCtx.hasGridListMode = Qt.binding(() => item.hasGridListMode !== undefined && item.hasGridListMode)
|
MainCtx.hasGridListMode = Qt.binding(() => item.hasGridListMode !== undefined && item.hasGridListMode)
|
||||||
|
|
|
@ -56,7 +56,7 @@ Widgets.StackViewExt {
|
||||||
property Component loadingComponent: null
|
property Component loadingComponent: null
|
||||||
|
|
||||||
// NOTE: Sometimes the model has no 'loading' property.
|
// NOTE: Sometimes the model has no 'loading' property.
|
||||||
readonly property bool isLoading: (model.loading) ? model.loading : false
|
readonly property bool isLoading: model.loading ?? false
|
||||||
|
|
||||||
readonly property int count: model.count
|
readonly property int count: model.count
|
||||||
|
|
||||||
|
|
|
@ -371,7 +371,7 @@ FocusScope {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
Widgets.ListLabel {
|
Widgets.ListLabel {
|
||||||
text: !!rowModel && !!rowModel.track_number ? rowModel.track_number : ""
|
text: rowModel?.track_number ?? ""
|
||||||
color: theme.fg.primary
|
color: theme.fg.primary
|
||||||
font.weight: Font.Normal
|
font.weight: Font.Normal
|
||||||
|
|
||||||
|
@ -381,7 +381,7 @@ FocusScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
Widgets.ListLabel {
|
Widgets.ListLabel {
|
||||||
text: !!rowModel && !!rowModel.title ? rowModel.title : ""
|
text: rowModel?.title ?? ""
|
||||||
color: theme.fg.primary
|
color: theme.fg.primary
|
||||||
|
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
|
@ -50,15 +50,15 @@ VideoAll {
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
|
|
||||||
model: !!_meta ? _meta.model : null
|
model: _meta?.model ?? null
|
||||||
|
|
||||||
contextMenu: Util.MLContextMenu { model: _meta ? _meta.model : null; showPlayAsAudioAction: true }
|
contextMenu: Util.MLContextMenu { model: _meta ? _meta.model : null; showPlayAsAudioAction: true }
|
||||||
|
|
||||||
gridLabels: !!_meta ? _meta.gridLabels : root.getLabel
|
gridLabels: _meta?.gridLabels ?? root.getLabel
|
||||||
|
|
||||||
listLabels: !!_meta ? _meta.listLabels : root.getLabel
|
listLabels: _meta?.listLabels ?? root.getLabel
|
||||||
|
|
||||||
sectionProperty: !!_meta && !!_meta.sectionProperty ? _meta.sectionProperty : ""
|
sectionProperty: _meta?.sectionProperty ?? ""
|
||||||
|
|
||||||
headerPositioning: headerItem.model.count > 0 ? ListView.InlineHeader : ListView.OverlayHeader
|
headerPositioning: headerItem.model.count > 0 ? ListView.InlineHeader : ListView.OverlayHeader
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ Widgets.GridItem {
|
||||||
fallbackImage: VLCStyle.noArtVideoCover
|
fallbackImage: VLCStyle.noArtVideoCover
|
||||||
|
|
||||||
title: model.title || qsTr("Unknown title")
|
title: model.title || qsTr("Unknown title")
|
||||||
subtitle: !!model && (typeof model.duration !== "undefined") ? model.duration.formatHMS() : ""
|
subtitle: model?.duration?.formatHMS() ?? ""
|
||||||
pictureWidth: VLCStyle.gridCover_video_width
|
pictureWidth: VLCStyle.gridCover_video_width
|
||||||
pictureHeight: VLCStyle.gridCover_video_height
|
pictureHeight: VLCStyle.gridCover_video_height
|
||||||
playCoverBorderWidth: VLCStyle.gridCover_video_border
|
playCoverBorderWidth: VLCStyle.gridCover_video_border
|
||||||
|
|
|
@ -34,22 +34,22 @@ FocusScope {
|
||||||
|
|
||||||
/* required */ property var model
|
/* required */ property var model
|
||||||
|
|
||||||
readonly property int rowHeight: (_currentView) ? _currentView.rowHeight : 0
|
readonly property int rowHeight: _currentView?.rowHeight ?? 0
|
||||||
|
|
||||||
readonly property int contentHeight: (_currentView) ? _currentView.contentHeight : 0
|
readonly property int contentHeight: _currentView?.contentHeight ?? 0
|
||||||
|
|
||||||
readonly property int contentLeftMargin: (_currentView) ? _currentView.contentLeftMargin : 0
|
readonly property int contentLeftMargin: _currentView?.contentLeftMargin ?? 0
|
||||||
readonly property int contentRightMargin: (_currentView) ? _currentView.contentRightMargin : 0
|
readonly property int contentRightMargin: _currentView?.contentRightMargin ?? 0
|
||||||
|
|
||||||
property int displayMarginEnd: 0
|
property int displayMarginEnd: 0
|
||||||
|
|
||||||
readonly property int currentIndex: (_currentView) ? _currentView.currentIndex : -1
|
readonly property int currentIndex: _currentView?.currentIndex ?? -1
|
||||||
|
|
||||||
property int maximumRows: -1
|
property int maximumRows: -1
|
||||||
|
|
||||||
readonly property int maximumCount: (_currentView) ? _currentView.maximumCount : -1
|
readonly property int maximumCount: _currentView?.maximumCount ?? -1
|
||||||
|
|
||||||
readonly property int nbItemPerRow: (_currentView) ? _currentView.nbItemPerRow : 1
|
readonly property int nbItemPerRow: _currentView?.nbItemPerRow ?? 1
|
||||||
|
|
||||||
property bool isSearchable: true
|
property bool isSearchable: true
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ FocusScope {
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
Navigation.parentItem: root
|
Navigation.parentItem: root
|
||||||
Navigation.downItem: (!!urlListDisplay.item) ? urlListDisplay.item : null
|
Navigation.downItem: urlListDisplay.item ?? null
|
||||||
|
|
||||||
Widgets.TextFieldExt {
|
Widgets.TextFieldExt {
|
||||||
id: searchField
|
id: searchField
|
||||||
|
|
|
@ -107,7 +107,7 @@ Item {
|
||||||
verticalAlignment: root.verticalAlignment
|
verticalAlignment: root.verticalAlignment
|
||||||
|
|
||||||
source: {
|
source: {
|
||||||
if (!!networkModel && !!networkModel.artwork && networkModel.artwork.length > 0)
|
if (networkModel?.artwork && networkModel.artwork.length > 0)
|
||||||
return VLCAccessImage.uri(networkModel.artwork)
|
return VLCAccessImage.uri(networkModel.artwork)
|
||||||
|
|
||||||
return ""
|
return ""
|
||||||
|
|
|
@ -71,7 +71,7 @@ Repeater {
|
||||||
// Events
|
// Events
|
||||||
|
|
||||||
onActiveFocusChanged: {
|
onActiveFocusChanged: {
|
||||||
if (activeFocus && (!!item && !item.focus)) {
|
if (activeFocus && !item?.focus) {
|
||||||
recoverFocus()
|
recoverFocus()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,7 +209,7 @@ Repeater {
|
||||||
// Private
|
// Private
|
||||||
|
|
||||||
function _focusIfFocusable(_loader) {
|
function _focusIfFocusable(_loader) {
|
||||||
if (!!_loader && !!_loader.item && _loader.item.focus) {
|
if (_loader?.item?.focus) {
|
||||||
if (item.focusReason !== undefined)
|
if (item.focusReason !== undefined)
|
||||||
_loader.item.forceActiveFocus(item.focusReason)
|
_loader.item.forceActiveFocus(item.focusReason)
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -176,7 +176,7 @@ FocusScope {
|
||||||
rightMargin: layoutSpacing - spacing
|
rightMargin: layoutSpacing - spacing
|
||||||
}
|
}
|
||||||
|
|
||||||
active: !!playerControlLayout.model && !!playerControlLayout.model.left && (playerControlLayout.model.left.count > 0) &&
|
active: !!playerControlLayout.model?.left && (playerControlLayout.model.left.count > 0) &&
|
||||||
!loaderLeftRight.active
|
!loaderLeftRight.active
|
||||||
|
|
||||||
focus: active
|
focus: active
|
||||||
|
|
|
@ -287,8 +287,8 @@ T.ProgressBar {
|
||||||
Item {
|
Item {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: seekpointsRect
|
id: seekpointsRect
|
||||||
readonly property real startPosition: model.startPosition === undefined ? 0.0 : model.startPosition
|
readonly property real startPosition: model.startPosition ?? 0.0
|
||||||
readonly property real endPosition: model.endPosition === undefined ? 1.0 : model.endPosition
|
readonly property real endPosition: model.endPosition ?? 1.0
|
||||||
|
|
||||||
readonly property int _currentChapter: {
|
readonly property int _currentChapter: {
|
||||||
if (control.visualPosition < seekpointsRect.startPosition)
|
if (control.visualPosition < seekpointsRect.startPosition)
|
||||||
|
|
|
@ -91,8 +91,8 @@ FocusScope{
|
||||||
|
|
||||||
function _layoutLine(c1, c2, offset)
|
function _layoutLine(c1, c2, offset)
|
||||||
{
|
{
|
||||||
let c1Height = c1 !== undefined ? c1.implicitHeight : 0
|
let c1Height = c1?.implicitHeight ?? 0
|
||||||
let c2Height = c2 !== undefined ? c2.implicitHeight : 0
|
let c2Height = c2?.implicitHeight ?? 0
|
||||||
|
|
||||||
if (c2 === csdDecorations) {
|
if (c2 === csdDecorations) {
|
||||||
//csdDecorations.implicitHeight gets overwritten when the height is set,
|
//csdDecorations.implicitHeight gets overwritten when the height is set,
|
||||||
|
|
|
@ -163,7 +163,7 @@ T.ItemDelegate {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: (model.artwork && model.artwork.toString()) ? VLCAccessImage.uri(model.artwork) : VLCStyle.noArtAlbumCover
|
source: (model?.artwork.toString()) ? VLCAccessImage.uri(model.artwork) : VLCStyle.noArtAlbumCover
|
||||||
visible: !statusIcon.visible
|
visible: !statusIcon.visible
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
||||||
|
@ -219,7 +219,7 @@ T.ItemDelegate {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
text: (model.artist ? model.artist : qsTr("Unknown Artist"))
|
text: model?.artist ?? qsTr("Unknown Artist")
|
||||||
color: theme.fg.primary
|
color: theme.fg.primary
|
||||||
verticalAlignment: Text.AlignBottom
|
verticalAlignment: Text.AlignBottom
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ T.Pane {
|
||||||
property var model: PlaylistListModel {
|
property var model: PlaylistListModel {
|
||||||
playlist: MainPlaylistController.playlist
|
playlist: MainPlaylistController.playlist
|
||||||
}
|
}
|
||||||
readonly property ListSelectionModel selectionModel: listView ? listView.selectionModel : null
|
readonly property ListSelectionModel selectionModel: listView?.selectionModel ?? null
|
||||||
|
|
||||||
property bool useAcrylic: true
|
property bool useAcrylic: true
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import "qrc:///style/"
|
||||||
StateGroup {
|
StateGroup {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
state: target ? target.state : ""
|
state: target?.state ?? ""
|
||||||
|
|
||||||
property Item target
|
property Item target
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ QtObject {
|
||||||
// if 'dragItem' is null, user must override property 'dragging' and 'dragPosProvider'
|
// if 'dragItem' is null, user must override property 'dragging' and 'dragPosProvider'
|
||||||
property Item dragItem: null
|
property Item dragItem: null
|
||||||
|
|
||||||
property bool dragging: !!dragItem && dragItem.visible
|
property bool dragging: dragItem?.visible
|
||||||
|
|
||||||
property var dragPosProvider: function () {
|
property var dragPosProvider: function () {
|
||||||
return root.view.mapFromItem(root.dragItem.parent,
|
return root.view.mapFromItem(root.dragItem.parent,
|
||||||
|
|
|
@ -96,7 +96,7 @@ T.TabButton {
|
||||||
horizontalCenter: parent.horizontalCenter
|
horizontalCenter: parent.horizontalCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
width: control.contentItem ? control.contentItem.implicitWidth : 0
|
width: control.contentItem?.implicitWidth ?? 0
|
||||||
|
|
||||||
visible: (width > 0 && control.showCurrentIndicator && control.selected)
|
visible: (width > 0 && control.showCurrentIndicator && control.selected)
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,8 @@ Item {
|
||||||
property bool anchorInside: true
|
property bool anchorInside: true
|
||||||
|
|
||||||
//private
|
//private
|
||||||
readonly property int _targetHeight: target ? target.height : 0
|
readonly property int _targetHeight: target?.height ?? 0
|
||||||
readonly property int _targetWidth: target ? target.width : 0
|
readonly property int _targetWidth: target?.width ?? 0
|
||||||
|
|
||||||
readonly property int _edgeVtHeight: target ? (target.height - root.csdSize * 2) : 0
|
readonly property int _edgeVtHeight: target ? (target.height - root.csdSize * 2) : 0
|
||||||
readonly property int _edgeHzWidth: target ? (target.width - root.csdSize * 2) : 0
|
readonly property int _edgeHzWidth: target ? (target.width - root.csdSize * 2) : 0
|
||||||
|
|
|
@ -34,9 +34,9 @@ Rectangle {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly property int _frameMarginLeft: VLCStyle.palette.csdMetrics ? VLCStyle.palette.csdMetrics.csdFrameMarginLeft : 0
|
readonly property int _frameMarginLeft: VLCStyle.palette.csdMetrics?.csdFrameMarginLeft ?? 0
|
||||||
readonly property int _frameMarginRight: VLCStyle.palette.csdMetrics ? VLCStyle.palette.csdMetrics.csdFrameMarginRight : 0
|
readonly property int _frameMarginRight: VLCStyle.palette.csdMetrics?.csdFrameMarginRight ?? 0
|
||||||
readonly property int _interNavButtonSpacing: VLCStyle.palette.csdMetrics ? VLCStyle.palette.csdMetrics.interNavButtonSpacing : 0
|
readonly property int _interNavButtonSpacing: VLCStyle.palette.csdMetrics?.interNavButtonSpacing ?? 0
|
||||||
|
|
||||||
implicitWidth: layout.implicitWidth + _frameMarginLeft + _frameMarginRight
|
implicitWidth: layout.implicitWidth + _frameMarginLeft + _frameMarginRight
|
||||||
implicitHeight: layout.implicitHeight
|
implicitHeight: layout.implicitHeight
|
||||||
|
|
|
@ -32,10 +32,10 @@ ScaledImage {
|
||||||
property real viewportWidth: rectWidth + (Math.max(Math.abs(primaryHorizontalOffset) + primaryBlurRadius, Math.abs(secondaryHorizontalOffset) + secondaryBlurRadius)) * 2
|
property real viewportWidth: rectWidth + (Math.max(Math.abs(primaryHorizontalOffset) + primaryBlurRadius, Math.abs(secondaryHorizontalOffset) + secondaryBlurRadius)) * 2
|
||||||
property real viewportHeight: rectHeight + (Math.max(Math.abs(primaryVerticalOffset) + primaryBlurRadius, Math.abs(secondaryVerticalOffset) + secondaryBlurRadius)) * 2
|
property real viewportHeight: rectHeight + (Math.max(Math.abs(primaryVerticalOffset) + primaryBlurRadius, Math.abs(secondaryVerticalOffset) + secondaryBlurRadius)) * 2
|
||||||
|
|
||||||
property real rectWidth: sourceItem ? sourceItem.width : 0
|
property real rectWidth: sourceItem?.width ?? 0
|
||||||
property real rectHeight: sourceItem ? sourceItem.height : 0
|
property real rectHeight: sourceItem?.height ?? 0
|
||||||
property real xRadius: (sourceItem && sourceItem.radius !== undefined ) ? sourceItem.radius : 0
|
property real xRadius: sourceItem?.radius ?? 0
|
||||||
property real yRadius: (sourceItem && sourceItem.radius !== undefined ) ? sourceItem.radius : 0
|
property real yRadius: sourceItem?.radius ?? 0
|
||||||
|
|
||||||
property color primaryColor: Qt.rgba(0, 0, 0, .18)
|
property color primaryColor: Qt.rgba(0, 0, 0, .18)
|
||||||
property real primaryVerticalOffset: 0
|
property real primaryVerticalOffset: 0
|
||||||
|
|
|
@ -30,13 +30,13 @@ ScaledImage {
|
||||||
property real blurRadius: 0
|
property real blurRadius: 0
|
||||||
property color color
|
property color color
|
||||||
|
|
||||||
property real rectWidth: sourceItem ? sourceItem.width : 0
|
property real rectWidth: sourceItem?.width ?? 0
|
||||||
property real rectHeight: sourceItem ? sourceItem.height : 0
|
property real rectHeight: sourceItem?.height ?? 0
|
||||||
|
|
||||||
property real xOffset: 0
|
property real xOffset: 0
|
||||||
property real yOffset: 0
|
property real yOffset: 0
|
||||||
property real xRadius: (sourceItem && sourceItem.radius !== undefined) ? sourceItem.radius : 0
|
property real xRadius: sourceItem?.radius ?? 0
|
||||||
property real yRadius: (sourceItem && sourceItem.radius !== undefined) ? sourceItem.radius : 0
|
property real yRadius: sourceItem?.radius ?? 0
|
||||||
|
|
||||||
sourceSize: Qt.size(viewportWidth, viewportHeight)
|
sourceSize: Qt.size(viewportWidth, viewportHeight)
|
||||||
|
|
||||||
|
|
|
@ -696,7 +696,7 @@ FocusScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
function _onModelCountChanged() {
|
function _onModelCountChanged() {
|
||||||
_count = model ? model.rowCount() : 0
|
_count = model?.rowCount() ?? 0
|
||||||
if (!_isInitialised)
|
if (!_isInitialised)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -38,11 +38,11 @@ FadingEdge {
|
||||||
: delegateItem.width) / 2
|
: delegateItem.width) / 2
|
||||||
: (VLCStyle.margin_large * 2)
|
: (VLCStyle.margin_large * 2)
|
||||||
|
|
||||||
readonly property bool transitionsRunning: ((listView.add ? listView.add.running : false) ||
|
readonly property bool transitionsRunning: (listView.add?.running ||
|
||||||
(listView.addDisplaced ? listView.addDisplaced.running : false) ||
|
listView.addDisplaced?.running ||
|
||||||
(listView.populate ? listView.populate.running : false) ||
|
listView.populate?.running ||
|
||||||
(listView.remove ? listView.remove.running : false) ||
|
listView.remove?.running ||
|
||||||
(listView.removeDisplaced ? listView.removeDisplaced.running : false))
|
listView.removeDisplaced?.running)
|
||||||
|
|
||||||
// TODO: Use itemAtIndex(0) Qt >= 5.13
|
// TODO: Use itemAtIndex(0) Qt >= 5.13
|
||||||
// FIXME: Delegate with variable size
|
// FIXME: Delegate with variable size
|
||||||
|
|
|
@ -70,7 +70,7 @@ FocusScope {
|
||||||
}
|
}
|
||||||
|
|
||||||
property Component header: null
|
property Component header: null
|
||||||
property Item headerItem: view.headerItem ? view.headerItem.loadedHeader : null
|
property Item headerItem: view.headerItem?.loadedHeader ?? null
|
||||||
property color headerColor: colorContext.bg.primary
|
property color headerColor: colorContext.bg.primary
|
||||||
property int headerTopPadding: 0
|
property int headerTopPadding: 0
|
||||||
|
|
||||||
|
|
|
@ -35,20 +35,14 @@ StackViewExt {
|
||||||
property var pageModel: []
|
property var pageModel: []
|
||||||
|
|
||||||
//indicates whether the subview support grid/list mode
|
//indicates whether the subview support grid/list mode
|
||||||
readonly property bool hasGridListMode: (currentItem
|
readonly property bool hasGridListMode: currentItem?.hasGridListMode ?? false
|
||||||
&& currentItem.hasGridListMode !== undefined
|
|
||||||
&& currentItem.hasGridListMode)
|
|
||||||
|
|
||||||
readonly property bool isSearchable: (currentItem
|
readonly property bool isSearchable: currentItem?.isSearchable ?? false
|
||||||
&& currentItem.isSearchable !== undefined
|
|
||||||
&& currentItem.isSearchable)
|
|
||||||
|
|
||||||
readonly property var sortModel: (currentItem
|
readonly property var sortModel: currentItem?.sortModel ?? null
|
||||||
&& currentItem.sortModel !== undefined) ? currentItem.sortModel : null
|
|
||||||
|
|
||||||
//property is *not* readOnly, a PageLoader may define a localMenuDelegate common for its subviews (music, video)
|
//property is *not* readOnly, a PageLoader may define a localMenuDelegate common for its subviews (music, video)
|
||||||
property Component localMenuDelegate: (currentItem
|
property Component localMenuDelegate: (currentItem?.localMenuDelegate
|
||||||
&& currentItem.localMenuDelegate
|
|
||||||
&& (currentItem.localMenuDelegate instanceof Component)) ? currentItem.localMenuDelegate : null
|
&& (currentItem.localMenuDelegate instanceof Component)) ? currentItem.localMenuDelegate : null
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -102,13 +102,7 @@ Item {
|
||||||
Layout.preferredHeight: root.titleCover_height
|
Layout.preferredHeight: root.titleCover_height
|
||||||
Layout.preferredWidth: root.titleCover_width
|
Layout.preferredWidth: root.titleCover_width
|
||||||
|
|
||||||
source: {
|
source: titleDel.rowModel?.[root.criteriaCover] ?? ""
|
||||||
let cover = null
|
|
||||||
if (!!titleDel.rowModel) {
|
|
||||||
cover = titleDel.rowModel[root.criteriaCover]
|
|
||||||
}
|
|
||||||
return cover || ""
|
|
||||||
}
|
|
||||||
|
|
||||||
fallbackImageSource: titleDel.model.placeHolder || VLCStyle.noArtAlbumCover
|
fallbackImageSource: titleDel.model.placeHolder || VLCStyle.noArtAlbumCover
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue