vlc | branch: master | Prince Gupta <guptaprince8...@gmail.com> | Thu Feb 18 20:25:06 2021 +0530| [de19782c209286fb2950e2c43f774c84b46a552d] | committer: Pierre Lamot
qml: add pinVideoControls setting in maininterface Signed-off-by: Pierre Lamot <pie...@videolabs.io> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de19782c209286fb2950e2c43f774c84b46a552d --- modules/gui/qt/maininterface/main_interface.cpp | 11 +++++++++++ modules/gui/qt/maininterface/main_interface.hpp | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/modules/gui/qt/maininterface/main_interface.cpp b/modules/gui/qt/maininterface/main_interface.cpp index 3a0af1fe63..3e0d7e9338 100644 --- a/modules/gui/qt/maininterface/main_interface.cpp +++ b/modules/gui/qt/maininterface/main_interface.cpp @@ -150,6 +150,7 @@ MainInterface::MainInterface(intf_thread_t *_p_intf , QWidget* parent, Qt::Windo m_gridView = getSettings()->value( "MainWindow/grid-view", true).toBool(); QString currentColorScheme = getSettings()->value( "MainWindow/color-scheme", "system").toString(); m_showRemainingTime = getSettings()->value( "MainWindow/ShowRemainingTime", false ).toBool(); + m_pinVideoControls = getSettings()->value("MainWindow/pin-video-controls", false ).toBool(); m_colorScheme = new ColorSchemeModel(this); m_colorScheme->setCurrent(currentColorScheme); @@ -240,6 +241,7 @@ MainInterface::~MainInterface() settings->setValue( "pl-dock-status", b_playlistDocked ); settings->setValue( "ShowRemainingTime", m_showRemainingTime ); settings->setValue( "interface-scale", m_intfUserScaleFactor ); + settings->setValue( "pin-video-controls", m_pinVideoControls ); /* Save playlist state */ settings->setValue( "playlist-visible", playlistVisible ); @@ -368,6 +370,15 @@ void MainInterface::setIntfUserScaleFactor(float newValue) updateIntfScaleFactor(); } +void MainInterface::setPinVideoControls(bool pinVideoControls) +{ + if (m_pinVideoControls == pinVideoControls) + return; + + m_pinVideoControls = pinVideoControls; + emit pinVideoControlsChanged(m_pinVideoControls); +} + inline void MainInterface::initSystray() { bool b_systrayAvailable = QSystemTrayIcon::isSystemTrayAvailable(); diff --git a/modules/gui/qt/maininterface/main_interface.hpp b/modules/gui/qt/maininterface/main_interface.hpp index 3672ce000c..6b28161d0f 100644 --- a/modules/gui/qt/maininterface/main_interface.hpp +++ b/modules/gui/qt/maininterface/main_interface.hpp @@ -158,6 +158,7 @@ class MainInterface : public QVLCMW Q_PROPERTY(bool clientSideDecoration READ useClientSideDecoration NOTIFY useClientSideDecorationChanged) Q_PROPERTY(bool hasToolbarMenu READ hasToolbarMenu NOTIFY hasToolbarMenuChanged) Q_PROPERTY(bool canShowVideoPIP READ canShowVideoPIP CONSTANT) + Q_PROPERTY(bool pinVideoControls READ pinVideoControls WRITE setPinVideoControls NOTIFY pinVideoControlsChanged) public: /* tors */ @@ -205,6 +206,7 @@ public: inline bool hasToolbarMenu() const { return m_hasToolbarMenu; } inline bool canShowVideoPIP() const { return m_canShowVideoPIP; } inline void setCanShowVideoPIP(bool canShowVideoPIP) { m_canShowVideoPIP = canShowVideoPIP; } + inline bool pinVideoControls() const { return m_pinVideoControls; } bool hasEmbededVideo() const; VideoSurfaceProvider* getVideoSurfaceProvider() const; @@ -276,6 +278,7 @@ protected: bool m_clientSideDecoration = false; bool m_hasToolbarMenu = false; bool m_canShowVideoPIP = false; + bool m_pinVideoControls = false; /* States */ bool playlistVisible; ///< Is the playlist visible ? @@ -300,6 +303,7 @@ public slots: void setGridView( bool ); void incrementIntfUserScaleFactor( bool increment); void setIntfUserScaleFactor( float ); + void setPinVideoControls( bool ); void emitBoss(); void emitRaise(); @@ -350,6 +354,7 @@ signals: void requestInterfaceNormal(); void intfScaleFactorChanged(); + void pinVideoControlsChanged( bool ); }; #endif _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits