[vlc-devel] [PATCH 11/14] qml: add new indicator for GridItem
Prince Gupta
guptaprince8832 at gmail.com
Thu Jul 2 14:23:20 CEST 2020
---
.../gui/qt/medialibrary/qml/VideoGridItem.qml | 1 +
modules/gui/qt/widgets/qml/GridItem.qml | 23 ++++++++++++++++++-
2 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/modules/gui/qt/medialibrary/qml/VideoGridItem.qml b/modules/gui/qt/medialibrary/qml/VideoGridItem.qml
index 9e374ab4e8..1d8ef2ef12 100644
--- a/modules/gui/qt/medialibrary/qml/VideoGridItem.qml
+++ b/modules/gui/qt/medialibrary/qml/VideoGridItem.qml
@@ -36,6 +36,7 @@ Widgets.GridItem {
pictureHeight: VLCStyle.gridCover_video_height
playCoverBorder.width: VLCStyle.gridCover_video_border
titleMargin: VLCStyle.margin_xxsmall
+ showNewIndicator: true
onItemDoubleClicked: {
if ( model.id !== undefined ) {
medialib.addAndPlay( model.id )
diff --git a/modules/gui/qt/widgets/qml/GridItem.qml b/modules/gui/qt/widgets/qml/GridItem.qml
index 9f1b95c7d7..fb8d82a42e 100644
--- a/modules/gui/qt/widgets/qml/GridItem.qml
+++ b/modules/gui/qt/widgets/qml/GridItem.qml
@@ -37,6 +37,7 @@ Item {
property alias progress: picture.progress
property alias labels: picture.labels
+ property bool showNewIndicator: false
property real pictureWidth: VLCStyle.colWidth(1)
property real pictureHeight: pictureWidth
property int titleMargin: VLCStyle.margin_xsmall
@@ -64,6 +65,8 @@ Item {
property alias _secondaryShadowVerticalOffset: secondaryShadow.verticalOffset
property alias _secondaryShadowRadius: secondaryShadow.radius
+ property int _newIndicatorMedian: VLCStyle.margin_xsmall
+
states: [
State {
name: "unselected"
@@ -74,6 +77,7 @@ Item {
_primaryShadowRadius: VLCStyle.dp(14, VLCStyle.scale)
_secondaryShadowVerticalOffset: VLCStyle.dp(1, VLCStyle.scale)
_secondaryShadowRadius: VLCStyle.dp(3, VLCStyle.scale)
+ _newIndicatorMedian: VLCStyle.margin_xsmall
}
},
State {
@@ -85,6 +89,7 @@ Item {
_primaryShadowRadius: VLCStyle.dp(72, VLCStyle.scale)
_secondaryShadowVerticalOffset: VLCStyle.dp(6, VLCStyle.scale)
_secondaryShadowRadius: VLCStyle.dp(8, VLCStyle.scale)
+ _newIndicatorMedian: VLCStyle.margin_small
}
}
]
@@ -93,7 +98,7 @@ Item {
to: "*"
SmoothedAnimation {
duration: 64
- properties: "_primaryShadowVerticalOffset,_primaryShadowRadius,_secondaryShadowVerticalOffset,_secondaryShadowRadius"
+ properties: "_primaryShadowVerticalOffset,_primaryShadowRadius,_secondaryShadowVerticalOffset,_secondaryShadowRadius,_newIndicatorMedian"
}
}
@@ -192,6 +197,22 @@ Item {
Layout.preferredWidth: pictureWidth
Layout.preferredHeight: pictureHeight
+
+ /* new indicator (triangle at top-left of cover)*/
+ Rectangle {
+ id: newIndicator
+
+ // consider this Rectangle as a triangle, then following property is its median length
+ property alias median: root._newIndicatorMedian
+
+ x: parent.width - median
+ y: - median
+ width: 2 * median
+ height: 2 * median
+ color: VLCStyle.colors.accent
+ rotation: 45
+ visible: root.showNewIndicator && root.progress === 0
+ }
}
Widgets.ScrollingText {
--
2.25.1
More information about the vlc-devel
mailing list