[vlc-devel] [RFC 65/82] qml: add common widgets with custom style

Pierre Lamot pierre at videolabs.io
Fri Feb 1 14:02:09 CET 2019


---
 modules/gui/qt/Makefile.am                   |   9 ++
 modules/gui/qt/qml/utils/ComboBoxExt.qml     | 119 ++++++++++++++++++
 modules/gui/qt/qml/utils/DNDLabel.qml        |  45 +++++++
 modules/gui/qt/qml/utils/IconToolButton.qml  |  66 ++++++++++
 modules/gui/qt/qml/utils/ImageToolButton.qml |  52 ++++++++
 modules/gui/qt/qml/utils/MenuExt.qml         |  64 ++++++++++
 modules/gui/qt/qml/utils/MenuItemExt.qml     | 125 +++++++++++++++++++
 modules/gui/qt/qml/utils/TextToolButton.qml  |  56 +++++++++
 modules/gui/qt/qml/utils/ToolTipArea.qml     |  38 ++++++
 modules/gui/qt/vlc.qrc                       |   8 ++
 10 files changed, 582 insertions(+)
 create mode 100644 modules/gui/qt/qml/utils/ComboBoxExt.qml
 create mode 100644 modules/gui/qt/qml/utils/DNDLabel.qml
 create mode 100644 modules/gui/qt/qml/utils/IconToolButton.qml
 create mode 100644 modules/gui/qt/qml/utils/ImageToolButton.qml
 create mode 100644 modules/gui/qt/qml/utils/MenuExt.qml
 create mode 100644 modules/gui/qt/qml/utils/MenuItemExt.qml
 create mode 100644 modules/gui/qt/qml/utils/TextToolButton.qml
 create mode 100644 modules/gui/qt/qml/utils/ToolTipArea.qml

diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am
index af84ec6dee..edce0db776 100644
--- a/modules/gui/qt/Makefile.am
+++ b/modules/gui/qt/Makefile.am
@@ -522,11 +522,20 @@ libqt_plugin_la_RES = \
 	gui/qt/pixmaps/valid.svg \
 	gui/qt/pixmaps/search_clear.svg \
 	gui/qt/pixmaps/lock.svg \
+	gui/qt/qml/utils/DNDLabel.qml \
+	gui/qt/qml/utils/ToolTipArea.qml \
+	gui/qt/qml/utils/ExpandGridView.qml \
+	gui/qt/qml/utils/IconToolButton.qml \
+	gui/qt/qml/utils/ImageToolButton.qml \
+	gui/qt/qml/utils/TextToolButton.qml \
+	gui/qt/qml/utils/MenuExt.qml \
+	gui/qt/qml/utils/MenuItemExt.qml \
 	gui/qt/qml/utils/NavigableFocusScope.qml \
 	gui/qt/qml/utils/KeyNavigableGridView.qml \
 	gui/qt/qml/utils/KeyNavigableListView.qml \
 	gui/qt/qml/utils/KeyNavigableTableView.qml \
 	gui/qt/qml/utils/SelectableDelegateModel.qml \
+	gui/qt/qml/utils/ComboBoxExt.qml \
 	gui/qt/qml/utils/StackViewExt.qml \
 	gui/qt/qml/style/qmldir \
 	gui/qt/qml/style/VLCIcons.qml \
