[vlc-commits] [Git][videolan/vlc][master] 4 commits: qt: add icons for navigation buttons

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sun Jan 7 15:52:37 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
e005aa36 by Mohit Marathe at 2024-01-07T15:24:40+00:00
qt: add icons for navigation buttons

Signed-off-by: Mohit Marathe <mohitmarathe23 at gmail.com>

- - - - -
dadc66e3 by Mohit Marathe at 2024-01-07T15:24:40+00:00
qt: add NavigationBoxButton to controlbarcontrols

Signed-off-by: Mohit Marathe <mohitmarathe23 at gmail.com>

- - - - -
7fcebcf9 by Mohit Marathe at 2024-01-07T15:24:40+00:00
qt: add functions to navigate interactive menu

Signed-off-by: Mohit Marathe <mohitmarathe23 at gmail.com>

- - - - -
33330313 by Mohit Marathe at 2024-01-07T15:24:40+00:00
qt: add NavigationBox widget to player

Signed-off-by: Mohit Marathe <mohitmarathe23 at gmail.com>

- - - - -


22 changed files:

- modules/gui/qt/Makefile.am
- modules/gui/qt/maininterface/mainctx.hpp
- modules/gui/qt/pixmaps/VLCIcons.json
- modules/gui/qt/pixmaps/VLCIcons.ttf
- + modules/gui/qt/pixmaps/icons/ic_fluent_arrow_move.svg
- + modules/gui/qt/pixmaps/icons/ic_fluent_chevron_down_24.svg
- + modules/gui/qt/pixmaps/icons/ic_fluent_chevron_left_24.svg
- + modules/gui/qt/pixmaps/icons/ic_fluent_chevron_right_24.svg
- + modules/gui/qt/pixmaps/icons/ic_fluent_chevron_up_24.svg
- + modules/gui/qt/pixmaps/icons/ok.svg
- modules/gui/qt/player/control_list_filter.cpp
- modules/gui/qt/player/control_list_model.hpp
- modules/gui/qt/player/player_controller.cpp
- modules/gui/qt/player/player_controller.hpp
- modules/gui/qt/player/qml/ControlbarControls.qml
- + modules/gui/qt/player/qml/NavigationBox.qml
- modules/gui/qt/player/qml/Player.qml
- + modules/gui/qt/player/qml/controlbarcontrols/NavigationBoxButton.qml
- modules/gui/qt/style/VLCIcons.qml
- modules/gui/qt/style/VLCStyle.qml
- modules/gui/qt/vlc.qrc
- po/POTFILES.in


Changes:

=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -683,6 +683,7 @@ libqt_plugin_la_RES = \
 	pixmaps/icons/ic_fluent_apps_list.svg \
 	pixmaps/icons/ic_fluent_more_vertical.svg \
 	pixmaps/icons/multiselect.svg \
+	pixmaps/icons/ok.svg \
 	pixmaps/icons/ic_fluent_next.svg \
 	pixmaps/icons/ic_pause_filled.svg \
 	pixmaps/icons/pip.svg \
@@ -690,6 +691,11 @@ libqt_plugin_la_RES = \
 	pixmaps/icons/ic_playlist.svg \
 	pixmaps/icons/ic_fluent_play.svg \
 	pixmaps/icons/play_reverse.svg \
+	pixmaps/icons/ic_fluent_arrow_move.svg \
+	pixmaps/icons/ic_fluent_chevron_down_24.svg \
+	pixmaps/icons/ic_fluent_chevron_left_24.svg \
+	pixmaps/icons/ic_fluent_chevron_right_24.svg \
+	pixmaps/icons/ic_fluent_chevron_up_24.svg \
 	pixmaps/icons/ic_fluent_play_filled.svg \
 	pixmaps/icons/podcast.svg \
 	pixmaps/icons/ic_fluent_previous.svg \
@@ -936,6 +942,7 @@ libqt_plugin_la_QML = \
 	player/qml/TracksListPage.qml \
 	player/qml/ControlLayout.qml \
 	player/qml/ControlRepeater.qml \
+	player/qml/NavigationBox.qml \
 	player/qml/controlbarcontrols/HighResolutionTimeWidget.qml \
 	player/qml/controlbarcontrols/ArtworkInfoWidget.qml \
 	player/qml/controlbarcontrols/AspectRatioWidget.qml \
