[vlc-devel] [PATCH 2/5] qml: update EmptyLabel design

Prince Gupta guptaprince8832 at gmail.com
Fri Jan 22 16:03:15 UTC 2021


---
 .../gui/qt/medialibrary/qml/EmptyLabel.qml    | 64 +++++++++++++++----
 .../gui/qt/medialibrary/qml/MusicAlbums.qml   |  1 +
 .../medialibrary/qml/MusicArtistsDisplay.qml  |  1 +
 .../medialibrary/qml/MusicTracksDisplay.qml   |  1 +
 .../gui/qt/medialibrary/qml/VideoDisplay.qml  |  3 +
 5 files changed, 59 insertions(+), 11 deletions(-)

diff --git a/modules/gui/qt/medialibrary/qml/EmptyLabel.qml b/modules/gui/qt/medialibrary/qml/EmptyLabel.qml
index 156168eac4..b76e053e86 100644
--- a/modules/gui/qt/medialibrary/qml/EmptyLabel.qml
+++ b/modules/gui/qt/medialibrary/qml/EmptyLabel.qml
@@ -25,20 +25,62 @@ import "qrc:///widgets/" as Widgets
 import "qrc:///util/KeyHelper.js" as KeyHelper
 
 Widgets.NavigableFocusScope {
+    id: root
+
     property alias text: label.text
+    property alias showBrowseButton: browseButton.visible
+    property alias cover: cover.source
+    property alias coverWidth: coverContainer.width
+    property alias coverHeight: coverContainer.height
+
+    Column {
+        anchors.verticalCenter: parent.verticalCenter
+        width: root.width
+        spacing: VLCStyle.margin_large
+
+        Item {
+            id: coverContainer
+
+            anchors.horizontalCenter: parent.horizontalCenter
+            width: VLCStyle.colWidth(1)
+            height: VLCStyle.colWidth(1)
+
+            Image {
+                id: cover
+
+                asynchronous: true
+                anchors.fill: parent
+                fillMode: Image.PreserveAspectFit
+            }
+
+            Widgets.ListCoverShadow {
+                anchors.fill: cover
+                source: cover
+            }
+        }
+
+        Label {
+            id: label
+
+            width: parent.width
+            horizontalAlignment: Text.AlignHCenter
+            verticalAlignment: Text.AlignVCenter
+            font.pixelSize: VLCStyle.fontSize_xxlarge
+            font.weight: Font.DemiBold
+            color:  VLCStyle.colors.text
+            wrapMode: Text.WordWrap
+            focus: false
+        }
+
+        Widgets.TabButtonExt {
+            id: browseButton
 
-    Label {
-        id: label
-        anchors.fill: parent
-        horizontalAlignment: Text.AlignHCenter
-        verticalAlignment: Text.AlignVCenter
-        font.pixelSize: VLCStyle.fontSize_xxxlarge
-        color: root.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.text
-        wrapMode: Text.WordWrap
-
-        MouseArea {
-            anchors.fill: parent
+            text: i18n.qtr("Browse")
+            focus: true
+            iconTxt: VLCIcons.topbar_network
+            anchors.horizontalCenter: parent.horizontalCenter
             onClicked: history.push(["mc", "network"])
+            width: VLCStyle.dp(84, VLCStyle.scale)
         }
     }
 
diff --git a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
index 07f6d71277..ff950c33cd 100644
--- a/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicAlbums.qml
@@ -285,5 +285,6 @@ Widgets.NavigableFocusScope {
         focus: visible
         text: i18n.qtr("No albums found\nPlease try adding sources, by going to the Network tab")
         navigationParent: root
+        cover: VLCStyle.noArtAlbumCover
     }
 }
diff --git a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
index e4ee054fea..a0635b3a91 100644
--- a/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicArtistsDisplay.qml
@@ -257,6 +257,7 @@ Widgets.PageLoader {
                 visible: artistModel.count === 0
                 text: i18n.qtr("No artists found\nPlease try adding sources, by going to the Network tab")
                 navigationParent: root
+                cover: VLCStyle.noArtArtistCover
             }
         }
     }
diff --git a/modules/gui/qt/medialibrary/qml/MusicTracksDisplay.qml b/modules/gui/qt/medialibrary/qml/MusicTracksDisplay.qml
index ed395dba00..cf2320abdd 100644
--- a/modules/gui/qt/medialibrary/qml/MusicTracksDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MusicTracksDisplay.qml
@@ -75,5 +75,6 @@ Widgets.NavigableFocusScope {
         focus: visible
         text: i18n.qtr("No tracks found\nPlease try adding sources, by going to the Network tab")
         navigationParent: root
+        cover: VLCStyle.noArtAlbumCover
     }
 }
diff --git a/modules/gui/qt/medialibrary/qml/VideoDisplay.qml b/modules/gui/qt/medialibrary/qml/VideoDisplay.qml
index 391f370ecf..77ca86efb1 100644
--- a/modules/gui/qt/medialibrary/qml/VideoDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/VideoDisplay.qml
@@ -286,5 +286,8 @@ Widgets.NavigableFocusScope {
         focus: visible
         text: i18n.qtr("No video found\nPlease try adding sources, by going to the Network tab")
         navigationParent: root
+        cover: VLCStyle.noArtVideoCover
+        coverWidth: VLCStyle.dp(182, VLCStyle.scale)
+        coverHeight: VLCStyle.dp(114, VLCStyle.scale)
     }
 }
-- 
2.25.1



More information about the vlc-devel mailing list