diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am index 838792cf03820e1d9996ae4e7052d5e40c0c3dde..9b31026ada845840b7b7b9e84ee6d69f69dd1cb1 100644 --- a/modules/gui/qt/Makefile.am +++ b/modules/gui/qt/Makefile.am @@ -738,6 +738,7 @@ libqt_plugin_la_QML = \ gui/qt/network/qml/NetworkListItem.qml \ gui/qt/network/qml/NetworkThumbnailItem.qml \ gui/qt/network/qml/ServicesHomeDisplay.qml \ + gui/qt/player/qml/qmldir \ gui/qt/player/qml/ControlBar.qml \ gui/qt/player/qml/ControlButtons.qml \ gui/qt/player/qml/LanguageMenu.qml \ diff --git a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml index 1aaa4e83d87960d5552c8d0eff0f28053e51e90f..5245a5465bf63e9f3fa39bb3cfd26234e2c122e5 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/EditorDNDDelegate.qml @@ -21,6 +21,7 @@ import QtQml.Models 2.11 import org.videolan.vlc 0.1 +import "qrc:///player/" import "qrc:///widgets/" as Widgets import "qrc:///style/" @@ -116,7 +117,7 @@ MouseArea { horizontalCenter: parent.horizontalCenter verticalCenter: parent.verticalCenter } - source: controlButtons.button(model.id).source + source: PlayerControlButtons.button(model.id).source onLoaded: { buttonloader.item.paintOnly = true buttonloader.item.enabled = false diff --git a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml index d7ece542949b4d08c9f04f8f48c84054a70c5c32..8658348c7b48228dde6b3b0ed5fc5e31e4a2e50e 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml @@ -22,7 +22,6 @@ import QtQml.Models 2.11 import org.videolan.vlc 0.1 -import "qrc:///player/" as Player import "qrc:///style/" import "qrc:///widgets/" as Widgets @@ -235,10 +234,6 @@ Rectangle{ } } - Player.ControlButtons{ - id: controlButtons - } - EditorDummyButton{ id: buttonDragItem visible: false diff --git a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml index 762edc7bbe52e365e32b443edfc7499bf8b3ec81..3c0833af5a2d75c69a38276557ed042cf983e146 100644 --- a/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml +++ b/modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorButtonList.qml @@ -22,6 +22,7 @@ import QtQuick.Layouts 1.11 import org.videolan.vlc 0.1 +import "qrc:///player/" import "qrc:///style/" import "qrc:///widgets/" as Widgets @@ -30,7 +31,7 @@ GridView{ clip: true ScrollBar.vertical: ScrollBar { policy: ScrollBar.AlwaysOn } - model: controlButtons.buttonList.length + model: PlayerControlButtons.buttonList.length highlightFollowsCurrentItem: false @@ -110,13 +111,13 @@ GridView{ height: cellHeight property bool held: false - property int mIndex: controlButtons.buttonList[model.index].id + property int mIndex: PlayerControlButtons.buttonList[model.index].id drag.target: held ? buttonDragItem : undefined cursorShape: Qt.OpenHandCursor onPressed: { buttonDragItem.visible = true - buttonDragItem.text = controlButtons.buttonList[model.index].label + buttonDragItem.text = PlayerControlButtons.buttonList[model.index].label buttonDragItem.Drag.source = dragArea held = true root._held = true @@ -154,7 +155,7 @@ GridView{ Layout.preferredWidth: VLCStyle.icon_medium Layout.preferredHeight: VLCStyle.icon_medium Layout.alignment: Qt.AlignHCenter - text: controlButtons.buttonList[model.index].label + text: PlayerControlButtons.buttonList[model.index].label } Widgets.ListSubtitleLabel { @@ -163,7 +164,7 @@ GridView{ Layout.fillHeight: true elide: Text.ElideNone - text: controlButtons.buttonList[model.index].text + text: PlayerControlButtons.buttonList[model.index].text wrapMode: Text.WordWrap horizontalAlignment: Text.AlignHCenter } diff --git a/modules/gui/qt/player/qml/ButtonsLayout.qml b/modules/gui/qt/player/qml/ButtonsLayout.qml index 1df730b3e5d462e1864507e379f015744f653f36..2ff09bb8cdf49bb761cb3c5ebb9c576932cdf629 100644 --- a/modules/gui/qt/player/qml/ButtonsLayout.qml +++ b/modules/gui/qt/player/qml/ButtonsLayout.qml @@ -97,7 +97,7 @@ FocusScope { delegate: Loader { id: buttonloader - source: controlmodelbuttons.button(model.id).source + source: PlayerControlButtons.button(model.id).source focus: (index === 0) diff --git a/modules/gui/qt/player/qml/ControlButtons.qml b/modules/gui/qt/player/qml/ControlButtons.qml index f707fc759e26478ef3dccf9cfac8e1efc75222b1..791edcc79cfe70eff37871f427e05ab7ff1178f7 100644 --- a/modules/gui/qt/player/qml/ControlButtons.qml +++ b/modules/gui/qt/player/qml/ControlButtons.qml @@ -16,6 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ +pragma Singleton + import QtQml 2.11 import org.videolan.vlc 0.1 diff --git a/modules/gui/qt/player/qml/PlayerButtonsLayout.qml b/modules/gui/qt/player/qml/PlayerButtonsLayout.qml index b308c52e01612953aa12846a397466e14cd07656..8ae09e65d9357f04072263149130a5cb01041847 100644 --- a/modules/gui/qt/player/qml/PlayerButtonsLayout.qml +++ b/modules/gui/qt/player/qml/PlayerButtonsLayout.qml @@ -51,10 +51,6 @@ FocusScope { console.assert(identifier >= 0) } - ControlButtons { - id: controlmodelbuttons - } - Loader { id: buttonrow_left diff --git a/modules/gui/qt/player/qml/qmldir b/modules/gui/qt/player/qml/qmldir new file mode 100644 index 0000000000000000000000000000000000000000..63ef3e4325efed97ae7d6c619998a06b90822c8c --- /dev/null +++ b/modules/gui/qt/player/qml/qmldir @@ -0,0 +1 @@ +singleton PlayerControlButtons 1.0 ControlButtons.qml diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc index 89396e885f87a5bae4634922ecbbb2f86cc7cff8..8f763a81fd64174720b4e9d84d396f42cb404b80 100644 --- a/modules/gui/qt/vlc.qrc +++ b/modules/gui/qt/vlc.qrc @@ -328,6 +328,7 @@ <file alias="GlobalShortcutsMedialib.qml">menus/qml/GlobalShortcutsMedialib.qml</file> </qresource> <qresource prefix="/player"> + <file alias="qmldir">player/qml/qmldir</file> <file alias="Player.qml">player/qml/Player.qml</file> <file alias="ControlBar.qml">player/qml/ControlBar.qml</file> <file alias="ResumeDialog.qml">player/qml/ResumeDialog.qml</file>