@@ -954,6 +961,7 @@ libqt_plugin_la_QML = \
 	player/qml/controlbarcontrols/LangButton.qml \
 	player/qml/controlbarcontrols/LoopButton.qml \
 	player/qml/controlbarcontrols/MenuButton.qml \
+	player/qml/controlbarcontrols/NavigationBoxButton.qml \
 	player/qml/controlbarcontrols/NavigationWidget.qml \
 	player/qml/controlbarcontrols/NextButton.qml \
 	player/qml/controlbarcontrols/OpenButton.qml \


=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -432,6 +432,8 @@ signals:
 
     void safeAreaChanged();
 
+    void navBoxToggled();
+
     void windowSuportExtendedFrameChanged();
     void windowExtendedMarginChanged(unsigned margin);
 


=====================================
modules/gui/qt/pixmaps/VLCIcons.json
=====================================
@@ -39,9 +39,15 @@
         {"key":"list", "path": "./icons/ic_fluent_apps_list.svg"},
         {"key":"more", "path": "./icons/ic_fluent_more_vertical.svg"},
         {"key":"next", "path": "./icons/ic_fluent_next.svg"},
+        {"key": "ok", "path": "./icons/ok.svg"},
         {"key":"pause_filled", "path": "./icons/ic_pause_filled.svg"},
         {"key":"play_filled", "path": "./icons/ic_fluent_play_filled.svg"},
         {"key":"play", "path": "./icons/ic_fluent_play.svg"},
+        {"key":"ic_fluent_arrow_move", "path": "./icons/ic_fluent_arrow_move.svg"},
+        {"key":"ic_fluent_chevron_down_24", "path": "./icons/ic_fluent_chevron_down_24.svg"},
+        {"key":"ic_fluent_chevron_left_24", "path": "./icons/ic_fluent_chevron_left_24.svg"},
+        {"key":"ic_fluent_chevron_right_24", "path": "./icons/ic_fluent_chevron_right_24.svg"},
+        {"key":"ic_fluent_chevron_up_24", "path": "./icons/ic_fluent_chevron_up_24.svg"},
         {"key":"play_reverse", "path": "./icons/play_reverse.svg"},
         {"key":"playlist", "path": "./icons/ic_playlist.svg"},
         {"key":"playlist_clear", "path": "./icons/ic_playlist_clear.svg"},


=====================================
modules/gui/qt/pixmaps/VLCIcons.ttf
=====================================
Binary files a/modules/gui/qt/pixmaps/VLCIcons.ttf and b/modules/gui/qt/pixmaps/VLCIcons.ttf differ


=====================================
modules/gui/qt/pixmaps/icons/ic_fluent_arrow_move.svg
=====================================
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M15.2803 6.03033C14.9874 6.32322 14.5126 6.32322 14.2197 6.03033L12.75 4.56066L12.75 8.25C12.75 8.66421 12.4142 9 12 9C11.5858 9 11.25 8.66421 11.25 8.25L11.25 4.56066L9.78033 6.03033C9.48744 6.32322 9.01256 6.32322 8.71967 6.03033C8.42678 5.73744 8.42678 5.26256 8.71967 4.96967L11.4697 2.21967C11.6103 2.07902 11.8011 2 12 2C12.1989 2 12.3897 2.07902 12.5303 2.21967L15.2803 4.96967C15.5732 5.26256 15.5732 5.73744 15.2803 6.03033ZM6.03033 14.2197C6.32322 14.5126 6.32322 14.9874 6.03033 15.2803C5.73744 15.5732 5.26256 15.5732 4.96967 15.2803L2.21967 12.5303C2.07902 12.3897 2 12.1989 2 12C2 11.8011 2.07902 11.6103 2.21967 11.4697L4.96967 8.71967C5.26256 8.42678 5.73744 8.42678 6.03033 8.71967C6.32322 9.01256 6.32322 9.48744 6.03033 9.78033L4.56066 11.25H8.25C8.66421 11.25 9 11.5858 9 12C9 12.4142 8.66421 12.75 8.25 12.75H4.56066L6.03033 14.2197ZM17.9697 15.2803C17.6768 14.9874 17.6768 14.5126 17.9697 14.2197L19.4393 12.75H15.75C15.3358 12.75 15 12.4142 15 12C15 11.5858 15.3358 11.25 15.75 11.25H19.4393L17.9697 9.78033C17.6768 9.48744 17.6768 9.01256 17.9697 8.71967C18.2626 8.42678 18.7374 8.42678 19.0303 8.71967L21.7803 11.4697C21.921 11.6103 22 11.8011 22 12C22 12.1989 21.921 12.3897 21.7803 12.5303L19.0303 15.2803C18.7374 15.5732 18.2626 15.5732 17.9697 15.2803ZM15.2803 17.9697C14.9874 17.6768 14.5126 17.6768 14.2197 17.9697L12.75 19.4393L12.75 15.75C12.75 15.3358 12.4142 15 12 15C11.5858 15 11.25 15.3358 11.25 15.75L11.25 19.4393L9.78033 17.9697C9.48744 17.6768 9.01256 17.6768 8.71967 17.9697C8.42678 18.2626 8.42678 18.7374 8.71967 19.0303L11.4697 21.7803C11.6103 21.921 11.8011 22 12 22C12.1989 22 12.3897 21.921 12.5303 21.7803L15.2803 19.0303C15.5732 18.7374 15.5732 18.2626 15.2803 17.9697Z" fill="#212121"/>
+</svg>


