mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-29 20:55:42 +08:00
refs #503, thanks to RW`s research, changed to non-QDockwidget navigator
* QDialog based navigator * Removed no longer used info area and navigator dock widget * fixed style sheet * added some space which can be used to drag navigator when frameless * callback when frameless is toggled Status: https://dev.vatsim-germany.org/issues/503#note-10
This commit is contained in:
@@ -22,7 +22,6 @@
|
||||
#include "blackmisc/logmessage.h"
|
||||
#include "blackmisc/audio/notificationsounds.h"
|
||||
#include <QMouseEvent>
|
||||
#include <QMainWindow>
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackSound;
|
||||
@@ -88,7 +87,6 @@ void SwiftGuiStd::performGracefulShutdown()
|
||||
|
||||
// clean up GUI
|
||||
this->ui->comp_MainInfoArea->dockAllWidgets();
|
||||
this->ui->comp_InvisibleInfoArea->dockAllWidgets();
|
||||
|
||||
// allow some other parts to react
|
||||
QApplication::processEvents(QEventLoop::AllEvents, 100);
|
||||
@@ -203,7 +201,6 @@ void SwiftGuiStd::ps_displayStatusMessageInGui(const CStatusMessage &statusMessa
|
||||
|
||||
// main info areas
|
||||
this->ui->comp_MainInfoArea->displayStatusMessage(statusMessage);
|
||||
this->ui->comp_InvisibleInfoArea->displayStatusMessage(statusMessage);
|
||||
|
||||
// list
|
||||
this->ui->comp_MainInfoArea->getLogComponent()->appendStatusMessageToList(statusMessage);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "blackcore/data/globalsetup.h"
|
||||
#include "blackgui/components/enableforruntime.h"
|
||||
#include "blackgui/components/maininfoareacomponent.h"
|
||||
#include "blackgui/components/navigatordialog.h"
|
||||
#include "blackgui/transpondermodeselector.h"
|
||||
#include "blackgui/models/atcstationlistmodel.h"
|
||||
#include "blackgui/models/serverlistmodel.h"
|
||||
@@ -110,6 +111,8 @@ protected:
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::SwiftGuiStd> ui;
|
||||
// if I pass the parent, the dialog is always center over the parent
|
||||
QScopedPointer<BlackGui::Components::CNavigatorDialog> m_navigator{new BlackGui::Components::CNavigatorDialog()};
|
||||
bool m_init = false;
|
||||
BlackGui::CManagedStatusBar m_statusBar;
|
||||
BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui };
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pg_MainInfoArea">
|
||||
<layout class="QVBoxLayout" name="vl_MainInfoArea">
|
||||
@@ -192,28 +192,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="pg_InvisibleAreas">
|
||||
<layout class="QVBoxLayout" name="vl_InvisibleArea">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="BlackGui::Components::CInvisibleInfoAreaComponent" name="comp_InvisibleInfoArea" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
@@ -243,7 +221,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>350</width>
|
||||
<height>21</height>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@@ -605,12 +583,6 @@
|
||||
<header>blackgui/components/internalscomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::Components::CInvisibleInfoAreaComponent</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>blackgui/components/invisibleinfoareacomponent.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>BlackGui::COverlayMessagesFrame</class>
|
||||
<extends>QFrame</extends>
|
||||
|
||||
@@ -81,15 +81,12 @@ void SwiftGuiStd::init(const CRuntimeConfig &runtimeConfig)
|
||||
this->ui->dw_InfoBarStatus->setPreferredSizeWhenFloating(this->ui->dw_InfoBarStatus->size()); // set floating size
|
||||
|
||||
// navigator
|
||||
CNavigatorDockWidget *nav = this->ui->comp_InvisibleInfoArea->getNavigatorComponent();
|
||||
Q_ASSERT(nav);
|
||||
nav->addAction(this->getToggleWindowVisibilityAction(nav));
|
||||
nav->addActions(this->ui->comp_MainInfoArea->getInfoAreaToggleFloatingActions(nav));
|
||||
nav->addAction(this->getWindowNormalAction(nav));
|
||||
nav->addAction(this->getWindowMinimizeAction(nav));
|
||||
nav->addAction(this->getToggleStayOnTopAction(nav));
|
||||
|
||||
this->ui->comp_InvisibleInfoArea->getNavigatorComponent()->buildNavigator(1);
|
||||
this->m_navigator->addAction(this->getToggleWindowVisibilityAction(this->m_navigator.data()));
|
||||
this->m_navigator->addActions(this->ui->comp_MainInfoArea->getInfoAreaToggleFloatingActions(this->m_navigator.data()));
|
||||
this->m_navigator->addAction(this->getWindowNormalAction(this->m_navigator.data()));
|
||||
this->m_navigator->addAction(this->getWindowMinimizeAction(this->m_navigator.data()));
|
||||
this->m_navigator->addAction(this->getToggleStayOnTopAction(this->m_navigator.data()));
|
||||
this->m_navigator->buildNavigator(1);
|
||||
|
||||
// wire GUI signals
|
||||
this->initGuiSignals();
|
||||
@@ -181,7 +178,7 @@ void SwiftGuiStd::initGuiSignals()
|
||||
connect(this->ui->menu_WindowFont, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowMinimize, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowToggleOnTop, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_WindowToggleNavigator, &QAction::triggered, this->ui->comp_InvisibleInfoArea, &CInvisibleInfoAreaComponent::toggleNavigator);
|
||||
connect(this->ui->menu_WindowToggleNavigator, &QAction::triggered, this->m_navigator.data(), &CNavigatorDialog::toggleNavigator);
|
||||
|
||||
connect(this->ui->menu_InternalsCompileInfo, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
connect(this->ui->menu_InternalsEnvVars, &QAction::triggered, this, &SwiftGuiStd::ps_onMenuClicked);
|
||||
|
||||
Reference in New Issue
Block a user