[vlc-commits] qml: apply theme changes in playlist
Fatih Uzunoglu
git at videolan.org
Tue Jan 12 13:20:35 UTC 2021
vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Jan 8 00:36:37 2021 +0300| [ead35a01675cebe592ccdcffa231a644a821375c] | committer: Pierre Lamot
qml: apply theme changes in playlist
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ead35a01675cebe592ccdcffa231a644a821375c
---
modules/gui/qt/playlist/qml/PlaylistDelegate.qml | 42 +++++++++++++-----------
modules/gui/qt/playlist/qml/PlaylistListView.qml | 31 ++++++++++-------
2 files changed, 43 insertions(+), 30 deletions(-)
diff --git a/modules/gui/qt/playlist/qml/PlaylistDelegate.qml b/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
index 385af4a8d6..40828ced92 100644
--- a/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
@@ -53,7 +53,7 @@ Rectangle {
// This item will become the parent of the dragged item during the drag operation
//property alias draggedItemParent: draggable_item.draggedItemParent
- height: Math.max( VLCStyle.fontHeight_normal, VLCStyle.icon_normal ) + VLCStyle.margin_xsmall
+ height: artworkItem.height * 1.5
function showTooltip(binding) {
plInfoTooltip.close()
@@ -200,15 +200,23 @@ Rectangle {
RowLayout {
id: content
+
+ height: delegate.height
+ spacing: 0
+
anchors {
- fill: parent
- leftMargin: delegate.leftPadding
- rightMargin: delegate.rightPadding
+ left: parent.left
+ right: parent.right
+
+ leftMargin: VLCStyle.margin_normal
+ rightMargin: listView.scrollBarWidth
}
Item {
+ id: artworkItem
Layout.preferredHeight: VLCStyle.icon_normal
Layout.preferredWidth: VLCStyle.icon_normal
+ Layout.alignment: Qt.AlignVCenter
DropShadow {
id: effect
@@ -243,17 +251,20 @@ Rectangle {
}
}
- Column {
+ ColumnLayout {
id: textInfoColumn
Layout.fillWidth: true
Layout.leftMargin: VLCStyle.margin_large
+ Layout.preferredHeight: artworkItem.height * 1.25
+ spacing: 0
Widgets.ListLabel {
id: textInfo
- width: parent.width
+ Layout.fillHeight: true
+ Layout.fillWidth: true
- font.weight: model.isCurrent ? Font.Bold : Font.Normal
+ font.weight: model.isCurrent ? Font.Bold : Font.DemiBold
text: model.title
color: colors.text
}
@@ -261,7 +272,8 @@ Rectangle {
Widgets.ListSubtitleLabel {
id: textArtist
- width: parent.width
+ Layout.fillHeight: true
+ Layout.fillWidth: true
font.weight: model.isCurrent ? Font.DemiBold : Font.Normal
text: (model.artist ? model.artist : i18n.qtr("Unknown Artist"))
@@ -277,26 +289,18 @@ Rectangle {
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
color: colors.text
-
- TextMetrics {
- id: durationMetric
- font.pixelSize: VLCStyle.fontSize_normal
- text: "-00:00-"
- }
+ opacity: 0.5
}
}
ColumnLayout {
- anchors.fill: parent
- // exceed bottom boundary by the height of item separator to prevent drop indicator bar visible glitch
- anchors.bottomMargin: -1
-
+ anchors.fill: content
spacing: 0
DropArea {
id: higherDropArea
Layout.fillWidth: true
- Layout.preferredHeight: parent.height / 2
+ Layout.fillHeight: true
onEntered: {
if (isDropAcceptable(drag, model.index))
diff --git a/modules/gui/qt/playlist/qml/PlaylistListView.qml b/modules/gui/qt/playlist/qml/PlaylistListView.qml
index 96c42fc8f3..8e2bf69974 100644
--- a/modules/gui/qt/playlist/qml/PlaylistListView.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistListView.qml
@@ -154,17 +154,27 @@ Widgets.NavigableFocusScope {
ColumnLayout {
anchors.fill: parent
+ anchors.topMargin: VLCStyle.margin_normal
anchors.bottomMargin: VLCStyle.margin_normal
+ anchors.leftMargin: root.leftPadding
+ anchors.rightMargin: root.rightPadding
+
+ spacing: 0
+
ColumnLayout {
id: headerTextLayout
+
Layout.fillWidth: true
- Layout.leftMargin: root.leftPadding + VLCStyle.margin_normal
- Layout.topMargin: VLCStyle.margin_normal
+ Layout.leftMargin: VLCStyle.margin_normal
+
+ spacing: VLCStyle.margin_xxxsmall
Widgets.SubtitleLabel {
text: i18n.qtr("Playqueue")
color: colors.text
+ font.weight: Font.Bold
+ font.pixelSize: VLCStyle.dp(24, VLCStyle.scale)
}
Widgets.CaptionLabel {
@@ -194,15 +204,17 @@ Widgets.NavigableFocusScope {
}
RowLayout {
- id: content
visible: model.count !== 0
Layout.topMargin: VLCStyle.margin_normal
- Layout.leftMargin: root.leftPadding + VLCStyle.margin_normal
- Layout.rightMargin: root.rightPadding + listView.scrollBarWidth
+ Layout.leftMargin: VLCStyle.margin_normal
+ Layout.rightMargin: listView.scrollBarWidth
+
+ spacing: 0
Widgets.IconLabel {
Layout.preferredWidth: VLCStyle.icon_normal
+
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: VLCIcons.album_cover
@@ -212,6 +224,7 @@ Widgets.NavigableFocusScope {
Widgets.CaptionLabel {
Layout.fillWidth: true
Layout.leftMargin: VLCStyle.margin_large
+
verticalAlignment: Text.AlignVCenter
text: i18n.qtr("Title")
color: colors.caption
@@ -640,12 +653,8 @@ Widgets.NavigableFocusScope {
PlaylistToolbar {
Layout.fillWidth: true
- leftPadding: root.leftPadding
- rightPadding: root.rightPadding
- navigationParent: root
- navigationUpItem: view
-
- colors: root.colors
+ Layout.leftMargin: root.leftPadding
+ Layout.rightMargin: root.rightPadding
}
}
}
More information about the vlc-commits
mailing list