=====================================
modules/gui/qt/pixmaps/icons/ic_fluent_chevron_down_24.svg
=====================================
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M4.21967 8.46967C4.51256 8.17678 4.98744 8.17678 5.28033 8.46967L12 15.1893L18.7197 8.46967C19.0126 8.17678 19.4874 8.17678 19.7803 8.46967C20.0732 8.76256 20.0732 9.23744 19.7803 9.53033L12.5303 16.7803C12.2374 17.0732 11.7626 17.0732 11.4697 16.7803L4.21967 9.53033C3.92678 9.23744 3.92678 8.76256 4.21967 8.46967Z" fill="#212121"/>
+</svg>


=====================================
modules/gui/qt/pixmaps/icons/ic_fluent_chevron_left_24.svg
=====================================
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M15.5303 4.21967C15.8232 4.51256 15.8232 4.98744 15.5303 5.28033L8.81066 12L15.5303 18.7197C15.8232 19.0126 15.8232 19.4874 15.5303 19.7803C15.2374 20.0732 14.7626 20.0732 14.4697 19.7803L7.21967 12.5303C6.92678 12.2374 6.92678 11.7626 7.21967 11.4697L14.4697 4.21967C14.7626 3.92678 15.2374 3.92678 15.5303 4.21967Z" fill="#212121"/>
+</svg>


=====================================
modules/gui/qt/pixmaps/icons/ic_fluent_chevron_right_24.svg
=====================================
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M8.46967 4.21967C8.17678 4.51256 8.17678 4.98744 8.46967 5.28033L15.1893 12L8.46967 18.7197C8.17678 19.0126 8.17678 19.4874 8.46967 19.7803C8.76256 20.0732 9.23744 20.0732 9.53033 19.7803L16.7803 12.5303C17.0732 12.2374 17.0732 11.7626 16.7803 11.4697L9.53033 4.21967C9.23744 3.92678 8.76256 3.92678 8.46967 4.21967Z" fill="#212121"/>
+</svg>


=====================================
modules/gui/qt/pixmaps/icons/ic_fluent_chevron_up_24.svg
=====================================
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M4.21967 15.5303C4.51256 15.8232 4.98744 15.8232 5.28033 15.5303L12 8.81066L18.7197 15.5303C19.0126 15.8232 19.4874 15.8232 19.7803 15.5303C20.0732 15.2374 20.0732 14.7626 19.7803 14.4697L12.5303 7.21967C12.2374 6.92678 11.7626 6.92678 11.4697 7.21967L4.21967 14.4697C3.92678 14.7626 3.92678 15.2374 4.21967 15.5303Z" fill="#212121"/>
+</svg>


