Skip to content
Snippets Groups Projects
Commit b4bea5ce authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf
Browse files

qml: move the grid definition of the VideoExpandableGrid to MCVideoDisplay


most behaviours and customisations related to the gridview where defined
in MCVideoDisplay, and this makes the vide info panel an independant component
(renamed as VideoInfoExpandPanel)

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 01395e13
No related branches found
No related tags found
No related merge requests found
......@@ -642,7 +642,7 @@ libqt_plugin_la_QML = \
gui/qt/qml/mediacenter/MusicTrackListDisplay.qml \
gui/qt/qml/mediacenter/NetworkGridItem.qml \
gui/qt/qml/mediacenter/NetworkListItem.qml \
gui/qt/qml/mediacenter/VideoExpandableGrid.qml \
gui/qt/qml/mediacenter/VideoInfoExpandPanel.qml \
gui/qt/qml/mediacenter/VideoGridItem.qml \
gui/qt/qml/playlist/PlaylistListView.qml \
gui/qt/qml/playlist/PlaylistMainView.qml \
......
......@@ -106,7 +106,7 @@ Utils.NavigableFocusScope {
Component {
id: gridComponent
VideoExpandableGrid {
Utils.ExpandGridView {
id: videosGV
property Item currentItem: Item{}
......@@ -137,6 +137,21 @@ Utils.NavigableFocusScope {
}
}
expandDelegate: VideoInfoExpandPanel {
visible: !videosGV.isAnimating
height: implicitHeight
width: videosGV.width
onRetract: videosGV.retract()
notchPosition: videosGV.getItemPos(videosGV._expandIndex)[0] + (videosGV.cellWidth / 2)
navigationParent: videosGV
navigationCancel: function() { videosGV.retract() }
navigationUp: function() { videosGV.retract() }
navigationDown: function() { videosGV.retract() }
}
navigationParent: root
/*
......@@ -150,6 +165,12 @@ Utils.NavigableFocusScope {
}
}
cellWidth: (VLCStyle.video_normal_width)
cellHeight: (VLCStyle.video_normal_height) + VLCStyle.margin_xlarge + VLCStyle.margin_normal
onSelectAll: videosGV.model.selectAll()
onSelectionUpdated: videosGV.model.updateSelection( keyModifiers, oldIndex, newIndex )
onActionAtIndex: switchExpandItem( index )
}
}
......
......@@ -23,36 +23,24 @@ import QtQuick.Layouts 1.3
import org.videolan.medialib 0.1
import "qrc:///utils/" as Utils
import "qrc:///dialogs/" as DG
import "qrc:///style/"
Utils.ExpandGridView {
id: expandableGV
activeFocusOnTab:true
expandDelegate: Utils.NavigableFocusScope {
Utils.NavigableFocusScope {
id: expandRect
property int currentId: -1
property var model : ({})
property alias currentItemY: expandRect.y
property alias currentItemHeight: expandRect.height
height: implicitHeight
implicitHeight: arrowRect.implicitHeight
+ contentRect.implicitHeight
width: expandableGV.width
navigationParent: expandableGV
navigationCancel: function() { expandableGV.retract() }
navigationUp: function() { expandableGV.retract() }
navigationDown: function() { expandableGV.retract() }
implicitHeight: arrowRect.implicitHeight + contentRect.implicitHeight
property int notchPosition: 0
signal retract()
//arrow
Item {
id:arrowRect
y: -(width/2)
x: expandableGV.getItemPos(expandableGV._expandIndex)[0] + (expandableGV.cellWidth / 2) - (width/2)
visible: !expandableGV.isAnimating
x: notchPosition - (width/2)
clip: true
width: Math.sqrt(2) *VLCStyle.icon_normal
height: width/2
......@@ -77,7 +65,6 @@ Utils.ExpandGridView {
width: parent.width
clip: true
color: VLCStyle.colors.bgAlt
visible: !expandableGV.isAnimating
RowLayout {
id: contentLayout
......@@ -276,7 +263,7 @@ Utils.ExpandGridView {
color: VLCStyle.colors.lightText
focus: true
onClicked: expandableGV.retract()
onClicked: expandRect.retract()
}
Keys.priority: Keys.AfterItem
......@@ -287,13 +274,3 @@ Utils.ExpandGridView {
}
}
}
cellWidth: (VLCStyle.video_normal_width)
cellHeight: (VLCStyle.video_normal_height) + VLCStyle.margin_xlarge + VLCStyle.margin_normal
onSelectAll: expandableGV.model.selectAll()
onSelectionUpdated: expandableGV.model.updateSelection( keyModifiers, oldIndex, newIndex )
onActionAtIndex: switchExpandItem( index )
}
......@@ -224,7 +224,7 @@
<file alias="MCMainDisplay.qml">qml/mediacenter/MCMainDisplay.qml</file>
<file alias="NetworkGridItem.qml">qml/mediacenter/NetworkGridItem.qml</file>
<file alias="NetworkListItem.qml">qml/mediacenter/NetworkListItem.qml</file>
<file alias="VideoExpandableGrid.qml">qml/mediacenter/VideoExpandableGrid.qml</file>
<file alias="VideoInfoExpandPanel.qml">qml/mediacenter/VideoInfoExpandPanel.qml</file>
<file alias="MCVideoListDisplay.qml">qml/mediacenter/MCVideoListDisplay.qml</file>
<file alias="VideoGridItem.qml">qml/mediacenter/VideoGridItem.qml</file>
<file alias="AudioGridItem.qml">qml/mediacenter/AudioGridItem.qml</file>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment