[vlc-commits] qt: add option to toggle menubars from preferences

Prince Gupta git at videolan.org
Mon Mar 1 10:40:09 UTC 2021


vlc | branch: master | Prince Gupta <guptaprince8832 at gmail.com> | Tue Feb 23 15:53:54 2021 +0530| [ea31c4acded3c25c85259509df69d95273cdb516] | committer: Pierre Lamot

qt: add option to toggle menubars from preferences

Signed-off-by: Pierre Lamot <pierre at videolabs.io>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ea31c4acded3c25c85259509df69d95273cdb516
---

 modules/gui/qt/dialogs/preferences/simple_preferences.cpp | 1 +
 modules/gui/qt/dialogs/preferences/sprefs_interface.ui    | 7 +++++++
 modules/gui/qt/maininterface/main_interface.cpp           | 6 ++++++
 3 files changed, 14 insertions(+)

diff --git a/modules/gui/qt/dialogs/preferences/simple_preferences.cpp b/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
index 506a895272..c7280a7b9e 100644
--- a/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
+++ b/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
@@ -807,6 +807,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
                                  ui.fileSkin, ui.skinBrowse );
 
             CONFIG_BOOL( "metadata-network-access", MetadataNetworkAccessMode );
+            CONFIG_BOOL( "qt-menubar", menuBarCheck );
 
             ui.colorSchemeComboBox->insertItems(0, p_intf->p_sys->p_mi->getColorScheme()->stringList());
             QObject::connect( ui.colorSchemeComboBox, &QComboBox::currentTextChanged, p_intf->p_sys->p_mi->getColorScheme(), &ColorSchemeModel::setCurrent );
diff --git a/modules/gui/qt/dialogs/preferences/sprefs_interface.ui b/modules/gui/qt/dialogs/preferences/sprefs_interface.ui
index cf20749328..3d061946ec 100644
--- a/modules/gui/qt/dialogs/preferences/sprefs_interface.ui
+++ b/modules/gui/qt/dialogs/preferences/sprefs_interface.ui
@@ -297,6 +297,13 @@
              <item row="12" column="2" colspan="2">
               <widget class="QComboBox" name="colorSchemeComboBox"/>
              </item>
+             <item row="4" column="2">
+              <widget class="QCheckBox" name="menuBarCheck">
+               <property name="text">
+                <string>Show the menu bar</string>
+               </property>
+              </widget>
+             </item>
             </layout>
            </widget>
           </item>
diff --git a/modules/gui/qt/maininterface/main_interface.cpp b/modules/gui/qt/maininterface/main_interface.cpp
index bd350ac077..66cea66e04 100644
--- a/modules/gui/qt/maininterface/main_interface.cpp
+++ b/modules/gui/qt/maininterface/main_interface.cpp
@@ -293,6 +293,12 @@ void MainInterface::computeMinimumSize()
 void MainInterface::reloadPrefs()
 {
     i_notificationSetting = var_InheritInteger( p_intf, "qt-notification" );
+    
+    if ( m_hasToolbarMenu != var_InheritBool( p_intf, "qt-menubar" ) )
+    {
+        m_hasToolbarMenu = !m_hasToolbarMenu;
+        emit hasToolbarMenuChanged();
+    }
 }
 
 



More information about the vlc-commits mailing list