From 330f7ad1f6ffced1ce1ac1dfc43d47d9d7e2bbbb Mon Sep 17 00:00:00 2001 From: Benjamin Arnaud <benjamin.arnaud@videolabs.io> Date: Mon, 7 Feb 2022 18:15:34 +0100 Subject: [PATCH] qml/controlbarcontrols: Create ReverseButton --- modules/gui/qt/Makefile.am | 1 + modules/gui/qt/player/control_list_model.hpp | 1 + .../qml/controlbarcontrols/ReverseButton.qml | 37 +++++++++++++++++++ modules/gui/qt/vlc.qrc | 1 + po/POTFILES.in | 1 + 5 files changed, 41 insertions(+) create mode 100644 modules/gui/qt/player/qml/controlbarcontrols/ReverseButton.qml diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am index df2d4e73d1c9..dc2b8776314f 100644 --- a/modules/gui/qt/Makefile.am +++ b/modules/gui/qt/Makefile.am @@ -844,6 +844,7 @@ libqt_plugin_la_QML = \ gui/qt/player/qml/controlbarcontrols/QuitButton.qml \ gui/qt/player/qml/controlbarcontrols/RandomButton.qml \ gui/qt/player/qml/controlbarcontrols/RecordButton.qml \ + gui/qt/player/qml/controlbarcontrols/ReverseButton.qml \ gui/qt/player/qml/controlbarcontrols/SkipBackButton.qml \ gui/qt/player/qml/controlbarcontrols/SkipForwardButton.qml \ gui/qt/player/qml/controlbarcontrols/SlowerButton.qml \ diff --git a/modules/gui/qt/player/control_list_model.hpp b/modules/gui/qt/player/control_list_model.hpp index b6c1a55059f9..c4c91b9f1f5a 100644 --- a/modules/gui/qt/player/control_list_model.hpp +++ b/modules/gui/qt/player/control_list_model.hpp @@ -72,6 +72,7 @@ public: TELETEXT_BUTTONS, ASPECT_RATIO_COMBOBOX, DVD_MENUS_BUTTON, + REVERSE_BUTTON, SPECIAL_MAX, WIDGET_SPACER = 0x40, diff --git a/modules/gui/qt/player/qml/controlbarcontrols/ReverseButton.qml b/modules/gui/qt/player/qml/controlbarcontrols/ReverseButton.qml new file mode 100644 index 000000000000..1207fc968d40 --- /dev/null +++ b/modules/gui/qt/player/qml/controlbarcontrols/ReverseButton.qml @@ -0,0 +1,37 @@ +/***************************************************************************** + * Copyright (C) 2022 VLC authors and VideoLAN + * + * Authors: Benjamin Arnaud <bunjee@omega.gg> + * + * 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 org.videolan.vlc 0.1 + +import "qrc:///widgets/" as Widgets +import "qrc:///style/" + +Widgets.IconControlButton { + size: VLCStyle.icon_medium + + enabled: Player.rewindable + + iconText: VLCIcons.play_reverse + text: I18n.qtr("Reverse") + + onClicked: Player.reverse() +} diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc index 722d97b49785..3795a987a629 100644 --- a/modules/gui/qt/vlc.qrc +++ b/modules/gui/qt/vlc.qrc @@ -381,6 +381,7 @@ <file alias="QuitButton.qml">player/qml/controlbarcontrols/QuitButton.qml</file> <file alias="RandomButton.qml">player/qml/controlbarcontrols/RandomButton.qml</file> <file alias="RecordButton.qml">player/qml/controlbarcontrols/RecordButton.qml</file> + <file alias="ReverseButton.qml">player/qml/controlbarcontrols/ReverseButton.qml</file> <file alias="SkipBackButton.qml">player/qml/controlbarcontrols/SkipBackButton.qml</file> <file alias="SkipForwardButton.qml">player/qml/controlbarcontrols/SkipForwardButton.qml</file> <file alias="SlowerButton.qml">player/qml/controlbarcontrols/SlowerButton.qml</file> diff --git a/po/POTFILES.in b/po/POTFILES.in index ceb6bf2cfc58..94bacc53e913 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -901,6 +901,7 @@ modules/gui/qt/player/qml/controlbarcontrols/PreviousButton.qml modules/gui/qt/player/qml/controlbarcontrols/QuitButton.qml modules/gui/qt/player/qml/controlbarcontrols/RandomButton.qml modules/gui/qt/player/qml/controlbarcontrols/RecordButton.qml +modules/gui/qt/player/qml/controlbarcontrols/ReverseButton.qml modules/gui/qt/player/qml/controlbarcontrols/SkipBackButton.qml modules/gui/qt/player/qml/controlbarcontrols/SkipForwardButton.qml modules/gui/qt/player/qml/controlbarcontrols/SlowerButton.qml -- GitLab