[vlc-devel] [PATCH 03/16] qt: add color scheme option in simple preferences

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


---
 .../qt/dialogs/preferences/simple_preferences.cpp   |  5 +++++
 .../gui/qt/dialogs/preferences/sprefs_interface.ui  | 13 +++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/modules/gui/qt/dialogs/preferences/simple_preferences.cpp b/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
index d464632164..27ee08f6fa 100644
--- a/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
+++ b/modules/gui/qt/dialogs/preferences/simple_preferences.cpp
@@ -28,6 +28,8 @@
 
 #include "simple_preferences.hpp"
 #include "preferences_widgets.hpp"
+#include "maininterface/main_interface.hpp"
+#include "util/color_scheme_model.hpp"
 
 #include <vlc_config_cat.h>
 #include <vlc_configuration.h>
@@ -803,6 +805,9 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
 
             CONFIG_BOOL( "metadata-network-access", MetadataNetworkAccessMode );
 
+            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 );
+
             /* UPDATE options */
 #ifdef UPDATE_CHECK
             CONFIG_BOOL( "qt-updates-notif", updatesBox );
diff --git a/modules/gui/qt/dialogs/preferences/sprefs_interface.ui b/modules/gui/qt/dialogs/preferences/sprefs_interface.ui
index 1c505156c3..cf20749328 100644
--- a/modules/gui/qt/dialogs/preferences/sprefs_interface.ui
+++ b/modules/gui/qt/dialogs/preferences/sprefs_interface.ui
@@ -284,6 +284,19 @@
              <item row="11" column="2" colspan="2">
               <widget class="QComboBox" name="autoRaiseComboBox"/>
              </item>
+             <item row="12" column="0">
+              <widget class="QLabel" name="colorSchemeLabel">
+               <property name="text">
+                <string>Color Scheme:</string>
+               </property>
+               <property name="buddy">
+                <cstring>colorSchemeComboBox</cstring>
+               </property>
+              </widget>
+             </item>
+             <item row="12" column="2" colspan="2">
+              <widget class="QComboBox" name="colorSchemeComboBox"/>
+             </item>
             </layout>
            </widget>
           </item>
-- 
2.25.1



More information about the vlc-devel mailing list