=====================================
modules/gui/qt/pixmaps/icons/ok.svg
=====================================
@@ -0,0 +1,5 @@
+<svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M4.97656 13.875C4.97656 11.174 7.16617 8.98438 9.86719 8.98438C12.5682 8.98438 14.7578 11.174 14.7578 13.875V18.1016C14.7578 20.8026 12.5682 22.9922 9.86719 22.9922C7.16617 22.9922 4.97656 20.8026 4.97656 18.1016V13.875ZM9.86719 11.7344C8.68495 11.7344 7.72656 12.6928 7.72656 13.875V18.1016C7.72656 19.2838 8.68495 20.2422 9.86719 20.2422C11.0494 20.2422 12.0078 19.2838 12.0078 18.1016V13.875C12.0078 12.6928 11.0494 11.7344 9.86719 11.7344Z" fill="#212121"/>
+<path d="M18.375 8.98438C19.1344 8.98438 19.75 9.59998 19.75 10.3594V13.441C19.75 13.5536 19.8873 13.6088 19.9653 13.5274L23.8822 9.43936C24.4075 8.89103 25.2779 8.87242 25.8263 9.39779C26.3746 9.92316 26.3932 10.7936 25.8678 11.3419L22.4216 14.9387C22.3816 14.9804 22.3755 15.0442 22.4068 15.0928L26.1407 20.8967C26.5516 21.5353 26.367 22.3861 25.7283 22.797C25.0897 23.2079 24.2389 23.0232 23.828 22.3846L20.4828 17.185C20.4391 17.117 20.3434 17.1078 20.2875 17.1661L19.7897 17.6856L19.7876 17.6879C19.764 17.7123 19.75 17.7446 19.75 17.7786V21.6172C19.75 22.3766 19.1344 22.9922 18.375 22.9922C17.6156 22.9922 17 22.3766 17 21.6172V10.3594C17 9.59998 17.6156 8.98438 18.375 8.98438Z" fill="#212121"/>
+<path d="M6 1C3.23858 1 1 3.23858 1 6V26C1 28.7614 3.23858 31 6 31H26C28.7614 31 31 28.7614 31 26V6C31 3.23858 28.7614 1 26 1H6ZM3 6C3 4.34315 4.34315 3 6 3H26C27.6569 3 29 4.34315 29 6V26C29 27.6569 27.6569 29 26 29H6C4.34315 29 3 27.6569 3 26V6Z" fill="#212121"/>
+</svg>


=====================================
modules/gui/qt/player/control_list_filter.cpp
=====================================
@@ -67,6 +67,10 @@ bool ControlListFilter::filterAcceptsRow(int source_row, const QModelIndex &) co
     {
         return (m_player->hasMenu() || m_player->hasPrograms() || m_player->isTeletextAvailable());
     }
+    else if (type == ControlListModel::NAVIGATION_BOX)
+    {
+        return (m_player->isInteractive());
+    }
     else if (type == ControlListModel::BOOKMARK_BUTTON)
     {
         return (m_ctx->hasMediaLibrary() || m_player->hasChapters() || m_player->hasTitles());


=====================================
modules/gui/qt/player/control_list_model.hpp
=====================================
@@ -77,11 +77,12 @@ public:
         RENDERER_BUTTON,
         NAVIGATION_BUTTONS,
         PROGRAM_BUTTON,
+        NAVIGATION_BOX,
         SPECIAL_MAX,
 
         WIDGET_SPACER = 0x40,
         WIDGET_SPACER_EXTEND,
-        WIDGET_MAX
+        WIDGET_MAX,
     };
     Q_ENUM(ControlType)
 


=====================================
modules/gui/qt/player/player_controller.cpp
=====================================
@@ -1437,6 +1437,56 @@ void PlayerController::sectionMenu()
         vlc_player_Navigate( d->m_player, VLC_PLAYER_NAV_MENU );
 }
 
