@@ -150,6 +150,18 @@ bool OpenRGBDialog2::IsDarkTheme()
150150 return false ;
151151}
152152
153+ bool OpenRGBDialog2::IsMinimizeOnClose ()
154+ {
155+ json ui_settings = ResourceManager::get ()->GetSettingsManager ()->GetSettings (" UserInterface" );
156+
157+ if (ui_settings.contains (" minimize_on_close" ))
158+ {
159+ return ui_settings[" minimize_on_close" ];
160+ }
161+
162+ return false ;
163+ }
164+
153165OpenRGBDialog2::OpenRGBDialog2 (QWidget *parent) : QMainWindow(parent), ui(new OpenRGBDialog2Ui)
154166{
155167 ui->setupUi (this );
@@ -321,12 +333,6 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op
321333
322334 settings_manager->SetSettings (ui_string, ui_settings);
323335 settings_manager->SaveSettings ();
324-
325- MinimizeToTray = false ;
326- }
327- else
328- {
329- MinimizeToTray = ui_settings[" minimize_on_close" ].get <bool >();
330336 }
331337
332338 connect (trayIcon,SIGNAL (activated (QSystemTrayIcon::ActivationReason)), this , SLOT (on_ReShow (QSystemTrayIcon::ActivationReason)));
@@ -386,10 +392,15 @@ OpenRGBDialog2::OpenRGBDialog2(QWidget *parent) : QMainWindow(parent), ui(new Op
386392 AddSoftwareInfoPage ();
387393
388394 /* -----------------------------------------------------*\
389- | Add the upported Devices page |
395+ | Add the supported Devices page |
390396 \*-----------------------------------------------------*/
391397 AddSupportedDevicesPage ();
392398
399+ /* -----------------------------------------------------*\
400+ | Add the settings page |
401+ \*-----------------------------------------------------*/
402+ AddSettingsPage ();
403+
393404 /* -----------------------------------------------------*\
394405 | Add the SMBus Tools page if enabled |
395406 \*-----------------------------------------------------*/
@@ -454,7 +465,7 @@ void OpenRGBDialog2::closeEvent(QCloseEvent *event)
454465{
455466 ResourceManager::get ()->WaitForDeviceDetection ();
456467
457- if (MinimizeToTray && !this ->isHidden ())
468+ if (IsMinimizeOnClose () && !this ->isHidden ())
458469 {
459470 hide ();
460471 event->ignore ();
@@ -523,6 +534,36 @@ void OpenRGBDialog2::AddSupportedDevicesPage()
523534 ui->SettingsTabBar ->tabBar ()->setTabButton (ui->SettingsTabBar ->tabBar ()->count () - 1 , QTabBar::LeftSide, SupportedTabLabel);
524535}
525536
537+
538+ void OpenRGBDialog2::AddSettingsPage ()
539+ {
540+ /* -----------------------------------------------------*\
541+ | Create the Settings page |
542+ \*-----------------------------------------------------*/
543+ SettingsPage = new OpenRGBSettingsPage ();
544+
545+ ui->SettingsTabBar ->addTab (SettingsPage, " " );
546+
547+ QString SettingsLabelString = " <html><table><tr><td width='30'><img src='" ;
548+ SettingsLabelString += " :/settings" ;
549+ if (IsDarkTheme ()) SettingsLabelString += " _dark" ;
550+ SettingsLabelString += " .png' height='16' width='16'></td><td>Settings</td></tr></table></html>" ;
551+
552+ QLabel *SettingsTabLabel = new QLabel ();
553+ SettingsTabLabel->setText (SettingsLabelString);
554+ SettingsTabLabel->setIndent (20 );
555+ if (IsDarkTheme ())
556+ {
557+ SettingsTabLabel->setGeometry (0 , 25 , 200 , 50 );
558+ }
559+ else
560+ {
561+ SettingsTabLabel->setGeometry (0 , 0 , 200 , 25 );
562+ }
563+
564+ ui->SettingsTabBar ->tabBar ()->setTabButton (ui->SettingsTabBar ->tabBar ()->count () - 1 , QTabBar::LeftSide, SettingsTabLabel);
565+ }
566+
526567void OpenRGBDialog2::AddPluginTab (PluginManager* plugin_manager, int plugin_index)
527568{
528569 /* -----------------------------------------------------*\
0 commit comments