mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-06 02:16:04 +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);
|
connect(&m_updateTimer, &QTimer::timeout, this, &CAtcStationComponent::update);
|
||||||
|
|
||||||
// Group box
|
// 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
|
// runtime based connects
|
||||||
if (sGui)
|
if (sGui)
|
||||||
@@ -545,14 +545,37 @@ namespace BlackGui
|
|||||||
if (layout)
|
if (layout)
|
||||||
{
|
{
|
||||||
if (checked)
|
if (checked)
|
||||||
|
{
|
||||||
|
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->tw_Atc, m_stretch.at(0));
|
||||||
layout->setStretchFactor(ui->gb_Details, m_stretch.at(1));
|
layout->setStretchFactor(ui->gb_Details, m_stretch.at(1));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
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->tw_Atc, 0);
|
||||||
layout->setStretchFactor(ui->gb_Details, 0);
|
layout->setStretchFactor(ui->gb_Details, 0);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ namespace BlackGui
|
|||||||
|
|
||||||
QScopedPointer<Ui::CAtcStationComponent> ui;
|
QScopedPointer<Ui::CAtcStationComponent> ui;
|
||||||
QTimer m_updateTimer;
|
QTimer m_updateTimer;
|
||||||
QList<int> m_stretch;
|
QList<int> m_splitterSizes;
|
||||||
BlackMisc::Aviation::CCallsign m_selectedCallsign;
|
BlackMisc::Aviation::CCallsign m_selectedCallsign;
|
||||||
QDateTime m_timestampLastReadOnlineStations; //!< stations read
|
QDateTime m_timestampLastReadOnlineStations; //!< stations read
|
||||||
QDateTime m_timestampOnlineStationsChanged; //!< stations marked as changed
|
QDateTime m_timestampOnlineStationsChanged; //!< stations marked as changed
|
||||||
|
|||||||
Reference in New Issue
Block a user