Changeset View
Changeset View
Standalone View
Standalone View
src/qml/MetaDataDelegate.qml
Show All 21 Lines | |||||
22 | import org.kde.elisa 1.0 | 22 | import org.kde.elisa 1.0 | ||
23 | 23 | | |||
24 | RowLayout { | 24 | RowLayout { | ||
25 | id: delegateRow | 25 | id: delegateRow | ||
26 | spacing: 0 | 26 | spacing: 0 | ||
27 | 27 | | |||
28 | height: (model.type === TrackMetadataModel.LongTextEntry ? longTextDisplayLoader.height : (metaDataLabelMetric.boundingRect.height + elisaTheme.layoutVerticalMargin / 2)) | 28 | height: (model.type === TrackMetadataModel.LongTextEntry ? longTextDisplayLoader.height : (metaDataLabelMetric.boundingRect.height + elisaTheme.layoutVerticalMargin / 2)) | ||
29 | 29 | | |||
30 | | ||||
31 | TextMetrics { | 30 | TextMetrics { | ||
32 | id: metaDataLabelMetric | 31 | id: metaDataLabelMetric | ||
astippich: codeStyle | |||||
33 | 32 | | |||
34 | text: 'Metadata Name' | 33 | text: 'Metadata Name' | ||
35 | } | 34 | } | ||
36 | 35 | | |||
37 | Label { | 36 | Label { | ||
38 | id: metaDataLabels | 37 | id: metaDataLabels | ||
39 | 38 | | |||
40 | text: i18nc("Label for a piece of metadata, e.g. 'Album Artist:'", "%1:", model.name) | 39 | text: i18nc("Label for a piece of metadata, e.g. 'Album Artist:'", "%1:", model.name) | ||
41 | 40 | | |||
astippich: codeStyle | |||||
42 | font.weight: Font.Bold | 41 | font.weight: Font.Bold | ||
43 | 42 | | |||
44 | horizontalAlignment: Text.AlignRight | 43 | horizontalAlignment: Text.AlignRight | ||
45 | 44 | | |||
46 | Layout.alignment: Qt.AlignTop | 45 | Layout.alignment: Qt.AlignTop | ||
47 | Layout.preferredWidth: 0.8 * elisaTheme.coverImageSize | 46 | Layout.preferredWidth: 0.8 * elisaTheme.coverImageSize | ||
48 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin / 2 : 0 | 47 | Layout.rightMargin: !LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin / 2 : 0 | ||
49 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin / 2 : 0 | 48 | Layout.leftMargin: LayoutMirroring.enabled ? elisaTheme.layoutHorizontalMargin / 2 : 0 | ||
50 | } | 49 | } | ||
51 | 50 | | |||
52 | Loader { | 51 | Loader { | ||
53 | id: textDisplayLoader | 52 | id: textDisplayLoader | ||
54 | 53 | | |||
55 | active: model.type === TrackMetadataModel.TextEntry || model.type === TrackMetadataModel.IntegerEntry | 54 | active: model.type === TrackMetadataModel.TextEntry || model.type === TrackMetadataModel.IntegerEntry | ||
56 | visible: model.type === TrackMetadataModel.TextEntry || model.type === TrackMetadataModel.IntegerEntry | 55 | visible: model.type === TrackMetadataModel.TextEntry || model.type === TrackMetadataModel.IntegerEntry | ||
57 | 56 | | |||
58 | Layout.fillWidth: true | 57 | Layout.fillWidth: true | ||
59 | Layout.alignment: Qt.AlignTop | 58 | Layout.alignment: Qt.AlignTop | ||
60 | 59 | | |||
60 | | ||||
61 | sourceComponent: LabelWithToolTip { | 61 | sourceComponent: LabelWithToolTip { | ||
62 | text: model.display | 62 | text: model.display | ||
63 | 63 | | |||
64 | horizontalAlignment: Text.AlignLeft | 64 | horizontalAlignment: Text.AlignLeft | ||
65 | elide: Text.ElideRight | 65 | elide: Text.ElideRight | ||
66 | 66 | | |||
67 | anchors.fill: parent | 67 | anchors.fill: parent | ||
68 | } | 68 | } | ||
69 | } | 69 | } | ||
I think there is not a lot that can be shared here. A new delegate is imho suitable in this case. Maybe something like a EditableMetaDataDelegate? We may actually use this one then in the future, too, once Elisa supports metadata editing. astippich: I think there is not a lot that can be shared here. A new delegate is imho suitable in this… | |||||
70 | 70 | | |||
71 | Loader { | 71 | Loader { | ||
72 | id: longTextDisplayLoader | 72 | id: longTextDisplayLoader | ||
73 | 73 | | |||
74 | active: model.type === TrackMetadataModel.LongTextEntry | 74 | active: model.type === TrackMetadataModel.LongTextEntry | ||
75 | visible: model.type === TrackMetadataModel.LongTextEntry | 75 | visible: model.type === TrackMetadataModel.LongTextEntry | ||
76 | 76 | | |||
77 | Layout.fillWidth: true | 77 | Layout.fillWidth: true | ||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |
codeStyle