[vlc-commits] [Git][videolan/vlc][master] 5 commits: qt/mainctx: Add the 'setHasToolbarMenu' function
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Thu Jul 21 08:08:32 UTC 2022
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
021912e1 by Benjamin Arnaud at 2022-07-21T07:57:01+00:00
qt/mainctx: Add the 'setHasToolbarMenu' function
- - - - -
85bd3996 by Benjamin Arnaud at 2022-07-21T07:57:01+00:00
qt/mainctx: Add the 'toggleToolbarMenu' function
- - - - -
a3bcf870 by Benjamin Arnaud at 2022-07-21T07:57:01+00:00
qml/GlobalShortcuts: Small refactor
- - - - -
017d2d1c by Benjamin Arnaud at 2022-07-21T07:57:01+00:00
qml/GlobalShortcuts: Add the toolbar menu support
- - - - -
d20b93cc by Benjamin Arnaud at 2022-07-21T07:57:01+00:00
qml: revert default global shortcut context as ApplicationContext
fix regression from 99f697cf
Co-authored-by: Pierre Lamot <pierre at videolabs.io>
- - - - -
4 changed files:
- modules/gui/qt/maininterface/mainctx.cpp
- modules/gui/qt/maininterface/mainctx.hpp
- modules/gui/qt/menus/qml/GlobalShortcuts.qml
- modules/gui/qt/menus/qml/ShortcutExt.qml
Changes:
=====================================
modules/gui/qt/maininterface/mainctx.cpp
=====================================
@@ -419,6 +419,18 @@ void MainCtx::setIntfUserScaleFactor(double newValue)
updateIntfScaleFactor();
}
+void MainCtx::setHasToolbarMenu( bool hasToolbarMenu )
+{
+ if (m_hasToolbarMenu == hasToolbarMenu)
+ return;
+
+ m_hasToolbarMenu = hasToolbarMenu;
+
+ config_PutInt("qt-menubar", (int) hasToolbarMenu);
+
+ emit hasToolbarMenuChanged();
+}
+
void MainCtx::setPinVideoControls(bool pinVideoControls)
{
if (m_pinVideoControls == pinVideoControls)
@@ -739,6 +751,11 @@ bool MainCtx::onWindowClose( QWindow* )
}
}
+void MainCtx::toggleToolbarMenu()
+{
+ setHasToolbarMenu(!m_hasToolbarMenu);
+}
+
void MainCtx::toggleInterfaceFullScreen()
{
emit setInterfaceFullScreen( m_windowVisibility != QWindow::FullScreen );
=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -163,7 +163,7 @@ class MainCtx : public QObject
Q_PROPERTY(bool clientSideDecoration READ useClientSideDecoration NOTIFY useClientSideDecorationChanged FINAL)
Q_PROPERTY(bool hasFirstrun READ hasFirstrun CONSTANT FINAL)
Q_PROPERTY(int csdBorderSize READ CSDBorderSize NOTIFY useClientSideDecorationChanged FINAL)
- Q_PROPERTY(bool hasToolbarMenu READ hasToolbarMenu NOTIFY hasToolbarMenuChanged FINAL)
+ Q_PROPERTY(bool hasToolbarMenu READ hasToolbarMenu WRITE setHasToolbarMenu NOTIFY hasToolbarMenuChanged FINAL)
Q_PROPERTY(bool canShowVideoPIP READ canShowVideoPIP CONSTANT FINAL)
Q_PROPERTY(bool pinVideoControls READ pinVideoControls WRITE setPinVideoControls NOTIFY pinVideoControlsChanged FINAL)
Q_PROPERTY(ControlbarProfileModel* controlbarProfileModel READ controlbarProfileModel CONSTANT FINAL)
@@ -337,6 +337,7 @@ protected:
Grouping m_grouping = GROUPING_NONE;
ColorSchemeModel* m_colorScheme = nullptr;
bool m_windowTitlebar = true;
+ // NOTE: Ideally this should be a QVLCBool.
bool m_hasToolbarMenu = false;
bool m_canShowVideoPIP = false;
bool m_pinVideoControls = false;
@@ -364,6 +365,7 @@ public slots:
void toggleUpdateSystrayMenu();
void showUpdateSystrayMenu();
void hideUpdateSystrayMenu();
+ void toggleToolbarMenu();
void toggleInterfaceFullScreen();
void setPlaylistDocked( bool );
void setPlaylistVisible( bool );
@@ -374,6 +376,7 @@ public slots:
void setGrouping( Grouping );
void incrementIntfUserScaleFactor( bool increment);
void setIntfUserScaleFactor( double );
+ void setHasToolbarMenu( bool );
void setPinVideoControls( bool );
void updateIntfScaleFactor();
void onWindowVisibilityChanged(QWindow::Visibility);
=====================================
modules/gui/qt/menus/qml/GlobalShortcuts.qml
=====================================
@@ -38,12 +38,14 @@ Item {
ShortcutExt{ sequence:"Ctrl+M"; onActivated: DialogsProvider.messagesDialog(); }
ShortcutExt{ sequence:"Ctrl+P"; onActivated: DialogsProvider.prefsDialog(); }
ShortcutExt{ sequence:"Ctrl+T"; onActivated: DialogsProvider.gotoTimeDialog(); }
- ShortcutExt{ sequence:"F1"; onActivated: DialogsProvider.helpDialog(); }
ShortcutExt{ sequence:"Ctrl+Shift+W"; onActivated: DialogsProvider.vlmDialog(); }
ShortcutExt{ sequence:"Ctrl+L"; onActivated: MainCtx.playlistVisible = !MainCtx.playlistVisible; }
- ShortcutExt{ sequence:"F11"; onActivated: MainCtx.toggleInterfaceFullScreen(); }
+
+ ShortcutExt{ sequence:"F1"; onActivated: DialogsProvider.helpDialog() }
+ ShortcutExt{ sequence:"F10"; onActivated: MainCtx.toggleToolbarMenu() }
+ ShortcutExt{ sequence:"F11"; onActivated: MainCtx.toggleInterfaceFullScreen() }
Loader {
active: MainCtx.mediaLibraryAvailable
=====================================
modules/gui/qt/menus/qml/ShortcutExt.qml
=====================================
@@ -20,6 +20,6 @@ import QtQuick 2.11
import org.videolan.vlc 0.1
Shortcut {
- context: Qt.WindowShortcut
+ context: Qt.ApplicationShortcut
enabled: MainCtx.useGlobalShortcuts
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d882aa8718586970f3fdb8f9ffefab823ea10682...d20b93cc95b193a5cbf0d65f01dbcafb59fc8c1e
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d882aa8718586970f3fdb8f9ffefab823ea10682...d20b93cc95b193a5cbf0d65f01dbcafb59fc8c1e
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