mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-28 20:25:34 +08:00
Ref T447, info area
* force floating windows on top "allFloatingOnTop()" * slots -> normal functions * use BLACK_VERIFY to avoid "shutdown" in release build, possible reason for Ref T334
This commit is contained in:
@@ -183,17 +183,17 @@ namespace BlackGui
|
|||||||
const InfoArea area = static_cast<InfoArea>(areaIndex);
|
const InfoArea area = static_cast<InfoArea>(areaIndex);
|
||||||
switch (area)
|
switch (area)
|
||||||
{
|
{
|
||||||
case InfoAreaCockpit: return CIcons::appCockpit16();
|
case InfoAreaCockpit: return CIcons::appCockpit16();
|
||||||
case InfoAreaUsers: return CIcons::appUsers16();
|
case InfoAreaUsers: return CIcons::appUsers16();
|
||||||
case InfoAreaWeather: return CIcons::appWeather16();
|
case InfoAreaWeather: return CIcons::appWeather16();
|
||||||
case InfoAreaAtc: return CIcons::appAtc16();
|
case InfoAreaAtc: return CIcons::appAtc16();
|
||||||
case InfoAreaAircraft: return CIcons::appAircraft16();
|
case InfoAreaAircraft: return CIcons::appAircraft16();
|
||||||
case InfoAreaSettings: return CIcons::appSettings16();
|
case InfoAreaSettings: return CIcons::appSettings16();
|
||||||
case InfoAreaFlightPlan: return CIcons::appFlightPlan16();
|
case InfoAreaFlightPlan: return CIcons::appFlightPlan16();
|
||||||
case InfoAreaTextMessages: return CIcons::appTextMessages16();
|
case InfoAreaSimulator: return CIcons::appSimulator16();
|
||||||
case InfoAreaSimulator: return CIcons::appSimulator16();
|
case InfoAreaMapping: return CIcons::appMappings16();
|
||||||
case InfoAreaMapping: return CIcons::appMappings16();
|
case InfoAreaLog: return CIcons::appLog16();
|
||||||
case InfoAreaLog: return CIcons::appLog16();
|
case InfoAreaTextMessages: return CIcons::appTextMessages16();
|
||||||
case InfoAreaInterpolation: return CIcons::appInterpolation16();
|
case InfoAreaInterpolation: return CIcons::appInterpolation16();
|
||||||
default: return CIcons::empty();
|
default: return CIcons::empty();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ namespace BlackGui
|
|||||||
//! Display console
|
//! Display console
|
||||||
void displayConsole();
|
void displayConsole();
|
||||||
|
|
||||||
public slots:
|
|
||||||
//! Toggle floating of given area
|
//! Toggle floating of given area
|
||||||
void toggleFloating(InfoArea infoArea) { CInfoArea::toggleFloatingByIndex(static_cast<int>(infoArea)); }
|
void toggleFloating(InfoArea infoArea) { CInfoArea::toggleFloatingByIndex(static_cast<int>(infoArea)); }
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
const CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(i);
|
const CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(i);
|
||||||
const QString t = dw->windowTitleBackup();
|
const QString t = dw->windowTitleBackup();
|
||||||
const QPixmap pm = indexToPixmap(i);
|
const QPixmap pm = this->indexToPixmap(i);
|
||||||
QAction *toggleFloatingMenuAction = new QAction(menu);
|
QAction *toggleFloatingMenuAction = new QAction(menu);
|
||||||
toggleFloatingMenuAction->setObjectName(QString(t).append("ToggleFloatingAction"));
|
toggleFloatingMenuAction->setObjectName(QString(t).append("ToggleFloatingAction"));
|
||||||
toggleFloatingMenuAction->setIconText(t);
|
toggleFloatingMenuAction->setIconText(t);
|
||||||
@@ -125,16 +125,16 @@ namespace BlackGui
|
|||||||
toggleFloatingMenuAction->setChecked(!dw->isFloating());
|
toggleFloatingMenuAction->setChecked(!dw->isFloating());
|
||||||
subMenuToggleFloat->addAction(toggleFloatingMenuAction);
|
subMenuToggleFloat->addAction(toggleFloatingMenuAction);
|
||||||
c = connect(toggleFloatingMenuAction, SIGNAL(toggled(bool)), signalMapperToggleFloating, SLOT(map()));
|
c = connect(toggleFloatingMenuAction, SIGNAL(toggled(bool)), signalMapperToggleFloating, SLOT(map()));
|
||||||
Q_ASSERT(c);
|
BLACK_VERIFY_X(c, Q_FUNC_INFO, "Cannot map floating action"); // do not make that shutdown reason in a release build
|
||||||
signalMapperToggleFloating->setMapping(toggleFloatingMenuAction, i);
|
signalMapperToggleFloating->setMapping(toggleFloatingMenuAction, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// new syntax not yet possible because of overloaded signal
|
// new syntax not yet possible because of overloaded signal
|
||||||
c = connect(signalMapperToggleFloating, SIGNAL(mapped(int)), this, SLOT(toggleFloatingByIndex(int)));
|
c = connect(signalMapperToggleFloating, static_cast<void (QSignalMapper::*)(int)>(&QSignalMapper::mapped), this, &CInfoArea::toggleFloatingByIndex);
|
||||||
Q_ASSERT(c);
|
BLACK_VERIFY_X(c, Q_FUNC_INFO, "Cannot connect mapper"); // do not make that shutdown reason in a release build
|
||||||
|
|
||||||
menu->addMenu(subMenuDisplay);
|
menu->addMenu(subMenuDisplay);
|
||||||
menu->addMenu(subMenuToggleFloat);
|
if (c) { menu->addMenu(subMenuToggleFloat); }
|
||||||
menu->addMenu(subMenuResetPositions);
|
menu->addMenu(subMenuResetPositions);
|
||||||
menu->addMenu(subMenuRestore);
|
menu->addMenu(subMenuRestore);
|
||||||
|
|
||||||
@@ -339,11 +339,21 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||||
{
|
{
|
||||||
if (dw->isFloating()) continue;
|
if (dw->isFloating()) { continue; }
|
||||||
dw->toggleFloating();
|
dw->toggleFloating();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInfoArea::allFloatingOnTop()
|
||||||
|
{
|
||||||
|
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||||
|
{
|
||||||
|
const bool f = dw->isFloating();
|
||||||
|
CGuiUtility::stayOnTop(f, dw);
|
||||||
|
if (f) { dw->show(); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CInfoArea::toggleFloatingWholeInfoArea()
|
void CInfoArea::toggleFloatingWholeInfoArea()
|
||||||
{
|
{
|
||||||
this->setWholeInfoAreaFloating(!m_infoAreaFloating);
|
this->setWholeInfoAreaFloating(!m_infoAreaFloating);
|
||||||
|
|||||||
@@ -93,17 +93,6 @@ namespace BlackGui
|
|||||||
//! Docked area indexes
|
//! Docked area indexes
|
||||||
QList<int> getAreaIndexesDockedOrFloating(bool floating) const;
|
QList<int> getAreaIndexesDockedOrFloating(bool floating) const;
|
||||||
|
|
||||||
signals:
|
|
||||||
//! Tab bar changed
|
|
||||||
void changedInfoAreaTabBarIndex(int index);
|
|
||||||
|
|
||||||
//! Status of info area changed
|
|
||||||
void changedInfoAreaStatus(int currentTabIndex, QList<int> dockedAreas, QList<int> floatingAreas);
|
|
||||||
|
|
||||||
//! Whole info area floating
|
|
||||||
void changedWholeInfoAreaFloating(bool floating);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
//! Dock all widgets
|
//! Dock all widgets
|
||||||
void dockAllWidgets();
|
void dockAllWidgets();
|
||||||
|
|
||||||
@@ -113,6 +102,9 @@ namespace BlackGui
|
|||||||
//! All widgets floating
|
//! All widgets floating
|
||||||
void floatAllWidgets();
|
void floatAllWidgets();
|
||||||
|
|
||||||
|
//! All floating info areas on top
|
||||||
|
void allFloatingOnTop();
|
||||||
|
|
||||||
//! Toggle dock / floating of the whole info area
|
//! Toggle dock / floating of the whole info area
|
||||||
virtual void toggleFloatingWholeInfoArea();
|
virtual void toggleFloatingWholeInfoArea();
|
||||||
|
|
||||||
@@ -158,6 +150,16 @@ namespace BlackGui
|
|||||||
//! Display status messages in all info areas (according their state)
|
//! Display status messages in all info areas (according their state)
|
||||||
void displayStatusMessages(const BlackMisc::CStatusMessageList &statusMessages);
|
void displayStatusMessages(const BlackMisc::CStatusMessageList &statusMessages);
|
||||||
|
|
||||||
|
signals:
|
||||||
|
//! Tab bar changed
|
||||||
|
void changedInfoAreaTabBarIndex(int index);
|
||||||
|
|
||||||
|
//! Status of info area changed
|
||||||
|
void changedInfoAreaStatus(int currentTabIndex, QList<int> dockedAreas, QList<int> floatingAreas);
|
||||||
|
|
||||||
|
//! Whole info area floating
|
||||||
|
void changedWholeInfoAreaFloating(bool floating);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//! Constructor
|
//! Constructor
|
||||||
explicit CInfoArea(QWidget *parent = nullptr);
|
explicit CInfoArea(QWidget *parent = nullptr);
|
||||||
|
|||||||
Reference in New Issue
Block a user