mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 14:58:33 +08:00
refs #935, set opacity of main window when wizard is active
https://dev.vatsim-germany.org/issues/935#note-5
This commit is contained in:
committed by
Mathew Sutcliffe
parent
07db0732ed
commit
53a021de78
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
|
||||
#include "configurationwizard.h"
|
||||
#include "blackgui/guiapplication.h"
|
||||
#include "ui_configurationwizard.h"
|
||||
|
||||
namespace BlackGui
|
||||
@@ -40,6 +41,11 @@ namespace BlackGui
|
||||
|
||||
connect(this, &QWizard::currentIdChanged, this, &CConfigurationWizard::wizardCurrentIdChanged);
|
||||
connect(this, &QWizard::customButtonClicked, this, &CConfigurationWizard::clickedCustomButton);
|
||||
connect(this, &QWizard::rejected, this, &CConfigurationWizard::ended);
|
||||
connect(this, &QWizard::accepted, this, &CConfigurationWizard::ended);
|
||||
|
||||
Q_ASSERT_X(sGui, Q_FUNC_INFO, "missing sGui");
|
||||
connect(this, &QWizard::helpRequested, sGui, &CGuiApplication::showHelp);
|
||||
}
|
||||
|
||||
CConfigurationWizard::~CConfigurationWizard()
|
||||
@@ -65,6 +71,7 @@ namespace BlackGui
|
||||
m_skipped = false; // reset
|
||||
Q_UNUSED(skipped);
|
||||
|
||||
this->setParentOpacity(0.5);
|
||||
const QWizardPage *page = this->currentPage();
|
||||
if (backward && page == ui->wp_CopyCaches)
|
||||
{
|
||||
@@ -92,5 +99,18 @@ namespace BlackGui
|
||||
this->m_skipped = false;
|
||||
}
|
||||
}
|
||||
|
||||
void CConfigurationWizard::ended()
|
||||
{
|
||||
this->setParentOpacity(1.0);
|
||||
}
|
||||
|
||||
void CConfigurationWizard::setParentOpacity(qreal opacity)
|
||||
{
|
||||
QWidget *parent = this->parentWidget();
|
||||
if (!parent) { return; }
|
||||
if (parent->windowOpacity() == opacity) { return; }
|
||||
parent->setWindowOpacity(opacity);
|
||||
}
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user