Skip to content

Commit 2e791f3

Browse files
committed
Merge branch 'develop' into release-2.8
2 parents f0f1a53 + 8fca106 commit 2e791f3

24 files changed

Lines changed: 103 additions & 250 deletions

.github/workflows/linux-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
call_workflow:
1515
uses: febiosoftware/febio-workflows/.github/workflows/linux-reusable-pull-request.yml@develop
1616
with:
17-
aws-ami-id: ami-0590ebdb5afffb782
17+
aws-ami-id: ami-0e02b23806d44a8fc
1818
aws-sg-id: sg-0ca7912782cf1538b
1919
aws-instance-type: c5a.8xlarge
2020
package-name: febio-studio

.github/workflows/linux-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
call_workflow:
1313
uses: febiosoftware/febio-workflows/.github/workflows/linux-reusable-push.yml@develop
1414
with:
15-
aws-ami-id: ami-0590ebdb5afffb782
15+
aws-ami-id: ami-0e02b23806d44a8fc
1616
aws-sg-id: sg-0ca7912782cf1538b
1717
runTests: false
1818
package-name: febio-studio

.github/workflows/linux-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
call_workflow:
1414
uses: febiosoftware/febio-workflows/.github/workflows/linux-release.yml@develop
1515
with:
16-
aws-ami-id: ami-0b97a2de37c43b9ba
16+
aws-ami-id: ami-0e02b23806d44a8fc
1717
aws-sg-id: sg-0ca7912782cf1538b
1818
secrets: inherit

.github/workflows/windows-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: febiosoftware/febio-workflows/.github/workflows/windows-reusable-pull-request.yml@develop
1616
with:
1717
register-runner-timeout: 10
18-
aws-ami-id: ami-0b18c665dbe9efa75
18+
aws-ami-id: ami-0ecb160c4a6bfd01d
1919
aws-sg-id: sg-0ca7912782cf1538b
2020
aws-instance-type: c5a.8xlarge
2121
package-name: febio-studio

.github/workflows/windows-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
call_workflow:
1313
uses: febiosoftware/febio-workflows/.github/workflows/windows-reusable-push.yml@develop
1414
with:
15-
aws-ami-id: ami-0b18c665dbe9efa75
15+
aws-ami-id: ami-0ecb160c4a6bfd01d
1616
aws-sg-id: sg-0ca7912782cf1538b
1717
aws-instance-type: c5a.8xlarge
1818
runTests: false

.github/workflows/windows-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ jobs:
1313
call_workflow:
1414
uses: febiosoftware/febio-workflows/.github/workflows/windows-release.yml@develop
1515
with:
16-
aws-ami-id: ami-0b18c665dbe9efa75
16+
aws-ami-id: ami-0ecb160c4a6bfd01d
1717
aws-sg-id: sg-0ca7912782cf1538b
1818
secrets: inherit

CMakeLists.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,38 +29,40 @@ if(NOT Qt_Root)
2929
set(Qt_Root "" CACHE PATH "Path to the root Qt directory (e.g. /opt/Qt)")
3030
endif()
3131

