[vlc-commits] qml: Editor - Add hover highlight to EditorDND buttons
Rohan Rajpal
git at videolan.org
Wed Aug 21 16:27:11 CEST 2019
vlc | branch: master | Rohan Rajpal <rohan17089 at iiitd.ac.in> | Sun Aug 11 14:31:43 2019 +0530| [e4267e45357fc1e069e940ad7b721b43f4ce762d] | committer: Jean-Baptiste Kempf
qml: Editor - Add hover highlight to EditorDND buttons
Add a highlight color to easily identify which button is going
to be active when you start DND.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e4267e45357fc1e069e940ad7b721b43f4ce762d
---
modules/gui/qt/qml/dialogs/EditorDNDDelegate.qml | 2 ++
modules/gui/qt/qml/dialogs/EditorDNDView.qml | 4 ++++
modules/gui/qt/qml/dialogs/ToolbarEditor.qml | 2 ++
3 files changed, 8 insertions(+)
diff --git a/modules/gui/qt/qml/dialogs/EditorDNDDelegate.qml b/modules/gui/qt/qml/dialogs/EditorDNDDelegate.qml
index c157108a60..7aed669f3c 100644
--- a/modules/gui/qt/qml/dialogs/EditorDNDDelegate.qml
+++ b/modules/gui/qt/qml/dialogs/EditorDNDDelegate.qml
@@ -35,6 +35,7 @@ MouseArea {
drag.target: held ? content : undefined
width: buttonloader.width
height: VLCStyle.icon_medium
+ hoverEnabled: true
Rectangle {
z: 1
@@ -49,6 +50,7 @@ MouseArea {
color: VLCStyle.colors.accent
}
onPressed: held = true
+ onEntered: playerBtnDND.currentIndex = index
onExited: {
if(containsPress)
diff --git a/modules/gui/qt/qml/dialogs/EditorDNDView.qml b/modules/gui/qt/qml/dialogs/EditorDNDView.qml
index ed34f2fc16..e9c302d18d 100644
--- a/modules/gui/qt/qml/dialogs/EditorDNDView.qml
+++ b/modules/gui/qt/qml/dialogs/EditorDNDView.qml
@@ -89,6 +89,10 @@ ListView {
delegate: EditorDNDDelegate {
dndView: playerBtnDND
}
+ highlight: Rectangle{
+ anchors.verticalCenter: currentIndex > 0 ? parent.verticalCenter : undefined
+ color: VLCStyle.colors.bgHover
+ }
displaced: Transition {
NumberAnimation { properties: "x,y"; easing.type: Easing.OutQuad }
}
diff --git a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
index a05586a687..1e65f9fdce 100644
--- a/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
+++ b/modules/gui/qt/qml/dialogs/ToolbarEditor.qml
@@ -132,6 +132,8 @@ Rectangle{
Connections{
target: toolbareditor
onUpdatePlayerModel: {
+ playerBtnDND.currentIndex = -1
+ miniPlayerBtnDND.currentIndex = -1
if (toolbarName == "MainPlayerToolbar")
playerControlBarModel.reloadConfig(config)
else
More information about the vlc-commits
mailing list