diff --git a/src/blackgui/components/atcstationcomponent.cpp b/src/blackgui/components/atcstationcomponent.cpp index 2e7ab5aee..a504a143b 100644 --- a/src/blackgui/components/atcstationcomponent.cpp +++ b/src/blackgui/components/atcstationcomponent.cpp @@ -67,7 +67,6 @@ namespace BlackGui // set station mode this->ui->tvp_AtcStationsOnline->setStationMode(CAtcStationListModel::StationsOnline); this->ui->tvp_AtcStationsBooked->setStationMode(CAtcStationListModel::StationsBooked); - this->ui->tvp_AtcStationsBooked->setResizeMode(CAtcStationView::ResizingOnce); // header this->ui->tvp_AtcStationsOnlineTree->setHeaderHidden(true); @@ -146,11 +145,12 @@ namespace BlackGui // update if (this->m_timestampOnlineStationsChanged > this->m_timestampLastReadOnlineStations) { - this->ui->tvp_AtcStationsOnline->updateContainerMaybeAsync( + const CAtcStationList onlineStations = // test: filter by frequency, see if this is better // sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidVoiceRoom() - sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidFrequency() - ); + sGui->getIContextNetwork()->getAtcStationsOnline().stationsWithValidFrequency(); + + this->ui->tvp_AtcStationsOnline->updateContainerMaybeAsync(onlineStations); this->m_timestampLastReadOnlineStations = QDateTime::currentDateTimeUtc(); this->m_timestampOnlineStationsChanged = this->m_timestampLastReadOnlineStations; this->updateTreeView(); @@ -165,6 +165,7 @@ namespace BlackGui void CAtcStationComponent::changedAtcStationOnlineConnectionStatus(const CAtcStation &station, bool added) { + // trick here is, we want to display a station ASAP this->ui->tvp_AtcStationsOnline->changedAtcStationConnectionStatus(station, added); } @@ -281,8 +282,8 @@ namespace BlackGui void CAtcStationComponent::updateTreeView() { - // EXPERIMENTAL CODE - //! \todo change model so we can directly use hierarchies + // + //! \todo EXPERIMENTAL CODE: change model so we can directly use hierarchies QAbstractItemModel *old = (this->ui->tvp_AtcStationsOnlineTree->model()); this->ui->tvp_AtcStationsOnlineTree->setModel( this->ui->tvp_AtcStationsOnline->derivedModel()->toAtcGroupModel() diff --git a/src/blackgui/components/logcomponent.cpp b/src/blackgui/components/logcomponent.cpp index d13276f94..e93e01cd3 100644 --- a/src/blackgui/components/logcomponent.cpp +++ b/src/blackgui/components/logcomponent.cpp @@ -70,6 +70,11 @@ namespace BlackGui if (attention) { emit requestAttention(); } } + void CLogComponent::showDetails(bool details) + { + ui->form_StatusMessage->setVisible(details); + } + void CLogComponent::appendStatusMessageToConsole(const CStatusMessage &statusMessage) { if (statusMessage.isEmpty()) return; diff --git a/src/blackgui/components/logcomponent.h b/src/blackgui/components/logcomponent.h index 2f93478a3..332f868b1 100644 --- a/src/blackgui/components/logcomponent.h +++ b/src/blackgui/components/logcomponent.h @@ -68,6 +68,9 @@ namespace BlackGui //! Display console void displayConsole(bool attention = false); + //! Show log details + void showDetails(bool details); + signals: //! Make me visible void requestAttention(); diff --git a/src/blackgui/enableforframelesswindow.cpp b/src/blackgui/enableforframelesswindow.cpp index 89999a8f2..4a18a2f92 100644 --- a/src/blackgui/enableforframelesswindow.cpp +++ b/src/blackgui/enableforframelesswindow.cpp @@ -8,10 +8,12 @@ */ #include "blackgui/enableforframelesswindow.h" +#include "blackgui/guiutility.h" #include "blackmisc/icons.h" #include "blackmisc/stringutils.h" #include "blackmisc/worker.h" + #include #include #include @@ -110,7 +112,12 @@ namespace BlackGui bool frameless = (mode == WindowFrameless); // http://stackoverflow.com/questions/18316710/frameless-and-transparent-window-qt5 this->m_widget->setAttribute(Qt::WA_NoSystemBackground, frameless); - this->m_widget->setAttribute(Qt::WA_TranslucentBackground, frameless); + + // https://bugreports.qt.io/browse/QTBUG-52206 + if (CGuiUtility::isTopLevelWidget(this->m_widget)) + { + this->m_widget->setAttribute(Qt::WA_TranslucentBackground, frameless); + } // Qt::WA_PaintOnScreen leads to a warning // setMask(QRegion(10, 10, 10, 10) would work, but requires "complex" calcs for rounded corners diff --git a/src/blackgui/guiutility.cpp b/src/blackgui/guiutility.cpp index 145371d88..4798aab2b 100644 --- a/src/blackgui/guiutility.cpp +++ b/src/blackgui/guiutility.cpp @@ -339,4 +339,9 @@ namespace BlackGui } return rows; } + + bool CGuiUtility::isTopLevelWidget(QWidget *widget) + { + return QApplication::topLevelWidgets().contains(widget); + } } // ns diff --git a/src/blackgui/guiutility.h b/src/blackgui/guiutility.h index 46c1e0a64..6e3a06bc0 100644 --- a/src/blackgui/guiutility.h +++ b/src/blackgui/guiutility.h @@ -104,6 +104,9 @@ namespace BlackGui //! Only the row part and unique (so no rows is twice in the list) static QList indexToUniqueRows(const QModelIndexList &indexes); + //! Is top level widget? + static bool isTopLevelWidget(QWidget *widget); + private: //! Constructor, use static methods only CGuiUtility() {} diff --git a/src/blackgui/views/atcstationview.cpp b/src/blackgui/views/atcstationview.cpp index b64a2040e..f36d2c65b 100644 --- a/src/blackgui/views/atcstationview.cpp +++ b/src/blackgui/views/atcstationview.cpp @@ -44,7 +44,12 @@ namespace BlackGui void CAtcStationView::changedAtcStationConnectionStatus(const CAtcStation &station, bool added) { this->m_model->changedAtcStationConnectionStatus(station, added); - this->resizeToContents(); + + // resize the first, rest will be resized with normal updates + if (this->rowCount() == 1) + { + this->fullResizeToContents(); + } } void CAtcStationView::customMenu(CMenuActions &menuActions) @@ -87,6 +92,5 @@ namespace BlackGui if (s.getCallsign().isEmpty()) { return; } emit this->requestTextMessageWidget(s.getCallsign()); } - } // namespace } // namespace diff --git a/src/blackgui/views/viewbase.cpp b/src/blackgui/views/viewbase.cpp index 86c885b9d..2bec9d759 100644 --- a/src/blackgui/views/viewbase.cpp +++ b/src/blackgui/views/viewbase.cpp @@ -806,16 +806,32 @@ namespace BlackGui void CViewBase::insert(const ObjectType &value, bool resize) { Q_ASSERT(this->m_model); - this->m_model->insert(value); - if (resize) { this->performModeBasedResizeToContent(); } + if (this->rowCount() < 1) + { + // this allows presizing + this->updateContainerMaybeAsync(ContainerType({value}), true, resize); + } + else + { + this->m_model->insert(value); + if (resize) { this->performModeBasedResizeToContent(); } + } } template void CViewBase::insert(const ContainerType &container, bool resize) { Q_ASSERT(this->m_model); - this->m_model->insert(container); - if (resize) { this->performModeBasedResizeToContent(); } + if (this->rowCount() < 1) + { + // this allows presizing + this->updateContainerMaybeAsync(container, true, resize); + } + else + { + this->m_model->insert(container); + if (resize) { this->performModeBasedResizeToContent(); } + } } template diff --git a/src/swiftcore/swiftcore.cpp b/src/swiftcore/swiftcore.cpp index 1975db956..074ff4c31 100644 --- a/src/swiftcore/swiftcore.cpp +++ b/src/swiftcore/swiftcore.cpp @@ -134,6 +134,7 @@ void CSwiftCore::initSlots() void CSwiftCore::initLogDisplay() { + this->m_mwaLogComponent->showDetails(false); CLogHandler::instance()->install(true); CLogHandler::instance()->enableConsoleOutput(false); // default disable auto logHandler = CLogHandler::instance()->handlerForPattern(