[vlc-devel] [PATCH 04/16] qt: add option to toggle menubars from preferences

Prince Gupta guptaprince8832 at gmail.com
Tue Feb 23 10:05:54 UTC 2021


---
 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 27ee08f6fa..1225e9e950 100644
--- a/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
+++ b/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
@@ -804,6 +804,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 d59c6b6abc..28e8c9ade2 100644
--- a/modules/gui/qt/maininterface/main_interface.cpp
+++ b/modules/gui/qt/maininterface/main_interface.cpp
@@ -297,6 +297,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();
+    }
 }
 
 
-- 
2.25.1



More information about the vlc-devel mailing list