[vlc-commits] qml: update EmptyLabel design

Prince Gupta git at videolan.org
Wed Jan 27 09:25:25 UTC 2021


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Thu Dec  3 16:12:12 2020 +0530| [45c4393108e1aa38adea0cd43374b6d7bcbe2e52] | committer: Pierre Lamot

qml: update EmptyLabel design

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=45c4393108e1aa38adea0cd43374b6d7bcbe2e52
---

 modules/gui/qt/medialibrary/qml/EmptyLabel.qml     | 64 ++++++++++++++++++----
 modules/gui/qt/medialibrary/qml/MusicAlbums.qml    |  1 +
 .../qt/medialibrary/qml/MusicArtistsDisplay.qml    |  1 +
 .../gui/qt/medialibrary/qml/MusicTracksDisplay.qml |  1 +
 modules/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)
     }
 }



More information about the vlc-commits mailing list