+void PlayerController::navigateUp()
+{
+    Q_D(PlayerController);
+    vlc_player_locker lock{ d->m_player };
+    if( !isCurrentItemSynced() )
+        return;
+    if( vlc_player_IsStarted( d->m_player ) )
+        vlc_player_Navigate( d->m_player, VLC_PLAYER_NAV_UP);
+}
+
+void PlayerController::navigateDown()
+{
+    Q_D(PlayerController);
+    vlc_player_locker lock{ d->m_player };
+    if( !isCurrentItemSynced() )
+        return;
+    if( vlc_player_IsStarted( d->m_player ) )
+        vlc_player_Navigate( d->m_player, VLC_PLAYER_NAV_DOWN);
+}
+
+void PlayerController::navigateLeft()
+{
+    Q_D(PlayerController);
+    vlc_player_locker lock{ d->m_player };
+    if( !isCurrentItemSynced() )
+        return;
+    if( vlc_player_IsStarted( d->m_player ) )
+        vlc_player_Navigate( d->m_player, VLC_PLAYER_NAV_LEFT);
+}
+
+void PlayerController::navigateRight()
+{
+    Q_D(PlayerController);
+    vlc_player_locker lock{ d->m_player };
+    if( !isCurrentItemSynced() )
+        return;
+    if( vlc_player_IsStarted( d->m_player ) )
+        vlc_player_Navigate( d->m_player, VLC_PLAYER_NAV_RIGHT);
+}
+
+void PlayerController::navigateActivate()
+{
+    Q_D(PlayerController);
+    vlc_player_locker lock{ d->m_player };
+    if( !isCurrentItemSynced() )
+        return;
+    if( vlc_player_IsStarted( d->m_player ) )
+        vlc_player_Navigate( d->m_player, VLC_PLAYER_NAV_ACTIVATE);
+}
+
 void PlayerController::chapterNext()
 {
     Q_D(PlayerController);


=====================================
modules/gui/qt/player/player_controller.hpp
=====================================
@@ -231,6 +231,13 @@ public slots:
     //programs
     void changeProgram( int );
 
+    //menu navigation
+    Q_INVOKABLE void navigateUp( );
+    Q_INVOKABLE void navigateDown( );
+    Q_INVOKABLE void navigateLeft( );
+    Q_INVOKABLE void navigateRight( );
+    Q_INVOKABLE void navigateActivate( );
+
     //vout properties
     void toggleFullscreen();
 


=====================================
modules/gui/qt/player/qml/ControlbarControls.qml
=====================================
@@ -56,6 +56,7 @@ QtObject {
         { id: ControlListModel.CHAPTER_PREVIOUS_BUTTON, file: "ChapterPreviousButton.qml", label: VLCIcons.dvd_prev, text: I18n.qtr("Previous chapter") },
         { id: ControlListModel.CHAPTER_NEXT_BUTTON, file: "ChapterNextButton.qml", label: VLCIcons.dvd_next, text: I18n.qtr("Next chapter") },
         { id: ControlListModel.VOLUME, file: "VolumeWidget.qml", label: VLCIcons.volume_high, text: I18n.qtr("Volume Widget") },
+        { id: ControlListModel.NAVIGATION_BOX, file: "NavigationBoxButton.qml", label: VLCIcons.ic_fluent_arrow_move, text: I18n.qtr("Navigation Box") },
         { id: ControlListModel.NAVIGATION_BUTTONS, file: "NavigationWidget.qml", label: VLCIcons.dvd_menu, text: I18n.qtr("Navigation") },
         { id: ControlListModel.DVD_MENUS_BUTTON, file: "DvdMenuButton.qml", label: VLCIcons.dvd_menu, text: I18n.qtr("DVD menus") },
         { id: ControlListModel.PROGRAM_BUTTON, file: "ProgramButton.qml", label: VLCIcons.tv, text: I18n.qtr("Program Button") },
@@ -77,7 +78,7 @@ QtObject {
             console.log("control delegate id " + id +  " doesn't exist")
             return { source: controlPath + "Fallback.qml" }
         }
-        
+
         entry.source = controlPath + entry.file
 
         return entry


=====================================
modules/gui/qt/player/qml/NavigationBox.qml
=====================================
@@ -0,0 +1,162 @@
+/*****************************************************************************
+ * Copyright (C) 2023 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.12
+import QtQuick.Controls 2.12
+import QtQuick.Layouts 1.12
+
+import org.videolan.vlc 0.1
+
+import "qrc:///style/"
+import "qrc:///widgets/" as Widgets
+
+Control {
+    id: navigationBox
+
+    padding: VLCStyle.focus_border
+
+    property real dragXMin: 0
+    property real dragXMax: 0
+    property real dragYMin: 0
+    property real dragYMax: 0
+
+    property bool show: false
+
+    Drag.active: mouseArea.drag.active
+
+    function toggleVisibility() {
+        show = !show
+    }
+
+    readonly property ColorContext colorContext: ColorContext {
+        id: theme
+        colorSet: ColorContext.ButtonStandard
+    }
+
+    Connections {
+        target: MainCtx
+        onNavBoxToggled: navigationBox.toggleVisibility()
+    }
+
+    contentItem: GridLayout {
+        columns: 3
+        rows: 2
+        columnSpacing: VLCStyle.margin_xxsmall
+        rowSpacing: VLCStyle.margin_xxsmall
+
+        Widgets.ActionButtonOverlay {
+            id: closeButton
+            color: theme.bg.secondary
+            Layout.alignment: Qt.AlignRight | Qt.AlignTop
+            Layout.column: 2
+            Layout.row: 0
+            iconTxt: VLCIcons.window_close
+            iconSize: VLCStyle.icon_normal
+            onClicked: {
+                navigationBox.toggleVisibility()
+            }
+        }
+
+        Widgets.ActionButtonOverlay {
+            id: upButton
+            color: theme.bg.secondary
+            Layout.column: 1
+            Layout.row: 0
+            iconTxt: VLCIcons.ic_fluent_chevron_up_24
+            iconSize: VLCStyle.icon_large
+            onClicked: Player.navigateUp()
+        }
+
+        Widgets.ActionButtonOverlay {
+            id: leftButton
+            color: theme.bg.secondary
+            Layout.column: 0
+            Layout.row: 1
+            iconTxt: VLCIcons.ic_fluent_chevron_left_24
+            iconSize: VLCStyle.icon_large
+            onClicked: Player.navigateLeft()
+        }
+
+        Widgets.ActionButtonOverlay {
+            id: selectButton
+            color: theme.bg.secondary
+            Layout.column: 1
+            Layout.row: 1
+            iconTxt: VLCIcons.ok
+            font.pixelSize: VLCStyle.fontSize_large
+            iconSize: VLCStyle.icon_normal
+            onClicked: Player.navigateActivate()
+        }
+
+        Widgets.ActionButtonOverlay {
+            id: rightButton
+            color: theme.bg.secondary          
+            Layout.column: 2
+            Layout.row: 1
+            iconTxt: VLCIcons.ic_fluent_chevron_right_24
+            iconSize: VLCStyle.icon_large
+            onClicked: Player.navigateRight()
+        }
+
+        Widgets.ActionButtonOverlay {
+            id: downButton
+            color: theme.bg.secondary
+            Layout.column: 1
+            Layout.row: 2
+            iconTxt: VLCIcons.ic_fluent_chevron_down_24
+            iconSize: VLCStyle.icon_large
+            onClicked: Player.navigateDown()
+        }
+    }
+
+    background: Rectangle {
+        id: navBoxBackgound
+        color: "black"
+        opacity: 0.4
+        radius: VLCStyle.navBoxButton_radius
+        border.color: theme.bg.secondary
+        border.width: VLCStyle.border
+
+        MouseArea {
+            id: mouseArea
+
+            anchors.fill: parent
+
+            cursorShape: (mouseArea.drag.active || mouseArea.pressed) ? Qt.DragMoveCursor : Qt.OpenHandCursor
+
+            drag.target: navigationBox
+
+            drag.minimumX: navigationBox.dragXMin
+            drag.minimumY: navigationBox.dragYMin
+            drag.maximumX: navigationBox.dragXMax
+            drag.maximumY: navigationBox.dragYMax
+
+            drag.smoothed: false
+
+            hoverEnabled: true
+
+            drag.onActiveChanged: {
+                if (drag.active) {
+                    drag.target.Drag.start()
+                } else {
+                    drag.target.Drag.drop()
+                }
+            }
+        }
+    }
+}


=====================================
modules/gui/qt/player/qml/Player.qml
=====================================
@@ -704,7 +704,45 @@ FocusScope {
         }
     }
 
-    Widgets.ButtonExt {
+    NavigationBox {
+        id: navBox
+        visible: Player.isInteractive && navBox.show
+                    && (toggleControlBarButtonAutoHide.running
+                    || navBox.hovered || !rootPlayer.hasEmbededVideo)
+
+        x: rootPlayer.x + VLCStyle.margin_normal + VLCStyle.applicationHorizontalMargin
+        y: controlBarView.y - navBox.height - VLCStyle.margin_normal
+
+        dragXMin: 0
+        dragXMax: rootPlayer.width - navBox.width
+        dragYMin: 0
+        dragYMax: rootPlayer.height - navBox.height
+
+        Drag.onDragStarted: {
+            navBox.x = drag.x
+            navBox.y = drag.y
+        }
+    }
+
+    // NavigationBox's visibility depends on this timer
+    Connections {
+        target: MainCtx
+        onNavBoxToggled: toggleControlBarButtonAutoHide.restart()
+    }
+
+    Connections {
+           target: rootPlayer
+           onWidthChanged: {
+               if (navBox.x > navBox.dragXMax)
+                   navBox.x = navBox.dragXMax
+           }
+           onHeightChanged: {
+               if (navBox.y > navBox.dragYMax)
+                   navBox.y = navBox.dragYMax
+           }
+    }
+
+   Widgets.ButtonExt {
         id: toggleControlBarButton
         visible: Player.isInteractive
                  && rootPlayer.hasEmbededVideo


=====================================
modules/gui/qt/player/qml/controlbarcontrols/NavigationBoxButton.qml
=====================================
@@ -0,0 +1,33 @@
+/*****************************************************************************
+ * Copyright (C) 2023 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.12
+
+import "qrc:///widgets/" as Widgets
+import "qrc:///player/" as Player
+import "qrc:///style/"
+
+import org.videolan.vlc 0.1
+
+Widgets.IconControlButton {
+    visible: Player.isInteractive
+    iconText: VLCIcons.ic_fluent_arrow_move
+    text: I18n.qtr("Navigation Buttons")
+
+    onClicked: MainCtx.navBoxToggled()
+}


=====================================
modules/gui/qt/style/VLCIcons.qml
=====================================
@@ -48,49 +48,55 @@ QtObject {
     readonly property string list : "\ue020"
     readonly property string more : "\ue021"
     readonly property string next : "\ue022"
-    readonly property string pause_filled : "\ue023"
-    readonly property string play_filled : "\ue024"
-    readonly property string play : "\ue025"
-    readonly property string play_reverse : "\ue026"
-    readonly property string playlist : "\ue027"
-    readonly property string playlist_clear : "\ue028"
-    readonly property string previous : "\ue029"
-    readonly property string profile_new : "\ue02a"
-    readonly property string record : "\ue02b"
-    readonly property string remove : "\ue02c"
-    readonly property string renderer : "\ue02d"
-    readonly property string repeat_all : "\ue02e"
-    readonly property string repeat_one : "\ue02f"
-    readonly property string search : "\ue030"
-    readonly property string shuffle : "\ue031"
-    readonly property string skip_back : "\ue032"
-    readonly property string skip_for : "\ue033"
-    readonly property string slower : "\ue034"
-    readonly property string snapshot : "\ue035"
-    readonly property string space : "\ue036"
-    readonly property string stop : "\ue037"
-    readonly property string stream : "\ue038"
-    readonly property string time : "\ue039"
-    readonly property string topbar_discover : "\ue03a"
-    readonly property string topbar_music : "\ue03b"
-    readonly property string topbar_network : "\ue03c"
-    readonly property string topbar_sort : "\ue03d"
-    readonly property string topbar_video : "\ue03e"
-    readonly property string chevron_up : "\ue03f"
-    readonly property string chevron_down : "\ue040"
-    readonly property string tv : "\ue041"
-    readonly property string tvtelx : "\ue042"
-    readonly property string transparency : "\ue043"
-    readonly property string circle : "\ue044"
-    readonly property string visualization : "\ue045"
-    readonly property string volume_high : "\ue046"
-    readonly property string volume_low : "\ue047"
-    readonly property string volume_medium : "\ue048"
-    readonly property string volume_muted : "\ue049"
-    readonly property string volume_zero : "\ue04a"
-    readonly property string window_close : "\ue04b"
-    readonly property string window_maximize : "\ue04c"
-    readonly property string window_minimize : "\ue04d"
-    readonly property string window_restore : "\ue04e"
+    readonly property string ok : "\ue023"
+    readonly property string pause_filled : "\ue024"
+    readonly property string play_filled : "\ue025"
+    readonly property string play : "\ue026"
+    readonly property string ic_fluent_arrow_move : "\ue027"
+    readonly property string ic_fluent_chevron_down_24 : "\ue028"
+    readonly property string ic_fluent_chevron_left_24 : "\ue029"
+    readonly property string ic_fluent_chevron_right_24 : "\ue02a"
+    readonly property string ic_fluent_chevron_up_24 : "\ue02b"
+    readonly property string play_reverse : "\ue02c"
+    readonly property string playlist : "\ue02d"
+    readonly property string playlist_clear : "\ue02e"
+    readonly property string previous : "\ue02f"
+    readonly property string profile_new : "\ue030"
+    readonly property string record : "\ue031"
+    readonly property string remove : "\ue032"
+    readonly property string renderer : "\ue033"
+    readonly property string repeat_all : "\ue034"
+    readonly property string repeat_one : "\ue035"
+    readonly property string search : "\ue036"
+    readonly property string shuffle : "\ue037"
+    readonly property string skip_back : "\ue038"
+    readonly property string skip_for : "\ue039"
+    readonly property string slower : "\ue03a"
+    readonly property string snapshot : "\ue03b"
+    readonly property string space : "\ue03c"
+    readonly property string stop : "\ue03d"
+    readonly property string stream : "\ue03e"
+    readonly property string time : "\ue03f"
+    readonly property string topbar_discover : "\ue040"
+    readonly property string topbar_music : "\ue041"
+    readonly property string topbar_network : "\ue042"
+    readonly property string topbar_sort : "\ue043"
+    readonly property string topbar_video : "\ue044"
+    readonly property string chevron_up : "\ue045"
+    readonly property string chevron_down : "\ue046"
+    readonly property string tv : "\ue047"
+    readonly property string tvtelx : "\ue048"
+    readonly property string transparency : "\ue049"
+    readonly property string circle : "\ue04a"
+    readonly property string visualization : "\ue04b"
+    readonly property string volume_high : "\ue04c"
+    readonly property string volume_low : "\ue04d"
+    readonly property string volume_medium : "\ue04e"
+    readonly property string volume_muted : "\ue04f"
+    readonly property string volume_zero : "\ue050"
+    readonly property string window_close : "\ue051"
+    readonly property string window_maximize : "\ue052"
+    readonly property string window_minimize : "\ue053"
+    readonly property string window_restore : "\ue054"
 
 }


=====================================
modules/gui/qt/style/VLCStyle.qml
=====================================
@@ -170,6 +170,8 @@ QtObject {
     readonly property int checkButton_margins: dp(4, scale)
     readonly property int checkButton_handle_margins: dp(2, scale)
 
+    readonly property int navBoxButton_radius: dp(8, scale)
+
     readonly property int table_section_width: dp(32, scale)
     readonly property int table_section_text_margin: dp(10, scale)
 


=====================================
modules/gui/qt/vlc.qrc
=====================================
@@ -324,6 +324,7 @@
         <file alias="PlayerBlurredBackground.qml">player/qml/PlayerBlurredBackground.qml</file>
         <file alias="PlayerBlurredBackground.frag">player/qml/PlayerBlurredBackground.frag</file>
         <file alias="Bookmarks.qml">player/qml/Bookmarks.qml</file>
+        <file alias="NavigationBox.qml">player/qml/NavigationBox.qml</file>
     </qresource>
     <qresource prefix="/player/controlbarcontrols">
         <file alias="HighResolutionTimeWidget.qml">player/qml/controlbarcontrols/HighResolutionTimeWidget.qml</file>
@@ -344,6 +345,7 @@
         <file alias="LangButton.qml">player/qml/controlbarcontrols/LangButton.qml</file>
         <file alias="LoopButton.qml">player/qml/controlbarcontrols/LoopButton.qml</file>
         <file alias="MenuButton.qml">player/qml/controlbarcontrols/MenuButton.qml</file>
+        <file alias="NavigationBoxButton.qml">player/qml/controlbarcontrols/NavigationBoxButton.qml</file>
         <file alias="NavigationWidget.qml">player/qml/controlbarcontrols/NavigationWidget.qml</file>
         <file alias="NextButton.qml">player/qml/controlbarcontrols/NextButton.qml</file>
         <file alias="OpenButton.qml">player/qml/controlbarcontrols/OpenButton.qml</file>


=====================================
po/POTFILES.in
=====================================
@@ -839,6 +839,7 @@ modules/gui/qt/player/control_list_filter.hpp
 modules/gui/qt/player/player_controlbar_model.cpp
 modules/gui/qt/player/player_controlbar_model.hpp
 modules/gui/qt/player/qml/ControlbarControls.qml
+modules/gui/qt/player/qml/NavigationBox.qml
 modules/gui/qt/player/qml/PlaybackSpeed.qml
 modules/gui/qt/player/qml/Player.qml
 modules/gui/qt/player/qml/ResumeDialog.qml
@@ -865,6 +866,7 @@ modules/gui/qt/player/qml/controlbarcontrols/InfoButton.qml
 modules/gui/qt/player/qml/controlbarcontrols/LangButton.qml
 modules/gui/qt/player/qml/controlbarcontrols/LoopButton.qml
 modules/gui/qt/player/qml/controlbarcontrols/MenuButton.qml
+modules/gui/qt/player/qml/controlbarcontrols/NavigationBoxButton.qml
 modules/gui/qt/player/qml/controlbarcontrols/NextButton.qml
 modules/gui/qt/player/qml/controlbarcontrols/OpenButton.qml
 modules/gui/qt/player/qml/controlbarcontrols/PlayButton.qml



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3b8438caad22651d62ca337e67a3f68bce4611f8...33330313e13cdf4e3e4acb45505c8bbeb3612c42

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/3b8438caad22651d62ca337e67a3f68bce4611f8...33330313e13cdf4e3e4acb45505c8bbeb3612c42
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list