mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-30 05:51:23 +08:00
GUI fixes
* added missing support for weather component in main info area * closing the navigator needs to display main window (otherwise no windows is visible)
This commit is contained in:
@@ -70,6 +70,11 @@ namespace BlackGui
|
|||||||
return ui->comp_Settings;
|
return ui->comp_Settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CWeatherComponent *CMainInfoAreaComponent::getWeatherComponent()
|
||||||
|
{
|
||||||
|
return ui->comp_Weather;
|
||||||
|
}
|
||||||
|
|
||||||
CLogComponent *CMainInfoAreaComponent::getLogComponent()
|
CLogComponent *CMainInfoAreaComponent::getLogComponent()
|
||||||
{
|
{
|
||||||
return ui->comp_Log;
|
return ui->comp_Log;
|
||||||
@@ -117,6 +122,7 @@ namespace BlackGui
|
|||||||
case InfoAreaMappings:
|
case InfoAreaMappings:
|
||||||
case InfoAreaSettings:
|
case InfoAreaSettings:
|
||||||
case InfoAreaTextMessages:
|
case InfoAreaTextMessages:
|
||||||
|
case InfoAreaWeather:
|
||||||
return QSize(600, 400);
|
return QSize(600, 400);
|
||||||
break;
|
break;
|
||||||
case InfoAreaFlightPlan:
|
case InfoAreaFlightPlan:
|
||||||
|
|||||||
@@ -93,6 +93,9 @@ namespace BlackGui
|
|||||||
//! Settings
|
//! Settings
|
||||||
CSettingsComponent *getSettingsComponent();
|
CSettingsComponent *getSettingsComponent();
|
||||||
|
|
||||||
|
//! Weather component
|
||||||
|
CWeatherComponent *getWeatherComponent();
|
||||||
|
|
||||||
//! Log messages
|
//! Log messages
|
||||||
CLogComponent *getLogComponent();
|
CLogComponent *getLogComponent();
|
||||||
|
|
||||||
|
|||||||
@@ -106,6 +106,12 @@ namespace BlackGui
|
|||||||
this->adjustNavigatorSize(gridLayout);
|
this->adjustNavigatorSize(gridLayout);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CNavigatorDialog::reject()
|
||||||
|
{
|
||||||
|
this->hide();
|
||||||
|
emit navigatorClosed();
|
||||||
|
}
|
||||||
|
|
||||||
void CNavigatorDialog::toggleFrameless()
|
void CNavigatorDialog::toggleFrameless()
|
||||||
{
|
{
|
||||||
this->setFrameless(!this->isFrameless());
|
this->setFrameless(!this->isFrameless());
|
||||||
@@ -287,7 +293,7 @@ namespace BlackGui
|
|||||||
a->setData("1c");
|
a->setData("1c");
|
||||||
a = contextMenu->addAction(CIcons::resize16(), "2 columns", this, &CNavigatorDialog::ps_changeLayout);
|
a = contextMenu->addAction(CIcons::resize16(), "2 columns", this, &CNavigatorDialog::ps_changeLayout);
|
||||||
a->setData("2c");
|
a->setData("2c");
|
||||||
QString frameLessActionText = this->isFrameless() ? "Normal window" : "Frameless";
|
const QString frameLessActionText = this->isFrameless() ? "Normal window" : "Frameless";
|
||||||
contextMenu->addAction(BlackMisc::CIcons::tableSheet16(), frameLessActionText, this, SLOT(toggleFrameless()));
|
contextMenu->addAction(BlackMisc::CIcons::tableSheet16(), frameLessActionText, this, SLOT(toggleFrameless()));
|
||||||
contextMenu->addAction("Adjust margins", this, &CNavigatorDialog::ps_dummy);
|
contextMenu->addAction("Adjust margins", this, &CNavigatorDialog::ps_dummy);
|
||||||
contextMenu->addAction(this->m_marginMenuAction);
|
contextMenu->addAction(this->m_marginMenuAction);
|
||||||
|
|||||||
@@ -55,6 +55,13 @@ namespace BlackGui
|
|||||||
//! Navigator
|
//! Navigator
|
||||||
void buildNavigator(int columns);
|
void buildNavigator(int columns);
|
||||||
|
|
||||||
|
//! Called when dialog is closed
|
||||||
|
virtual void reject() override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
//! Navigator closed
|
||||||
|
void navigatorClosed();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
//! Toggle frameless mode
|
//! Toggle frameless mode
|
||||||
void toggleFrameless();
|
void toggleFrameless();
|
||||||
|
|||||||
@@ -383,6 +383,11 @@ void SwiftGuiStd::ps_showNormal()
|
|||||||
this->showNormalModeChecked();
|
this->showNormalModeChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SwiftGuiStd::ps_navigatorClosed()
|
||||||
|
{
|
||||||
|
this->showNormal();
|
||||||
|
}
|
||||||
|
|
||||||
void SwiftGuiStd::playNotifcationSound(CNotificationSounds::Notification notification) const
|
void SwiftGuiStd::playNotifcationSound(CNotificationSounds::Notification notification) const
|
||||||
{
|
{
|
||||||
if (!this->m_contextAudioAvailable) { return; }
|
if (!this->m_contextAudioAvailable) { return; }
|
||||||
|
|||||||
@@ -76,13 +76,13 @@ public:
|
|||||||
static QString getLogCategory() { return "swift.gui.stdgui"; }
|
static QString getLogCategory() { return "swift.gui.stdgui"; }
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
//! Main info area has changed
|
||||||
//! \remarks using widget pointer allows the component itself to identify if it is current
|
//! \remarks using widget pointer allows the component itself to identify if it is current
|
||||||
void currentMainInfoAreaChanged(const QWidget *currentWidget);
|
void currentMainInfoAreaChanged(const QWidget *currentWidget);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//! \name QMainWindow events
|
//! \name QMainWindow events
|
||||||
//! @[
|
//! @{
|
||||||
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
virtual void mousePressEvent(QMouseEvent *event) override;
|
virtual void mousePressEvent(QMouseEvent *event) override;
|
||||||
virtual void closeEvent(QCloseEvent *event) override;
|
virtual void closeEvent(QCloseEvent *event) override;
|
||||||
@@ -252,6 +252,9 @@ private slots:
|
|||||||
|
|
||||||
//! Show window normal
|
//! Show window normal
|
||||||
void ps_showNormal();
|
void ps_showNormal();
|
||||||
|
|
||||||
|
//! Navigator dialog has been closed
|
||||||
|
void ps_navigatorClosed();
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pop_macro("interface")
|
#pragma pop_macro("interface")
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ void SwiftGuiStd::initGuiSignals()
|
|||||||
connect(ui->menu_WindowMinimize, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
connect(ui->menu_WindowMinimize, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
connect(ui->menu_WindowToggleOnTop, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
connect(ui->menu_WindowToggleOnTop, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
connect(ui->menu_WindowToggleNavigator, &QAction::triggered, this->m_navigator.data(), &CNavigatorDialog::toggleNavigator);
|
connect(ui->menu_WindowToggleNavigator, &QAction::triggered, this->m_navigator.data(), &CNavigatorDialog::toggleNavigator);
|
||||||
|
connect(this->m_navigator.data(), &CNavigatorDialog::navigatorClosed, this, &SwiftGuiStd::ps_navigatorClosed);
|
||||||
connect(ui->menu_InternalsPage, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
connect(ui->menu_InternalsPage, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||||
|
|
||||||
// command line / text messages
|
// command line / text messages
|
||||||
|
|||||||
Reference in New Issue
Block a user