diff --git a/src/blackgui/components/maininfoareacomponent.cpp b/src/blackgui/components/maininfoareacomponent.cpp index cb622a088..d6ec6e7a8 100644 --- a/src/blackgui/components/maininfoareacomponent.cpp +++ b/src/blackgui/components/maininfoareacomponent.cpp @@ -183,17 +183,17 @@ namespace BlackGui const InfoArea area = static_cast(areaIndex); switch (area) { - case InfoAreaCockpit: return CIcons::appCockpit16(); - case InfoAreaUsers: return CIcons::appUsers16(); - case InfoAreaWeather: return CIcons::appWeather16(); - case InfoAreaAtc: return CIcons::appAtc16(); - case InfoAreaAircraft: return CIcons::appAircraft16(); - case InfoAreaSettings: return CIcons::appSettings16(); + case InfoAreaCockpit: return CIcons::appCockpit16(); + case InfoAreaUsers: return CIcons::appUsers16(); + case InfoAreaWeather: return CIcons::appWeather16(); + case InfoAreaAtc: return CIcons::appAtc16(); + case InfoAreaAircraft: return CIcons::appAircraft16(); + case InfoAreaSettings: return CIcons::appSettings16(); case InfoAreaFlightPlan: return CIcons::appFlightPlan16(); - case InfoAreaTextMessages: return CIcons::appTextMessages16(); - case InfoAreaSimulator: return CIcons::appSimulator16(); - case InfoAreaMapping: return CIcons::appMappings16(); - case InfoAreaLog: return CIcons::appLog16(); + case InfoAreaSimulator: return CIcons::appSimulator16(); + case InfoAreaMapping: return CIcons::appMappings16(); + case InfoAreaLog: return CIcons::appLog16(); + case InfoAreaTextMessages: return CIcons::appTextMessages16(); case InfoAreaInterpolation: return CIcons::appInterpolation16(); default: return CIcons::empty(); } diff --git a/src/blackgui/components/maininfoareacomponent.h b/src/blackgui/components/maininfoareacomponent.h index 042dfd385..7fcbbeae4 100644 --- a/src/blackgui/components/maininfoareacomponent.h +++ b/src/blackgui/components/maininfoareacomponent.h @@ -113,7 +113,6 @@ namespace BlackGui //! Display console void displayConsole(); - public slots: //! Toggle floating of given area void toggleFloating(InfoArea infoArea) { CInfoArea::toggleFloatingByIndex(static_cast(infoArea)); } diff --git a/src/blackgui/infoarea.cpp b/src/blackgui/infoarea.cpp index 437cc25b1..896260f18 100644 --- a/src/blackgui/infoarea.cpp +++ b/src/blackgui/infoarea.cpp @@ -115,7 +115,7 @@ namespace BlackGui { const CDockWidgetInfoArea *dw = m_dockWidgetInfoAreas.at(i); const QString t = dw->windowTitleBackup(); - const QPixmap pm = indexToPixmap(i); + const QPixmap pm = this->indexToPixmap(i); QAction *toggleFloatingMenuAction = new QAction(menu); toggleFloatingMenuAction->setObjectName(QString(t).append("ToggleFloatingAction")); toggleFloatingMenuAction->setIconText(t); @@ -125,16 +125,16 @@ namespace BlackGui toggleFloatingMenuAction->setChecked(!dw->isFloating()); subMenuToggleFloat->addAction(toggleFloatingMenuAction); 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); } // new syntax not yet possible because of overloaded signal - c = connect(signalMapperToggleFloating, SIGNAL(mapped(int)), this, SLOT(toggleFloatingByIndex(int))); - Q_ASSERT(c); + c = connect(signalMapperToggleFloating, static_cast(&QSignalMapper::mapped), this, &CInfoArea::toggleFloatingByIndex); + 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(subMenuToggleFloat); + if (c) { menu->addMenu(subMenuToggleFloat); } menu->addMenu(subMenuResetPositions); menu->addMenu(subMenuRestore); @@ -339,11 +339,21 @@ namespace BlackGui { for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas) { - if (dw->isFloating()) continue; + if (dw->isFloating()) { continue; } 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() { this->setWholeInfoAreaFloating(!m_infoAreaFloating); diff --git a/src/blackgui/infoarea.h b/src/blackgui/infoarea.h index 0ca0db530..9cc2d75b7 100644 --- a/src/blackgui/infoarea.h +++ b/src/blackgui/infoarea.h @@ -93,17 +93,6 @@ namespace BlackGui //! Docked area indexes QList getAreaIndexesDockedOrFloating(bool floating) const; - signals: - //! Tab bar changed - void changedInfoAreaTabBarIndex(int index); - - //! Status of info area changed - void changedInfoAreaStatus(int currentTabIndex, QList dockedAreas, QList floatingAreas); - - //! Whole info area floating - void changedWholeInfoAreaFloating(bool floating); - - public slots: //! Dock all widgets void dockAllWidgets(); @@ -113,6 +102,9 @@ namespace BlackGui //! All widgets floating void floatAllWidgets(); + //! All floating info areas on top + void allFloatingOnTop(); + //! Toggle dock / floating of the whole info area virtual void toggleFloatingWholeInfoArea(); @@ -158,6 +150,16 @@ namespace BlackGui //! Display status messages in all info areas (according their state) void displayStatusMessages(const BlackMisc::CStatusMessageList &statusMessages); + signals: + //! Tab bar changed + void changedInfoAreaTabBarIndex(int index); + + //! Status of info area changed + void changedInfoAreaStatus(int currentTabIndex, QList dockedAreas, QList floatingAreas); + + //! Whole info area floating + void changedWholeInfoAreaFloating(bool floating); + protected: //! Constructor explicit CInfoArea(QWidget *parent = nullptr);