diff --git a/modules/gui/qt/qml/utils/ComboBoxExt.qml b/modules/gui/qt/qml/utils/ComboBoxExt.qml
new file mode 100644
index 0000000000..6e2b037b13
--- /dev/null
+++ b/modules/gui/qt/qml/utils/ComboBoxExt.qml
@@ -0,0 +1,119 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+
+import "qrc:///style/"
+
+ComboBox {
+    id: control
+
+    font.pixelSize: VLCStyle.fontSize_normal
+
+    delegate: ItemDelegate {
+        width: control.width
+        leftPadding: control.leftPadding
+        background: Item {}
+        contentItem: Text {
+            text: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData
+            color: VLCStyle.colors.buttonText
+            font: control.font
+            elide: Text.ElideRight
+            verticalAlignment: Text.AlignVCenter
+        }
+        highlighted: control.highlightedIndex === index
+    }
+
+    indicator: Canvas {
+        id: canvas
+        x: control.width - width - control.rightPadding
+        y: control.topPadding + (control.availableHeight - height) / 2
+        width: 12
+        height: 8
+        contextType: "2d"
+
+        Connections {
+            target: control
+            onPressedChanged: canvas.requestPaint()
+        }
+
+        onPaint: {
+            context.reset();
+            context.moveTo(0, 0);
+            context.lineTo(width, 0);
+            context.lineTo(width / 2, height);
+            context.closePath();
+            context.fillStyle = control.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.buttonText;
+            context.fill();
+        }
+    }
+
+    contentItem: Text {
+        leftPadding: 0
+        rightPadding: control.indicator.width + control.spacing
+
+        text: control.displayText
+        font: control.font
+        color: VLCStyle.colors.buttonText
+        verticalAlignment: Text.AlignVCenter
+        elide: Text.ElideRight
+    }
+
+    background: Rectangle {
+        implicitWidth: 120
+        implicitHeight: 40
+        color: VLCStyle.colors.button
+        border.color: control.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.buttonBorder
+        border.width: control.activeFocus ? 2 : 1
+        radius: 2
+    }
+
+    popup: Popup {
+        y: control.height - 1
+        width: control.width
+        implicitHeight: contentItem.implicitHeight
+        padding: 1
+
+        contentItem: ListView {
+            clip: true
+            implicitHeight: contentHeight
+            model: control.popup.visible ? control.delegateModel : null
+            currentIndex: control.highlightedIndex
+
+            highlight: Rectangle {
+                color: VLCStyle.colors.accent
+            }
+
+            Rectangle {
+                z: 10
+                width: parent.width
+                height: parent.height
+                color: "transparent"
+                border.color: VLCStyle.colors.accent
+            }
+
+            ScrollIndicator.vertical: ScrollIndicator { }
+        }
+
+        background: Rectangle {
+            color: VLCStyle.colors.button
+            border.color: VLCStyle.colors.buttonBorder
+            radius: 2
+        }
+    }
+}
diff --git a/modules/gui/qt/qml/utils/DNDLabel.qml b/modules/gui/qt/qml/utils/DNDLabel.qml
new file mode 100644
index 0000000000..a59b37d4e5
--- /dev/null
+++ b/modules/gui/qt/qml/utils/DNDLabel.qml
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+import QtQuick 2.11
+import "qrc:///style/"
+
+Rectangle {
+    property alias text: label.text
+
+    z: 1
+    width:  label.implicitWidth
+    height: label.implicitHeight
+    color: VLCStyle.colors.button
+    border.color : VLCStyle.colors.buttonBorder
+    visible: false
+
+    Drag.active: visible
+
+    function updatePos(x, y) {
+        var pos = root.mapFromGlobal(x, y)
+        dragItem.x = pos.x + 10
+        dragItem.y = pos.y + 10
+    }
+
+    Text {
+        id: label
+        font.pixelSize: VLCStyle.fontSize_normal
+        color: VLCStyle.colors.text
+        text: qsTr("%1 tracks selected").arg(delegateModel.selectedGroup.count)
+    }
+}
diff --git a/modules/gui/qt/qml/utils/IconToolButton.qml b/modules/gui/qt/qml/utils/IconToolButton.qml
new file mode 100644
index 0000000000..7eed79de94
--- /dev/null
+++ b/modules/gui/qt/qml/utils/IconToolButton.qml
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+
+import "qrc:///style/"
+
+ToolButton {
+    id: control
+    property color color: control.checked
+                        ? (control.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.bgHover )
+                        : VLCStyle.colors.buttonText
+    property int size: VLCStyle.icon_normal
+
+    property color highlightColor: control.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.bgHover
+
+    contentItem: Label {
+        text: control.text
+        color: control.color
+
+        font.pixelSize: control.size
+        font.family: VLCIcons.fontFamily
+
+        verticalAlignment: Text.AlignVCenter
+        horizontalAlignment: Text.AlignHCenter
+
+        anchors {
+            centerIn: parent
+            //verticalCenter: parent.verticalCenter
+            //rightMargin: VLCStyle.margin_xsmall
+            //leftMargin: VLCStyle.margin_small
+        }
+
+        Rectangle {
+            anchors {
+                left: parent.left
+                right: parent.right
+                bottom: parent.bottom
+            }
+            height: 2
+            visible: control.activeFocus || control.checked
+            color: control.highlightColor
+        }
+    }
+
+    background: Rectangle {
+        implicitHeight: control.size
+        implicitWidth: control.size
+        color: "transparent"
+    }
+}
diff --git a/modules/gui/qt/qml/utils/ImageToolButton.qml b/modules/gui/qt/qml/utils/ImageToolButton.qml
new file mode 100644
index 0000000000..35322c80c0
--- /dev/null
+++ b/modules/gui/qt/qml/utils/ImageToolButton.qml
@@ -0,0 +1,52 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+
+import "qrc:///style/"
+
+/* button to choose the view displayed (list or grid) */
+ToolButton {
+    id: control
+
+    property url imageSource: undefined
+
+    contentItem:  Image {
+        source: control.imageSource
+        fillMode: Image.PreserveAspectFit
+        height: control.width
+        width: control.height
+        anchors.centerIn: control
+    }
+
+    background: Rectangle {
+        height: control.width
+        width: control.height
+        color: "transparent"
+        Rectangle {
+            anchors {
+                left: parent.left
+                right: parent.right
+                bottom: parent.bottom
+            }
+            height: 2
+            visible: control.activeFocus || control.checked
+            color: control.activeFocus ? VLCStyle.colors.accent  : VLCStyle.colors.bgHover
+        }
+    }
+}
diff --git a/modules/gui/qt/qml/utils/MenuExt.qml b/modules/gui/qt/qml/utils/MenuExt.qml
new file mode 100644
index 0000000000..aac6a49ed2
--- /dev/null
+++ b/modules/gui/qt/qml/utils/MenuExt.qml
@@ -0,0 +1,64 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+import QtQuick.Controls.impl 2.4
+import QtQuick.Templates 2.4 as T
+import QtQuick.Window 2.11
+
+import "qrc:///style/"
+
+T.Menu {
+    id: control
+
+    implicitWidth: Math.max(background ? background.implicitWidth : 0,
+                            contentItem ? contentItem.implicitWidth + leftPadding + rightPadding : 0)
+    implicitHeight: Math.max(background ? background.implicitHeight : 0,
+                             contentItem ? contentItem.implicitHeight : 0) + topPadding + bottomPadding
+
+    margins: 0
+    overlap: 1
+
+    delegate: MenuItemExt { }
+
+    contentItem: ListView {
+        implicitHeight: contentHeight
+        model: control.contentModel
+        interactive: Window.window ? contentHeight > Window.window.height : false
+        clip: true
+        currentIndex: control.currentIndex
+
+        ScrollIndicator.vertical: ScrollIndicator {}
+    }
+
+    background: Rectangle {
+        implicitWidth: 200
+        implicitHeight: 40
+        color: VLCStyle.colors.button
+        border.color: VLCStyle.colors.buttonBorder
+    }
+
+    T.Overlay.modal: Rectangle {
+        color: Color.transparent(VLCStyle.colors.buttonBorder, 0.5)
+    }
+
+    T.Overlay.modeless: Rectangle {
+        color: Color.transparent(VLCStyle.colors.buttonBorder, 0.12)
+    }
+}
diff --git a/modules/gui/qt/qml/utils/MenuItemExt.qml b/modules/gui/qt/qml/utils/MenuItemExt.qml
new file mode 100644
index 0000000000..834b2f5eae
--- /dev/null
+++ b/modules/gui/qt/qml/utils/MenuItemExt.qml
@@ -0,0 +1,125 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL3$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see http://www.qt.io/terms-conditions. For further
+** information use the contact form at http://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPLv3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or later as published by the Free
+** Software Foundation and appearing in the file LICENSE.GPL included in
+** the packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 2.0 requirements will be
+** met: http://www.gnu.org/licenses/gpl-2.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+import QtQuick.Controls.impl 2.4
+import QtQuick.Templates 2.4 as T
+
+import "qrc:///style/"
+
+T.MenuItem {
+    id: control
+
+    implicitWidth: Math.max(background ? background.implicitWidth : 0,
+                            contentItem.implicitWidth + leftPadding + rightPadding)
+    implicitHeight: Math.max(background ? background.implicitHeight : 0,
+                             Math.max(contentItem.implicitHeight,
+                                      indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding)
+    baselineOffset: contentItem.y + contentItem.baselineOffset
+
+    padding: 6
+    spacing: 6
+
+    icon.width: 24
+    icon.height: 24
+
+    contentItem: IconLabel {
+        readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0
+        readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0
+        leftPadding: !control.mirrored ? indicatorPadding : arrowPadding
+        rightPadding: control.mirrored ? indicatorPadding : arrowPadding
+
+        spacing: control.spacing
+        mirrored: control.mirrored
+        display: control.display
+        alignment: Qt.AlignLeft
+
+        icon: control.icon
+        text: control.text
+        font: control.font
+        color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textInactive
+    }
+
+    indicator: ColorImage {
+        x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
+        y: control.topPadding + (control.availableHeight - height) / 2
+
+        visible: control.checked
+        source: control.checkable ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/check.png" : ""
+        color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textInactive
+        defaultColor: "#353637"
+    }
+
+    arrow: ColorImage {
+        x: control.mirrored ? control.leftPadding : control.width - width - control.rightPadding
+        y: control.topPadding + (control.availableHeight - height) / 2
+
+        visible: control.subMenu
+        mirror: control.mirrored
+        source: control.subMenu ? "qrc:/qt-project.org/imports/QtQuick/Controls.2/images/arrow-indicator.png" : ""
+        color: control.enabled ? VLCStyle.colors.text : VLCStyle.colors.textInactive
+        defaultColor: "#353637"
+    }
+
+    background: Rectangle {
+        implicitWidth: 200
+        implicitHeight: 40
+        x: 1
+        y: 1
+        width: control.width - 2
+        height: control.height - 2
+        color: control.down ? VLCStyle.colors.bgHover : control.highlighted ? VLCStyle.colors.bgHover : "transparent"
+    }
+}
diff --git a/modules/gui/qt/qml/utils/TextToolButton.qml b/modules/gui/qt/qml/utils/TextToolButton.qml
new file mode 100644
index 0000000000..558baba334
--- /dev/null
+++ b/modules/gui/qt/qml/utils/TextToolButton.qml
@@ -0,0 +1,56 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+
+import "qrc:///style/"
+
+ToolButton {
+    id: control
+
+    font.pixelSize: VLCStyle.fontSize_normal
+
+    contentItem: Label {
+        text: control.text
+        font: control.font
+        color: VLCStyle.colors.text
+        verticalAlignment: Text.AlignVCenter
+        horizontalAlignment: Text.AlignHCenter
+
+        anchors {
+            verticalCenter: parent.verticalCenter
+            rightMargin: VLCStyle.margin_xsmall
+            leftMargin: VLCStyle.margin_small
+        }
+
+        Rectangle {
+            anchors {
+                left: parent.left
+                right: parent.right
+                bottom: parent.bottom
+            }
+            height: 2
+            visible: control.activeFocus || control.checked
+            color: control.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.bgHover
+        }
+    }
+
+    background: Rectangle {
+        color: "transparent"
+    }
+}
diff --git a/modules/gui/qt/qml/utils/ToolTipArea.qml b/modules/gui/qt/qml/utils/ToolTipArea.qml
new file mode 100644
index 0000000000..1731968a19
--- /dev/null
+++ b/modules/gui/qt/qml/utils/ToolTipArea.qml
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (C) 2019 VLC authors and VideoLAN
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * ( at your option ) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+import QtQuick 2.11
+import QtQuick.Controls 2.4
+import "qrc:///style/"
+
+MouseArea {
+    property alias text: tip.text
+    property alias delay: tip.delay
+    property bool activated: true
+
+    anchors.fill: parent
+
+    hoverEnabled: true
+    propagateComposedEvents: true
+
+    ToolTip {
+        id: tip
+        text: "plop"
+        delay: VLCStyle.delayToolTipAppear
+        visible: activated && parent.containsMouse
+    }
+}
diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc
index 914c0d49bf..d83148de8e 100644
--- a/modules/gui/qt/vlc.qrc
+++ b/modules/gui/qt/vlc.qrc
@@ -162,9 +162,17 @@
         <file alias="SelectableDelegateModel.qml">qml/utils/SelectableDelegateModel.qml</file>
         <file alias="KeyNavigableGridView.qml">qml/utils/KeyNavigableGridView.qml</file>
         <file alias="KeyNavigableListView.qml">qml/utils/KeyNavigableListView.qml</file>
+        <file alias="ToolTipArea.qml">qml/utils/ToolTipArea.qml</file>
+        <file alias="DNDLabel.qml">qml/utils/DNDLabel.qml</file>
         <file alias="KeyNavigableTableView.qml">qml/utils/KeyNavigableTableView.qml</file>
         <file alias="NavigableFocusScope.qml">qml/utils/NavigableFocusScope.qml</file>
+        <file alias="ImageToolButton.qml">qml/utils/ImageToolButton.qml</file>
+        <file alias="TextToolButton.qml">qml/utils/TextToolButton.qml</file>
+        <file alias="IconToolButton.qml">qml/utils/IconToolButton.qml</file>
         <file alias="StackViewExt.qml">qml/utils/StackViewExt.qml</file>
+        <file alias="ComboBoxExt.qml">qml/utils/ComboBoxExt.qml</file>
+        <file alias="MenuExt.qml">qml/utils/MenuExt.qml</file>
+        <file alias="MenuItemExt.qml">qml/utils/MenuItemExt.qml</file>
     </qresource>
     <qresource prefix="/style">
         <file alias="qmldir">qml/style/qmldir</file>
-- 
2.19.1



More information about the vlc-devel mailing list