mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-21 04:45:31 +08:00
Disable minimize/maximize/close buttons of simulator settings windows
This commit is contained in:
@@ -698,6 +698,17 @@ namespace BlackGui
|
||||
return mw;
|
||||
}
|
||||
|
||||
void CGuiUtility::disableMinMaxCloseButtons(QWidget *window)
|
||||
{
|
||||
if (!window->windowFlags().testFlag(Qt::CustomizeWindowHint))
|
||||
{
|
||||
window->setWindowFlag(Qt::CustomizeWindowHint);
|
||||
window->setWindowFlag(Qt::WindowTitleHint);
|
||||
}
|
||||
window->setWindowFlag(Qt::WindowMinMaxButtonsHint, false);
|
||||
window->setWindowFlag(Qt::WindowCloseButtonHint, false);
|
||||
}
|
||||
|
||||
QGraphicsOpacityEffect *CGuiUtility::fadeInWidget(int durationMs, QWidget *widget, double startValue, double endValue)
|
||||
{
|
||||
// http://stackoverflow.com/questions/19087822/how-to-make-qt-widgets-fade-in-or-fade-out#
|
||||
|
||||
@@ -222,6 +222,9 @@ namespace BlackGui
|
||||
static bool isDialog(const QWidget *widget);
|
||||
//! @}
|
||||
|
||||
//! Disable close button on window
|
||||
static void disableMinMaxCloseButtons(QWidget *window);
|
||||
|
||||
//! Fade in a widget
|
||||
static QGraphicsOpacityEffect *fadeInWidget(int durationMs, QWidget *widget, double startValue = 0.0, double endValue = 1.0);
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ namespace BlackSimPlugin
|
||||
ui(new Ui::CSimulatorEmulatedConfigWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
CGuiUtility::disableMinMaxCloseButtons(this);
|
||||
}
|
||||
|
||||
CSimulatorEmulatedConfigWidget::~CSimulatorEmulatedConfigWidget()
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace BlackSimPlugin
|
||||
ui(new Ui::CSimulatorFlightgearConfigWindow)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
CGuiUtility::disableMinMaxCloseButtons(this);
|
||||
ui->comp_SettingsFGSwiftBus->setDefaultP2PAddress(m_fgswiftbusServerSetting.getDefault());
|
||||
ui->comp_SettingsFGSwiftBus->set(m_fgswiftbusServerSetting.getThreadLocal());
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace BlackSimPlugin
|
||||
ui->comp_FsxSettings->setSimulator(m_simulator);
|
||||
connect(ui->bb_OkCancel, &QDialogButtonBox::rejected, this, &QWidget::close);
|
||||
this->setWindowTitle(m_simulator.toQString(true) + " plugin configuration");
|
||||
CGuiUtility::disableMinMaxCloseButtons(this);
|
||||
}
|
||||
|
||||
CSimulatorFsxConfigWindow::~CSimulatorFsxConfigWindow()
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace BlackSimPlugin
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->comp_SettingsXSwiftBus->setDefaultP2PAddress(m_xSwiftBusServerSettings.getDefault().getDBusServerAddressQt());
|
||||
CGuiUtility::disableMinMaxCloseButtons(this);
|
||||
|
||||
const CXSwiftBusSettings defaultSettings = TXSwiftBusSettings::defaultValue();
|
||||
ui->sb_MaxAircraft->setMaximum(defaultSettings.getMaxPlanes() * 2);
|
||||
|
||||
Reference in New Issue
Block a user