32-
if(NOT CMAKE_PREFIX_PATH)
32+
if(NOT Qt6_DIR OR NOT CMAKE_PREFIX_PATH)
3333
if(WIN32)
34-
find_path(Qt_TEMP Qt6/Qt6Config.cmake
35-
PATHS ${Qt_Root}/ ${Qt_Root}/* ${Qt_Root}/*/* C:/Qt/* C:/Qt*/* $ENV{HOME}/Qt/* $ENV{HOME}/*/Qt/* /Qt/* /Qt*/*
36-
PATH_SUFFIXES "share" "lib/cmake" "msvc2015_64" "msvc2017_64" "msvc2019_64"
37-
PATH_SUFFIXES "msvc2015_64" "msvc2017_64" "msvc2019_64"
38-
DOC "Qt CMake Directory"
39-
NO_DEFAULT_PATH)
34+
find_path(Qt_TEMP Qt6Config.cmake
35+
PATHS ${Qt_Root}/ ${Qt_Root}/* ${Qt_Root}/*/* C:/Qt/* C:/Qt*/* $ENV{HOME}/Qt/* $ENV{HOME}/*/Qt/* /Qt/* /Qt*/*
36+
PATH_SUFFIXES "lib/cmake/Qt6" "msvc2019_64/lib/cmake/Qt6"
37+
DOC "Qt CMake Directory"
38+
NO_DEFAULT_PATH)
4039
elseif(APPLE)
41-
find_path(Qt_TEMP lib/cmake/Qt6/Qt6Config.cmake
40+
find_path(Qt_TEMP Qt6Config.cmake
4241
PATHS ${Qt_Root}/ ${Qt_Root}/* ${Qt_Root}/*/* /opt/Qt/* /opt/Qt*/* /usr/local/Qt/* /usr/local/Qt*/*
4342
$ENV{HOME}/Qt/* $ENV{HOME}/*/Qt/* /Qt/* /Qt*/*
44-
PATH_SUFFIXES "clang_64"
43+
PATH_SUFFIXES "lib/cmake/Qt6" "clang_64/lib/cmake/Qt6"
4544
DOC "Qt6 CMake Directory"
4645
NO_DEFAULT_PATH)
4746
else()
48-
find_path(Qt_TEMP cmake/Qt6/Qt6Config.cmake
47+
find_path(Qt_TEMP Qt6Config.cmake
4948
PATHS ${Qt_Root}/ ${Qt_Root}/* ${Qt_Root}/*/* /opt/Qt/* /opt/Qt*/* /usr/local/Qt/* /usr/local/Qt*/*
5049
$ENV{HOME}/Qt/* $ENV{HOME}/*/Qt6 $ENV{HOME}/*/Qt/* /Qt/* /Qt*/*
51-
PATH_SUFFIXES "gcc_64" "lib"
50+
PATH_SUFFIXES "gcc_64/lib/cmake/Qt6" "lib/cmake/Qt6"
5251
DOC "Qt CMake Directory"
5352
NO_DEFAULT_PATH)
5453
endif()
5554

5655
if(Qt_TEMP)
57-
set(CMAKE_PREFIX_PATH ${Qt_TEMP} CACHE INTERNAL "Path to Qt6 installation prefix.")
56+
set(Qt6_DIR ${Qt_TEMP} CACHE INTERNAL "Path to Qt6 installation prefix.")
57+
58+
set(CMAKE_PREFIX_PATH ${Qt_TEMP}/../../.. CACHE INTERNAL "Qt Prefix.")
59+
5860
unset(Qt_TEMP CACHE)
5961
else()
6062
unset(Qt_TEMP CACHE)
6163
endif()
6264

63-
if(NOT CMAKE_PREFIX_PATH)
65+
if(NOT Qt6_DIR OR NOT CMAKE_PREFIX_PATH)
6466
message(FATAL_ERROR "Unable to locate Qt6Config.cmake. Please check the value of Qt6_Root and set it to the root directory of your Qt6 installation (e.g. /opt/Qt).")
6567
endif()
6668
endif()

FEBioStudio/DlgFEBioOptimize.cpp

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ class Ui::CDlgFEBioOptimize
219219
public:
220220
FSModel* m_fem;
221221
FEBioOpt opt;
222-
int m_theme;
223222

224223
// page2 (Options)
225224
QComboBox* method;
@@ -253,12 +252,6 @@ class Ui::CDlgFEBioOptimize
253252
public:
254253
void setup(QWizard* w)
255254
{
256-
if (m_theme == 1)
257-
{
258-
w->setWizardStyle(QWizard::ClassicStyle);
259-
w->setStyleSheet("background-color:#353535");
260-
}
261-
262255
w->addPage(GenerateIntro());
263256
w->addPage(GenerateOptionsPage());
264257
w->addPage(GenerateParametersPage());
@@ -427,11 +420,6 @@ class Ui::CDlgFEBioOptimize
427420
paramTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
428421
paramTable->horizontalHeader()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
429422

430-
if (m_theme == 0)
431-
paramTable->setStyleSheet("QHeaderView::section { background-color:lightgray }");
432-
else
433-
paramTable->setStyleSheet("QHeaderView::section { background-color:gray }");
434-
435423
QVBoxLayout* l = new QVBoxLayout;
436424
l->addLayout(form);
437425
l->addLayout(h);
@@ -484,11 +472,6 @@ class Ui::CDlgFEBioOptimize
484472
dataTable->setSelectionMode(QAbstractItemView::SingleSelection);
485473
dataTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
486474

487-
if (m_theme == 0)
488-
dataTable->setStyleSheet("QHeaderView::section { background-color:lightgray }");
489-
else
490-
dataTable->setStyleSheet("QHeaderView::section { background-color:gray }");
491-
492475
l1->addLayout(form);
493476
l1->addLayout(h);
494477
l1->addWidget(dataTable);
@@ -562,7 +545,6 @@ CDlgFEBioOptimize::CDlgFEBioOptimize(CMainWindow* parent) : QWizard(parent), ui(
562545
CModelDocument* doc = dynamic_cast<CModelDocument*>(parent->GetDocument());
563546

564547
setWindowTitle("Generate FEBio optimization");
565-
ui->m_theme = parent->currentTheme();
566548
ui->m_fem = doc->GetFSModel();
567549
ui->setup(this);
568550

FEBioStudio/DlgSettings.cpp

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -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();

FEBioStudio/GLView.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ SOFTWARE.*/
3232
#include <GL/glu.h>
3333
#endif
3434
#include "MainWindow.h"
35+
#include <QApplication>
36+
#include <QStyleHints>
3537
#include "BuildPanel.h"
3638
#include "CreatePanel.h"
3739
#include "ModelDocument.h"
@@ -1258,7 +1260,9 @@ void CGLView::initializeGL()
12581260
void CGLView::Reset()
12591261
{
12601262
// default display properties
1261-
int ntheme = m_pWnd->currentTheme();
1263+
int ntheme = 0;
1264+
if(qApp->styleHints()->colorScheme() == Qt::ColorScheme::Dark) ntheme = 1;
1265+
12621266
m_view.Defaults(ntheme);
12631267

12641268
GLHighlighter::ClearHighlights();

0 commit comments

Comments
 (0)