@@ -182,6 +182,8 @@ void AppPreferencesDialog::accept()
182182 profile.splashFile (ui->SplashFileName ->text ());
183183 profile.runSDSync (ui->chkPromptSDSync ->isChecked ());
184184 profile.radioSimCaseColor (ui->lblRadioColorSample ->palette ().button ().color ());
185+ profile.simBtnClickedUseOSTheme (ui->chkSimBtnClickedUseOSTheme ->isChecked ());
186+ profile.simBtnClickedColor (ui->lblSimBtnClickedColorSample ->palette ().button ().color ());
185187 profile.useSavedSettings (ui->chkUseSavedSettingsProfile ->isChecked ());
186188
187189 // The profile name may NEVER be empty
@@ -380,6 +382,16 @@ void AppPreferencesDialog::initSettings()
380382 ui->lblGeneralSettings ->setText (hwSettings);
381383 ui->chkPromptSDSync ->setChecked (profile.runSDSync ());
382384 ui->lblRadioColorSample ->setPalette (QPalette (profile.radioSimCaseColor ()));
385+ ui->chkSimBtnClickedUseOSTheme ->setChecked (profile.simBtnClickedUseOSTheme ());
386+ ui->lblSimBtnClickedColorSample ->setPalette (QPalette (profile.simBtnClickedColor ()));
387+
388+ if (ui->chkSimBtnClickedUseOSTheme ->isChecked ()) {
389+ ui->lblSimBtnClickedColorSample ->setVisible (false );
390+ ui->btnSimBtnClickedColor ->setEnabled (false );
391+ } else {
392+ ui->lblSimBtnClickedColorSample ->setVisible (true );
393+ ui->btnSimBtnClickedColor ->setEnabled (true );
394+ }
383395
384396 QString currType = QStringList (profile.fwType ().split (' -' ).mid (0 , 2 )).join (' -' );
385397 foreach (Firmware * firmware, Firmware::getRegisteredFirmwares ()) {
@@ -907,3 +919,21 @@ void AppPreferencesDialog::onProfileBackupPathEditingFinished()
907919 ui->profileBackupEnable ->setEnabled (false );
908920 }
909921}
922+ void AppPreferencesDialog::on_chkSimBtnClickedUseOSTheme_stateChanged ()
923+ {
924+ if (ui->chkSimBtnClickedUseOSTheme ->isChecked ()) {
925+ ui->lblSimBtnClickedColorSample ->setVisible (false );
926+ ui->btnSimBtnClickedColor ->setEnabled (false );
927+ } else {
928+ ui->lblSimBtnClickedColorSample ->setVisible (true );
929+ ui->btnSimBtnClickedColor ->setEnabled (true );
930+ }
931+ }
932+
933+ void AppPreferencesDialog::on_btnSimBtnClickedColor_clicked ()
934+ {
935+ QColorDialog *dlg = new QColorDialog (this );
936+ QColor color = dlg->getColor (g.currentProfile ().simBtnClickedColor (), this );
937+ ui->lblSimBtnClickedColorSample ->setPalette (QPalette (color));
938+ ui->lblSimBtnClickedColorSample ->repaint ();
939+ }
0 commit comments