[vlmc-devel] MediaItem: Rework Text items

Yikai Lu git at videolan.org
Sat Jun 24 12:49:51 CEST 2017


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Jun 25 04:46:00 2017 +0900| [c8fafd369217b105e71b899e05e04b739974e52d] | committer: Yikai Lu

MediaItem: Rework Text items

> https://code.videolan.org/videolan/vlmc/commit/c8fafd369217b105e71b899e05e04b739974e52d
---

 src/Gui/library/ui/MediaItem.qml | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/src/Gui/library/ui/MediaItem.qml b/src/Gui/library/ui/MediaItem.qml
index e393633a..d7b85afd 100644
--- a/src/Gui/library/ui/MediaItem.qml
+++ b/src/Gui/library/ui/MediaItem.qml
@@ -24,23 +24,27 @@ Rectangle {
         anchors.left: mediaItem.left
         anchors.right: mediaItem.right
         anchors.top: mediaItem.top
-        anchors.bottom: textColumn.top
         source: thumbnailPath.length > 0 ? "file://" + thumbnailPath : "qrc:///images/vlmc"
         fillMode: Image.PreserveAspectFit
     }
+
     Column {
         id: textColumn
+        anchors.top: thumbnail.bottom
         anchors.bottom: mediaItem.bottom
         width: mediaItem.width
+
         Text {
             id: mediaTitle
+            width: gridView.cellWidth
+            height: textColumn.height / 3 * 2
+            color: "#EEEEEE"
+            lineHeight: 0.8
             text: title
-            fontSizeMode: Text.HorizontalFit
-            minimumPixelSize: 4
-            width: mediaItem.width
+            wrapMode: Text.Wrap
             elide: Text.ElideRight
-            color: "#EEEEEE"
         }
+
         Text {
             function toDuration( seconds ) {
                 if ( seconds <= 0 )
@@ -55,9 +59,12 @@ Rectangle {
                 if (seconds < 10) {seconds = "0" + seconds;}
                 return hours + ':' + minutes + ':' + seconds;
             }
-            color: "#EEEEEE"
             id: durationLabel
+            color: "#EEEEEE"
             text: toDuration( duration / 1000 )
+            width: mediaItem.width
+            height: textColumn.height / 3
+            elide: Text.ElideRight
         }
     }
 



More information about the Vlmc-devel mailing list