Commit c8fafd36 authored by luyikei's avatar luyikei

MediaItem: Rework Text items

parent 0d1b01ed
...@@ -24,23 +24,27 @@ Rectangle { ...@@ -24,23 +24,27 @@ Rectangle {
anchors.left: mediaItem.left anchors.left: mediaItem.left
anchors.right: mediaItem.right anchors.right: mediaItem.right
anchors.top: mediaItem.top anchors.top: mediaItem.top
anchors.bottom: textColumn.top
source: thumbnailPath.length > 0 ? "file://" + thumbnailPath : "qrc:///images/vlmc" source: thumbnailPath.length > 0 ? "file://" + thumbnailPath : "qrc:///images/vlmc"
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
} }
Column { Column {
id: textColumn id: textColumn
anchors.top: thumbnail.bottom
anchors.bottom: mediaItem.bottom anchors.bottom: mediaItem.bottom
width: mediaItem.width width: mediaItem.width
Text { Text {
id: mediaTitle id: mediaTitle
width: gridView.cellWidth
height: textColumn.height / 3 * 2
color: "#EEEEEE"
lineHeight: 0.8
text: title text: title
fontSizeMode: Text.HorizontalFit wrapMode: Text.Wrap
minimumPixelSize: 4
width: mediaItem.width
elide: Text.ElideRight elide: Text.ElideRight
color: "#EEEEEE"
} }
Text { Text {
function toDuration( seconds ) { function toDuration( seconds ) {
if ( seconds <= 0 ) if ( seconds <= 0 )
...@@ -55,9 +59,12 @@ Rectangle { ...@@ -55,9 +59,12 @@ Rectangle {
if (seconds < 10) {seconds = "0" + seconds;} if (seconds < 10) {seconds = "0" + seconds;}
return hours + ':' + minutes + ':' + seconds; return hours + ':' + minutes + ':' + seconds;
} }
color: "#EEEEEE"
id: durationLabel id: durationLabel
color: "#EEEEEE"
text: toDuration( duration / 1000 ) text: toDuration( duration / 1000 )
width: mediaItem.width
height: textColumn.height / 3
elide: Text.ElideRight
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment