mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 20:40:29 +08:00
GUI improvements found during #707
* logs only screen in core as default * find top window, only use Qt::WA_TranslucentBackground on top level (Qt 5.6.1) * correct presize when insert * resize ATC when first station is added
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -806,16 +806,32 @@ namespace BlackGui
|
||||
void CViewBase<ModelClass, ContainerType, ObjectType>::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 <class ModelClass, class ContainerType, class ObjectType>
|
||||
void CViewBase<ModelClass, ContainerType, ObjectType>::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 <class ModelClass, class ContainerType, class ObjectType>
|
||||
|
||||
Reference in New Issue
Block a user