[vlc-commits] qml: make MainDisplay playlist horizontally resizable
Fatih Uzunoglu
git at videolan.org
Fri Jul 3 14:59:20 CEST 2020
vlc | branch: master | Fatih Uzunoglu <fuzun54 at outlook.com> | Tue Jun 30 20:56:48 2020 +0300| [7a832962322d9ef79359d81a5df5f563de7d3553] | committer: Pierre Lamot
qml: make MainDisplay playlist horizontally resizable
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7a832962322d9ef79359d81a5df5f563de7d3553
---
modules/gui/qt/medialibrary/qml/MainDisplay.qml | 37 ++++++++++++++++++++++---
1 file changed, 33 insertions(+), 4 deletions(-)
diff --git a/modules/gui/qt/medialibrary/qml/MainDisplay.qml b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
index 66505cd4d8..6fcbef77b5 100644
--- a/modules/gui/qt/medialibrary/qml/MainDisplay.qml
+++ b/modules/gui/qt/medialibrary/qml/MainDisplay.qml
@@ -242,7 +242,6 @@ Widgets.NavigableFocusScope {
target: playlist;
properties: "width"
duration: 150
- from: root.width / 4
to: 0
onStopped: {
playlist.visible = false
@@ -266,7 +265,8 @@ Widgets.NavigableFocusScope {
stackView.forceActiveFocus()
}
- RectangularGlow {
+ Item
+ {
anchors {
top: parent.top
left: parent.left
@@ -274,8 +274,37 @@ Widgets.NavigableFocusScope {
}
width: VLCStyle.margin_xxsmall
- glowRadius: VLCStyle.dp(8)
- color: VLCStyle.colors.glowColor
+ RectangularGlow {
+ anchors.fill: parent
+
+ glowRadius: VLCStyle.dp(8)
+ color: VLCStyle.colors.glowColor
+ }
+
+ MouseArea {
+ id: dragArea
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ horizontalCenter: parent.horizontalCenter
+ }
+ width: VLCStyle.dp(8)
+ property var _initialPos : playlist.x
+ drag { target: parent; axis: Drag.XAxis }
+ onPositionChanged: {
+ if(drag.active){
+ var delta = mouseX - _initialPos
+ var newWidth = playlist.width - delta
+
+ if (newWidth < root.width / 2 && newWidth > root.width / 8)
+ playlist.width -= delta
+ }
+ }
+ onPressed: {
+ dragArea._initialPos = mouseX
+ }
+ cursorShape: Qt.SizeHorCursor
+ }
}
}
}
More information about the vlc-commits
mailing list