@@ -32,6 +32,8 @@ MainWindow::MainWindow(QString exepath, bool statupInTray, bool allowMultipleIns
3232 ui->setupUi (this );
3333 bool aboutToQuit = false ;
3434
35+ ui->tabhost_legacy ->hide ();
36+
3537 m_exepath = exepath;
3638 m_startupInTraySwitch = statupInTray;
3739
@@ -162,25 +164,42 @@ MainWindow::MainWindow(QString exepath, bool statupInTray, bool allowMultipleIns
162164 RunDiagnosticChecks ();
163165 });
164166
165- ui->tabbar ->setAnimatePageChange (true );
166- ui->tabbar ->setCustomStackWidget (ui->tabhost );
167- ui->tabbar ->setDetachCustomStackedWidget (true );
168- ui->tabbar ->addPage (" Bass/Clarity" );
169- ui->tabbar ->addPage (" Dynamic" );
170- ui->tabbar ->addPage (" Surround" );
171- ui->tabbar ->addPage (" Equalizer" );
172- ui->tabbar ->addPage (" Compressor" );
173- ui->tabbar ->addPage (" Volume" );
174- ui->tabbar ->addPage (" Miscellaneous" );
175- ui->frame ->setStyleSheet (QString (" QFrame#frame{background-color: %1;}" ).arg (qApp->palette ().window ().color ().lighter ().name ()));
176- ui->tabhost ->setStyleSheet (QString (" QWidget#tabhostPage1,QWidget#tabhostPage2,QWidget#tabhostPage3,QWidget#tabhostPage4,QWidget#tabhostPage5,QWidget#tabhostPage6,QWidget#tabhostPage7{background-color: %1;}" ).arg (qApp->palette ().window ().color ().lighter ().name ()));
177- ui->tabbar ->redrawTabBar ();
167+ if (m_appwrapper->getLegacyTabs ())
168+ InitializeLegacyTabs ();
169+ else {
170+ ui->tabbar ->setAnimatePageChange (true );
171+ ui->tabbar ->setCustomStackWidget (ui->tabhost );
172+ ui->tabbar ->setDetachCustomStackedWidget (true );
173+ ui->tabbar ->addPage (" Bass/Clarity" );
174+ ui->tabbar ->addPage (" Dynamic" );
175+ ui->tabbar ->addPage (" Surround" );
176+ ui->tabbar ->addPage (" Equalizer" );
177+ ui->tabbar ->addPage (" Compressor" );
178+ ui->tabbar ->addPage (" Volume" );
179+ ui->tabbar ->addPage (" Miscellaneous" );
180+ ui->frame ->setStyleSheet (QString (" QFrame#frame{background-color: %1;}" ).arg (qApp->palette ().window ().color ().lighter ().name ()));
181+ ui->tabhost ->setStyleSheet (QString (" QWidget#tabhostPage1,QWidget#tabhostPage2,QWidget#tabhostPage3,QWidget#tabhostPage4,QWidget#tabhostPage5,QWidget#tabhostPage6,QWidget#tabhostPage7{background-color: %1;}" ).arg (qApp->palette ().window ().color ().lighter ().name ()));
182+ ui->tabbar ->redrawTabBar ();
183+ }
178184}
179185
180186MainWindow::~MainWindow ()
181187{
182188 delete ui;
183189}
190+ void MainWindow::InitializeLegacyTabs (){
191+ if (!ui->frame ->isVisible ())
192+ return ;
193+
194+ ui->frame ->hide ();
195+ ui->tabhost_legacy ->show ();
196+ for (int i = 1 ; i <= 7 ; i++){
197+ QWidget* w = findChild<QWidget*>(QString (" tabhostPage%1" ).arg (i));
198+ replaceTab (ui->tabhost_legacy ,i - 1 , w);
199+ ui->tabhost_legacy ->widget (i - 1 )->setContentsMargins (9 ,9 ,9 ,9 );
200+ }
201+ ui->tabhost_legacy ->setCurrentIndex (0 );
202+ }
184203void MainWindow::LaunchFirstRunSetup (){
185204 FirstLaunchWizard* wiz = new FirstLaunchWizard (m_appwrapper,this );
186205 QHBoxLayout* lbLayout = new QHBoxLayout;
0 commit comments