mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +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 "configurationwizard.h"
|
||||||
|
#include "blackgui/guiapplication.h"
|
||||||
#include "ui_configurationwizard.h"
|
#include "ui_configurationwizard.h"
|
||||||
|
|
||||||
namespace BlackGui
|
namespace BlackGui
|
||||||
@@ -40,6 +41,11 @@ namespace BlackGui
|
|||||||
|
|
||||||
connect(this, &QWizard::currentIdChanged, this, &CConfigurationWizard::wizardCurrentIdChanged);
|
connect(this, &QWizard::currentIdChanged, this, &CConfigurationWizard::wizardCurrentIdChanged);
|
||||||
connect(this, &QWizard::customButtonClicked, this, &CConfigurationWizard::clickedCustomButton);
|
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()
|
CConfigurationWizard::~CConfigurationWizard()
|
||||||
@@ -65,6 +71,7 @@ namespace BlackGui
|
|||||||
m_skipped = false; // reset
|
m_skipped = false; // reset
|
||||||
Q_UNUSED(skipped);
|
Q_UNUSED(skipped);
|
||||||
|
|
||||||
|
this->setParentOpacity(0.5);
|
||||||
const QWizardPage *page = this->currentPage();
|
const QWizardPage *page = this->currentPage();
|
||||||
if (backward && page == ui->wp_CopyCaches)
|
if (backward && page == ui->wp_CopyCaches)
|
||||||
{
|
{
|
||||||
@@ -92,5 +99,18 @@ namespace BlackGui
|
|||||||
this->m_skipped = false;
|
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
|
||||||
} // ns
|
} // ns
|
||||||
|
|||||||
@@ -58,6 +58,12 @@ namespace BlackGui
|
|||||||
//! Custom button was clicked
|
//! Custom button was clicked
|
||||||
void clickedCustomButton(int which);
|
void clickedCustomButton(int which);
|
||||||
|
|
||||||
|
//! Accepted or rejected
|
||||||
|
void ended();
|
||||||
|
|
||||||
|
//! Set the parent's window opacity
|
||||||
|
void setParentOpacity(qreal opacity);
|
||||||
|
|
||||||
QScopedPointer<Ui::CConfigurationWizard> ui;
|
QScopedPointer<Ui::CConfigurationWizard> ui;
|
||||||
int m_previousId = -1;
|
int m_previousId = -1;
|
||||||
int m_minId = -1;
|
int m_minId = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user