[vlc-commits] qml: rename 'plitem' to 'delegate' in playlist
Fatih Uzunoglu
git at videolan.org
Tue Jan 12 13:20:32 UTC 2021
vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Fri Jan 8 00:36:34 2021 +0300| [56fb2a18e1a4c491c98c482d986829a9107eef19] | committer: Pierre Lamot
qml: rename 'plitem' to 'delegate' in playlist
Signed-off-by: Pierre Lamot <pierre at videolabs.io>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=56fb2a18e1a4c491c98c482d986829a9107eef19
---
modules/gui/qt/playlist/qml/PlaylistDelegate.qml | 20 ++++++++++----------
modules/gui/qt/playlist/qml/PlaylistListView.qml | 18 +++++++++---------
2 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/modules/gui/qt/playlist/qml/PlaylistDelegate.qml b/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
index 45480bb19f..385af4a8d6 100644
--- a/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistDelegate.qml
@@ -28,7 +28,7 @@ import "qrc:///style/"
Rectangle {
- id: plitem
+ id: delegate
// starts with an underscore to prevent the implicit delegate 'model' property
property var _model
@@ -63,7 +63,7 @@ Rectangle {
plInfoTooltip.timeout = 2000
else
plInfoTooltip.timeout = 0
- plInfoTooltip.visible = Qt.binding(function() { return ( (binding ? model.selected : plitem.hovered) && !overlayMenu.visible &&
+ plInfoTooltip.visible = Qt.binding(function() { return ( (binding ? model.selected : delegate.hovered) && !overlayMenu.visible &&
(textInfo.implicitWidth > textInfo.width || textArtist.implicitWidth > textArtist.width)); })
}
@@ -152,11 +152,11 @@ Rectangle {
acceptedButtons: acceptedButtons | Qt.RightButton
onClicked:{
- plitem.itemClicked(mouse.button, mouse.modifiers, this.mapToGlobal(mouse.x, mouse.y));
+ delegate.itemClicked(mouse.button, mouse.modifiers, this.mapToGlobal(mouse.x, mouse.y));
}
onDoubleClicked: {
if (mouse.button !== Qt.RightButton)
- plitem.itemDoubleClicked(mouse.buttons, mouse.modifiers, this.mapToGlobal(mouse.x, mouse.y));
+ delegate.itemDoubleClicked(mouse.buttons, mouse.modifiers, this.mapToGlobal(mouse.x, mouse.y));
}
drag.target: dragItem
@@ -169,7 +169,7 @@ Rectangle {
if (mouse.__rightButton)
return
if (target.active) {
- plitem.dragStarting()
+ delegate.dragStarting()
dragItem.model = _model
dragItem.count = _model.getSelection().length
dragItem.visible = true
@@ -202,8 +202,8 @@ Rectangle {
id: content
anchors {
fill: parent
- leftMargin: plitem.leftPadding
- rightMargin: plitem.rightPadding
+ leftMargin: delegate.leftPadding
+ rightMargin: delegate.rightPadding
}
Item {
@@ -309,7 +309,7 @@ Rectangle {
if (!isDropAcceptable(drop, model.index))
return
- plitem.dropedMovedAt(model.index, drop)
+ delegate.dropedMovedAt(model.index, drop)
root.setItemDropIndicatorVisible(model.index, false, true)
}
}
@@ -319,7 +319,7 @@ Rectangle {
Layout.fillWidth: true
Layout.fillHeight: true
- readonly property bool _isLastItem: model.index === plitem._model.count - 1
+ readonly property bool _isLastItem: model.index === delegate._model.count - 1
readonly property int _targetIndex: _isLastItem ? model.index + 1 : model.index
onEntered: {
@@ -335,7 +335,7 @@ Rectangle {
if(!isDropAcceptable(drop, _targetIndex))
return
- plitem.dropedMovedAt(_targetIndex, drop)
+ delegate.dropedMovedAt(_targetIndex, drop)
root.setItemDropIndicatorVisible(_targetIndex, false, !_isLastItem)
}
}
diff --git a/modules/gui/qt/playlist/qml/PlaylistListView.qml b/modules/gui/qt/playlist/qml/PlaylistListView.qml
index 6110e2e82e..1036bc657c 100644
--- a/modules/gui/qt/playlist/qml/PlaylistListView.qml
+++ b/modules/gui/qt/playlist/qml/PlaylistListView.qml
@@ -330,16 +330,16 @@ Widgets.NavigableFocusScope {
}
delegate: Item {
- implicitWidth: plitem.width
+ implicitWidth: delegate.width
implicitHeight: childrenRect.height
Loader {
- anchors.top: plitem.top
+ anchors.top: delegate.top
active: (index === 0) // load only for the first element to prevent overlapping
width: parent.width
height: 1
- z: (model.selected || plitem.hovered || plitem.activeFocus) ? 2 : 1
+ z: (model.selected || delegate.hovered || delegate.activeFocus) ? 2 : 1
sourceComponent: Rectangle {
color: colors.playlistSeparator
opacity: colors.isThemeDark ? 0.05 : 1.0
@@ -352,7 +352,7 @@ Widgets.NavigableFocusScope {
* - model: gives access to the values associated to PlaylistListModel roles
* - index: the index of this item in the list
*/
- id: plitem
+ id: delegate
_model: root.model
width: root.width
z: 1
@@ -402,16 +402,16 @@ Widgets.NavigableFocusScope {
}
onHoveredChanged: {
- var bottomItemIndex = listView.listView.indexAt(plitem.width / 2, (listView.listView.contentY + listView.height) - 2)
- var topItemIndex = listView.listView.indexAt(plitem.width / 2, listView.listView.contentY + 2)
+ var bottomItemIndex = listView.listView.indexAt(delegate.width / 2, (listView.listView.contentY + listView.height) - 2)
+ var topItemIndex = listView.listView.indexAt(delegate.width / 2, listView.listView.contentY + 2)
if(bottomItemIndex !== -1 && model.index >= bottomItemIndex - 1)
{
- listView.fadeRectBottomHovered = plitem.hovered
+ listView.fadeRectBottomHovered = delegate.hovered
}
if(topItemIndex !== -1 && model.index <= topItemIndex + 1)
{
- listView.fadeRectTopHovered = plitem.hovered
+ listView.fadeRectTopHovered = delegate.hovered
}
}
}
@@ -428,7 +428,7 @@ Widgets.NavigableFocusScope {
Rectangle {
id: bottomSeparator
- anchors.top: plitem.bottom
+ anchors.top: delegate.bottom
width: parent.width
height: 1
More information about the vlc-commits
mailing list