[vlc-commits] qml: remove shiftX mechanism
Pierre Lamot
git at videolan.org
Fri Sep 6 18:01:48 CEST 2019
vlc | branch: master | Pierre Lamot <pierre at videolabs.io> | Tue Aug 27 14:46:04 2019 +0200| [002697b5472768f27ca8ae5f86fc6d2b8233f0da] | committer: Jean-Baptiste Kempf
qml: remove shiftX mechanism
elements individual positionning will be handled within the
ExpandGridView directly
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=002697b5472768f27ca8ae5f86fc6d2b8233f0da
---
modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml | 4 +---
modules/gui/qt/qml/mediacenter/MCNetworksSection.qml | 3 ---
modules/gui/qt/qml/mediacenter/MusicAlbumsDisplay.qml | 1 -
modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml | 2 --
modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml | 1 -
modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml | 1 -
modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml | 2 --
modules/gui/qt/qml/utils/ExpandGridView.qml | 6 ------
modules/gui/qt/qml/utils/GridItem.qml | 2 --
modules/gui/qt/qml/utils/KeyNavigableGridView.qml | 6 ------
modules/gui/qt/qml/utils/KeyNavigableListView.qml | 3 ---
11 files changed, 1 insertion(+), 30 deletions(-)
diff --git a/modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml b/modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml
index 47568f365a..013e4f9f47 100644
--- a/modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MCNetworkDisplay.qml
@@ -148,9 +148,7 @@ Utils.NavigableFocusScope {
if(activeFocus)
favouritesSection.forceActiveFocus()
}
- function shiftX(index){
- return machineSection.shiftX(index)
- }
+
Rectangle{
id: allSections
color: VLCStyle.colors.bg
diff --git a/modules/gui/qt/qml/mediacenter/MCNetworksSection.qml b/modules/gui/qt/qml/mediacenter/MCNetworksSection.qml
index 8d255d6058..a175645faf 100644
--- a/modules/gui/qt/qml/mediacenter/MCNetworksSection.qml
+++ b/modules/gui/qt/qml/mediacenter/MCNetworksSection.qml
@@ -32,9 +32,6 @@ Rectangle {
signal actionDown(int index)
signal actionUp(int index)
- function shiftX(index){
- return sectionListView.shiftX(index)
- }
function adjustTopFlickableViewBound(){
const itemTop = networkSection.y + sectionListView.currentItem.y
diff --git a/modules/gui/qt/qml/mediacenter/MusicAlbumsDisplay.qml b/modules/gui/qt/qml/mediacenter/MusicAlbumsDisplay.qml
index 8152e4d68e..02ec94b496 100644
--- a/modules/gui/qt/qml/mediacenter/MusicAlbumsDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MusicAlbumsDisplay.qml
@@ -124,7 +124,6 @@ Utils.NavigableFocusScope {
inSelected: false
})
- shiftX: view.currentItem.shiftX(delegateModelItem.itemsIndex)
image: delegateModelItem.model.cover || VLCStyle.noArtAlbum
title: delegateModelItem.model.title || qsTr("Unknown title")
subtitle: delegateModelItem.model.main_artist || qsTr("Unknown artist")
diff --git a/modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml b/modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml
index 8e00e839f6..fdb783f479 100644
--- a/modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml
+++ b/modules/gui/qt/qml/mediacenter/MusicGenresDisplay.qml
@@ -50,8 +50,6 @@ Utils.NavigableFocusScope {
title: model.name || "Unknown genre"
selected: element.DelegateModel.inSelected
- shiftX: view.currentItem.shiftX(model.index)
-
onItemClicked: {
delegateModel.updateSelection( modifier , view.currentItem.currentIndex, index)
view.currentItem.currentIndex = index
diff --git a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
index 2c8d6701ca..7a0f64b4b1 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkDriveDisplayGrid.qml
@@ -50,7 +50,6 @@ Utils.GridItem {
title: model.name || qsTr("Unknown share")
focus: true
selected: parent.activeFocus && element.DelegateModel.inSelected
- shiftX: view.currentItem.shiftX(model.index)
onItemClicked : {
if (key == Qt.RightButton){
contextMenu.model = model
diff --git a/modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml b/modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml
index 2a03745833..f720bf5da3 100644
--- a/modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml
+++ b/modules/gui/qt/qml/mediacenter/NetworkFileDisplayGrid.qml
@@ -35,7 +35,6 @@ Utils.GridItem {
focus: true
selected: element.DelegateModel.inSelected
- shiftX: view.currentItem.shiftX(model.index)
onItemClicked : {
if (key == Qt.RightButton){
contextMenu.model = model
diff --git a/modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml b/modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml
index 1d7e4f61a4..ef76fee556 100644
--- a/modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml
+++ b/modules/gui/qt/qml/mediacenter/VideoExpandableGrid.qml
@@ -58,7 +58,6 @@ Utils.ExpandGridView {
isVideo: true
isNew: delegateModelItem.model.playcount < 1
progress: Math.max(0, delegateModelItem.model.saved_position)
- shiftX: expandableGV.isSingleRow ? 0 : expandableGV.shiftX(delegateModelItem.model.index)
pictureWidth: expandableGV.gridDelegatePictureWidth
pictureHeight: expandableGV.gridDelegatePictureHeight
@@ -81,7 +80,6 @@ Utils.ExpandGridView {
color: "transparent"
Rectangle{
id:arrowRect
- x: expandableGV.expanderItem.x + (expandableGV.expanderItem.shiftX/2) + (expandableGV.cellWidth/2)
y: -(width/2)
width: VLCStyle.icon_normal
height: VLCStyle.icon_normal
diff --git a/modules/gui/qt/qml/utils/ExpandGridView.qml b/modules/gui/qt/qml/utils/ExpandGridView.qml
index 1888f41a64..a346b32abd 100644
--- a/modules/gui/qt/qml/utils/ExpandGridView.qml
+++ b/modules/gui/qt/qml/utils/ExpandGridView.qml
@@ -62,12 +62,6 @@ NavigableFocusScope {
flickable.layout()
}
- function shiftX(index) {
- var colCount = flickable.getNbItemsPerRow()
- var rightSpace = width - colCount * root.cellWidth
- return ((index % colCount) + 1) * (rightSpace / (colCount + 1))
- }
-
function switchExpandItem(index,item) {
if (item)
root.expanderItem = item
diff --git a/modules/gui/qt/qml/utils/GridItem.qml b/modules/gui/qt/qml/utils/GridItem.qml
index 5e3039d59d..631eec08fe 100644
--- a/modules/gui/qt/qml/utils/GridItem.qml
+++ b/modules/gui/qt/qml/utils/GridItem.qml
@@ -33,7 +33,6 @@ Rectangle {
property string title: ""
property string subtitle: ""
property bool selected: false
- property int shiftX: 0
property bool noActionButtons: false
property bool showContextButton: isVideo
@@ -59,7 +58,6 @@ Rectangle {
Rectangle {
id: gridItem
- x: shiftX
width: childrenRect.width
height: childrenRect.height
color: "transparent"
diff --git a/modules/gui/qt/qml/utils/KeyNavigableGridView.qml b/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
index 4b1de3a52e..6fc8ac9d7e 100644
--- a/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
+++ b/modules/gui/qt/qml/utils/KeyNavigableGridView.qml
@@ -28,12 +28,6 @@ NavigableFocusScope {
signal selectAll()
signal actionAtIndex( int index )
- //compute a delta that can be applied to grid elements to obtain an horizontal distribution
- function shiftX( index ) {
- var rightSpace = width - (view._colCount * view.cellWidth)
- return ((index % view._colCount) + 1) * (rightSpace / (view._colCount + 1))
- }
-
//forward view properties
property alias interactive: view.interactive
property alias model: view.model
diff --git a/modules/gui/qt/qml/utils/KeyNavigableListView.qml b/modules/gui/qt/qml/utils/KeyNavigableListView.qml
index c3413ec2e7..f66485b0d7 100644
--- a/modules/gui/qt/qml/utils/KeyNavigableListView.qml
+++ b/modules/gui/qt/qml/utils/KeyNavigableListView.qml
@@ -29,9 +29,6 @@ NavigableFocusScope {
signal selectAll()
signal actionAtIndex( int index )
- //here to keep the same interface as GridView
- function shiftX( index ) { return 0 }
-
//forward view properties
property alias spacing: view.spacing
property alias interactive: view.interactive
More information about the vlc-commits
mailing list