@@ -37,6 +37,8 @@ SOFTWARE.*/
3737#include < QTabWidget>
3838#include < QListWidget>
3939#include < QAction>
40+ #include < QApplication>
41+ #include < QStyleHints>
4042#include < QLabel>
4143#include < QDialogButtonBox>
4244#include < QInputDialog>
@@ -154,11 +156,6 @@ class CUIProps : public CDataPropertyList
154156 {
155157 addBoolProperty (&m_apply, " Emulate apply action" );
156158 addBoolProperty (&m_bcmd , " Clear undo stack on save" );
157- QStringList themes = QStringList () << " Default" << " Dark" ;
158- #ifdef LINUX
159- themes << " Adwaita" << " Adwaita Dark" ;
160- #endif
161- addEnumProperty (&m_theme, " Theme" )->setEnumValues (themes);
162159 addProperty (" Recent files list" , CProperty::Action)->info = QString (" Clear" );
163160 addIntProperty (&m_autoSaveInterval, " AutoSave Interval (s)" );
164161 }
@@ -1128,7 +1125,6 @@ void CDlgSettings::UpdateSettings()
11281125
11291126 ui->m_ui ->m_apply = (view.m_apply == 1 );
11301127 ui->m_ui ->m_bcmd = m_pwnd->clearCommandStackOnSave ();
1131- ui->m_ui ->m_theme = m_pwnd->currentTheme ();
11321128 ui->m_ui ->m_autoSaveInterval = m_pwnd->autoSaveInterval ();
11331129
11341130 ui->m_select ->m_bconnect = view.m_bconn ;
@@ -1220,8 +1216,8 @@ void CDlgSettings::apply()
12201216
12211217 if (view.m_defaultFGColorOption == 0 )
12221218 {
1223- int theme = m_pwnd-> currentTheme () ;
1224- if (theme == 0 ) view.m_defaultFGColor = GLColor (0 ,0 ,0 );
1219+ int theme = 0 ;
1220+ if (qApp-> styleHints ()-> colorScheme () != Qt::ColorScheme::Dark ) view.m_defaultFGColor = GLColor (0 ,0 ,0 );
12251221 else view.m_defaultFGColor = GLColor (255 , 255 , 255 );
12261222 }
12271223 GLWidget::set_base_color (view.m_defaultFGColor );
@@ -1278,14 +1274,6 @@ void CDlgSettings::apply()
12781274 m_pwnd->setClearCommandStackOnSave (ui->m_ui ->m_bcmd );
12791275 m_pwnd->setAutoSaveInterval (ui->m_ui ->m_autoSaveInterval );
12801276
1281- int oldTheme = m_pwnd->currentTheme ();
1282- if (ui->m_ui ->m_theme != oldTheme)
1283- {
1284- m_pwnd->setCurrentTheme (ui->m_ui ->m_theme );
1285- view.Defaults (ui->m_ui ->m_theme );
1286- QMessageBox::information (this , " FEBio Studio" , " Changing the theme requires a restart of FEBio Studio for all changes to take effect." );
1287- }
1288-
12891277 // update units
12901278 int newUnit = ui->m_unit ->m_unit ;
12911279 int nops = ui->m_unit ->getOption ();
@@ -1339,7 +1327,8 @@ void CDlgSettings::onReset()
13391327 CGLDocument* pdoc = m_pwnd->GetGLDocument ();
13401328 CGLView* glview = m_pwnd->GetGLView ();
13411329 GLViewSettings& view = glview->GetViewSettings ();
1342- int ntheme = m_pwnd->currentTheme ();
1330+ int ntheme = 0 ;
1331+ if (qApp->styleHints ()->colorScheme () == Qt::ColorScheme::Dark) ntheme = 1 ;
13431332 view.Defaults (ntheme);
13441333 UpdateSettings ();
13451334 m_pwnd->RedrawGL ();
0 commit comments