mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Ref T783, no longer use stretch factor, but splitter sizes
Using stretch factor can cause ASSERT: https://discordapp.com/channels/539048679160676382/539846348275449887/706825982283350047
This commit is contained in:
committed by
Mat Sutcliffe
parent
947e393b03
commit
d3892de593
@@ -123,7 +123,7 @@ namespace BlackGui
|
||||
connect(&m_updateTimer, &QTimer::timeout, this, &CAtcStationComponent::update);
|
||||
|
||||
// Group box
|
||||
connect(ui->gb_Details, &QGroupBox::toggled, this, &CAtcStationComponent::onDetailsToggled);
|
||||
connect(ui->gb_Details, &QGroupBox::toggled, this, &CAtcStationComponent::onDetailsToggled, Qt::QueuedConnection);
|
||||
|
||||
// runtime based connects
|
||||
if (sGui)
|
||||
@@ -546,13 +546,36 @@ namespace BlackGui
|
||||
{
|
||||
if (checked)
|
||||
{
|
||||
layout->setStretchFactor(ui->tw_Atc, m_stretch.at(0));
|
||||
layout->setStretchFactor(ui->gb_Details, m_stretch.at(1));
|
||||
if (!m_splitterSizes.isEmpty())
|
||||
{
|
||||
ui->sp_AtcSplitter->setSizes(m_splitterSizes);
|
||||
}
|
||||
|
||||
/* before splitter
|
||||
if (m_stretch.size() > 1)
|
||||
{
|
||||
layout->setStretchFactor(ui->tw_Atc, m_stretch.at(0));
|
||||
layout->setStretchFactor(ui->gb_Details, m_stretch.at(1));
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
layout->setStretchFactor(ui->tw_Atc, 0);
|
||||
m_splitterSizes = ui->sp_AtcSplitter->sizes();
|
||||
if (m_splitterSizes.size() > 1)
|
||||
{
|
||||
int min, max;
|
||||
ui->sp_AtcSplitter->getRange(1, &min, &max);
|
||||
QList<int> newSizes;
|
||||
newSizes.push_back(qMax(0, m_splitterSizes.first() + m_splitterSizes.last() - min));
|
||||
newSizes.push_back(min);
|
||||
ui->sp_AtcSplitter->setSizes(newSizes);
|
||||
}
|
||||
|
||||
/* before splitter
|
||||
layout->setStretchFactor(ui->tw_Atc, 0);
|
||||
layout->setStretchFactor(ui->gb_Details, 0);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,8 +169,8 @@ namespace BlackGui
|
||||
QVBoxLayout *vLayout() const;
|
||||
|
||||
QScopedPointer<Ui::CAtcStationComponent> ui;
|
||||
QTimer m_updateTimer;
|
||||
QList<int> m_stretch;
|
||||
QTimer m_updateTimer;
|
||||
QList<int> m_splitterSizes;
|
||||
BlackMisc::Aviation::CCallsign m_selectedCallsign;
|
||||
QDateTime m_timestampLastReadOnlineStations; //!< stations read
|
||||
QDateTime m_timestampOnlineStationsChanged; //!< stations marked as changed
|
||||
|
||||
Reference in New Issue
Block a user