Commit 311c0a93 authored by Alexander Stippich's avatar Alexander Stippich

fix display of single/multi disc albums and cleanup

parent 0f7e1063
......@@ -192,10 +192,14 @@ QVariant DataModel::data(const QModelIndex &index, int role) const
switch (d->mModelType)
{
case ElisaUtils::Track:
result = d->mAllTrackData[index.row()][TrackDataType::key_type::IsSingleDiscAlbumRole];
break;
case ElisaUtils::Radio:
result = false;
break;
case ElisaUtils::Album:
result = d->mAllAlbumData[index.row()][AlbumDataType::key_type::IsSingleDiscAlbumRole];
break;
case ElisaUtils::Artist:
case ElisaUtils::Genre:
case ElisaUtils::Lyricist:
......
......@@ -62,13 +62,13 @@ FocusScope {
}
Component {
id: singleAlbumDelegate
id: albumDelegate
ListBrowserDelegate {
id: entry
width: listView.delegateWidth
height: ((true && !true) ? elisaTheme.delegateHeight*2 : elisaTheme.delegateHeight)
height: elisaTheme.delegateHeight
focus: true
......@@ -82,7 +82,6 @@ FocusScope {
trackNumber: model.trackNumber ? model.trackNumber : -1
discNumber: model.discNumber ? model.discNumber : -1
rating: model.rating
isSingleDiscAlbum: true
isSelected: listView.currentIndex === index
isAlternateColor: (index % 2) === 1
detailedView: false
......@@ -111,7 +110,7 @@ FocusScope {
}
Component {
id: multipleDiscDelegate
id: detailedTrackDelegate
ListBrowserDelegate {
id: entry
......@@ -131,7 +130,7 @@ FocusScope {
trackNumber: model.trackNumber ? model.trackNumber : -1
discNumber: model.discNumber ? model.discNumber : -1
rating: model.rating
isSingleDiscAlbum: model.isSingleDiscAlbum
hideDiscNumber: model.isSingleDiscAlbum
isSelected: listView.currentIndex === index
isAlternateColor: (index % 2) === 1
......@@ -163,7 +162,7 @@ FocusScope {
contentModel: proxyModel
delegate: (displaySingleAlbum ? singleAlbumDelegate : multipleDiscDelegate)
delegate: (displaySingleAlbum ? albumDelegate : detailedTrackDelegate)
enableSorting: !displaySingleAlbum
......
......@@ -36,7 +36,7 @@ FocusScope {
property int trackNumber
property int discNumber
property int rating
property bool isSingleDiscAlbum
property bool hideDiscNumber
property bool isSelected
property bool isAlternateColor
property bool detailedView: true
......@@ -142,13 +142,13 @@ FocusScope {
Layout.fillWidth: true
Layout.leftMargin: {
if (!LayoutMirroring.enabled)
return (!isSingleDiscAlbum ? elisaTheme.layoutHorizontalMargin * 4 : elisaTheme.layoutHorizontalMargin)
return (!hideDiscNumber ? elisaTheme.layoutHorizontalMargin * 4 : elisaTheme.layoutHorizontalMargin)
else
return 0
}
Layout.rightMargin: {
if (LayoutMirroring.enabled)
return (!isSingleDiscAlbum ? elisaTheme.layoutHorizontalMargin * 4 : elisaTheme.layoutHorizontalMargin)
return (!hideDiscNumber ? elisaTheme.layoutHorizontalMargin * 4 : elisaTheme.layoutHorizontalMargin)
else
return 0
}
......@@ -239,7 +239,7 @@ FocusScope {
}
if (album !== '') {
labelText += ' - ' + album
if (!isSingleDiscAlbum && discNumber !== -1) {
if (!hideDiscNumber && discNumber !== -1) {
labelText += ' - CD ' + discNumber
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment