[vlc-commits] qml: add top left labels

Abel Tesfaye git at videolan.org
Tue Jul 30 17:57:11 CEST 2019


vlc | branch: master | Abel Tesfaye <Abeltesfaye45 at gmail.com> | Thu Jul 25 16:37:03 2019 +0300| [8ffe4fc2517dfa7cbb4fca165af3b649a473e68a] | committer: Jean-Baptiste Kempf

qml: add top left labels

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

 modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml |  2 +
 modules/gui/qt/qml/utils/GridItem.qml             | 52 +++++++++++++++++++++++
 2 files changed, 54 insertions(+)

diff --git a/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml b/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
index abf8807b3b..5c955a6063 100644
--- a/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MCVideoDisplay.qml
@@ -98,6 +98,8 @@ Utils.NavigableFocusScope {
                 selected: element.DelegateModel.inSelected
                 shiftX: view.currentItem.shiftX(model.index)
                 infoLeft: model.duration
+                resolution: model.resolution_name
+                channel: model.channel
                 isVideo: true
                 isNew: model.playcount < 1
                 progress: Math.max(model.saved_position,0)
diff --git a/modules/gui/qt/qml/utils/GridItem.qml b/modules/gui/qt/qml/utils/GridItem.qml
index 07c9dd7321..69098b6145 100644
--- a/modules/gui/qt/qml/utils/GridItem.qml
+++ b/modules/gui/qt/qml/utils/GridItem.qml
@@ -39,9 +39,11 @@ Rectangle {
 
     property alias sourceSize: cover.sourceSize
     property string infoLeft: ""
+    property string resolution: ""
     property bool isVideo: false
     property bool isNew: false
     property double progress: 0.5
+    property string channel: ""
 
     signal playClicked
     signal addToPlaylistClicked
@@ -251,6 +253,56 @@ Rectangle {
 
                             }
                         }
+
+                    Label {
+                        id: resolutionLabel
+                        visible: root.isVideo
+                        anchors {
+                            top:cover.top
+                            left:cover.left
+                            topMargin: VLCStyle.margin_xxsmall
+                            leftMargin: VLCStyle.margin_xxsmall
+                        }
+                        text: root.resolution
+                        color: "white"
+                        bottomPadding: VLCStyle.margin_xxxsmall
+                        topPadding: VLCStyle.margin_xxxsmall
+                        leftPadding: VLCStyle.margin_xxxsmall
+                        rightPadding: VLCStyle.margin_xxxsmall
+                        font.pixelSize: VLCStyle.fontSize_normal
+                        background: Rectangle {
+                            id: resolutionLabelRect
+                            anchors.fill: resolutionLabel
+                            color: "black"
+                            opacity: 0.5
+                            radius: 3
+                        }
+
+                    }
+                    Label {
+                        id: audioChannelLabel
+                        anchors {
+                            top:cover.top
+                            left:resolutionLabel.right
+                            topMargin: VLCStyle.margin_xxsmall
+                            leftMargin: VLCStyle.margin_xxxsmall
+                        }
+                        visible: channel.length > 0
+                        text: root.channel
+                        color: "limegreen"
+                        bottomPadding: VLCStyle.margin_xxxsmall
+                        topPadding: VLCStyle.margin_xxxsmall
+                        leftPadding: VLCStyle.margin_xxxsmall
+                        rightPadding: VLCStyle.margin_xxxsmall
+                        font.pixelSize: VLCStyle.fontSize_normal
+                        background: Rectangle {
+                            id: audioChannelLabelRect
+                            anchors.fill: audioChannelLabel
+                            color: "black"
+                            opacity: 0.5
+                            radius: 3
+                            }
+                        }
                         states: [
                             State {
                             name: "visiblebig"



More information about the vlc-commits mailing list