refs#325, made simulator component CDockWidgetInfoAreaComponent compliant, finetuning with resizing in some components

* updates can be skipped, when widget is invisible
* current tab? only current tab updates
* reduced resize frequency in some cases
This commit is contained in:
Klaus Basan
2014-09-27 15:51:00 +02:00
parent 7304d8bd3e
commit e545288630
5 changed files with 19 additions and 6 deletions

View File

@@ -27,6 +27,7 @@ namespace BlackGui
ui(new Ui::CAircraftComponent), m_timerComponent(nullptr)
{
ui->setupUi(this);
this->ui->tvp_AirportsInRange->setResizeMode(CAirportView::ResizingOnce);
m_timerComponent = new CTimerBasedComponent(SLOT(update()), this);
connect(this->ui->tvp_AircraftsInRange, &CAircraftView::countChanged, this, &CAircraftComponent::ps_countChanged);
@@ -58,7 +59,8 @@ namespace BlackGui
if (this->getIContextNetwork()->isConnected())
{
if (this->countAircrafts() < 1 || this->isVisibleWidget())
bool visible = (this->isVisibleWidget() && this->currentWidget() == this->ui->tb_AircraftsInRange);
if (this->countAircrafts() < 1 || visible)
{
this->ui->tvp_AircraftsInRange->updateContainer(this->getIContextNetwork()->getAircraftsInRange());
}
@@ -70,7 +72,8 @@ namespace BlackGui
}
if (this->getIContextSimulator()->isConnected())
{
if (this->countAirportsInRange() < 1 || this->isVisibleWidget())
bool visible = (this->isVisibleWidget() && this->currentWidget() == this->ui->tb_AirportsInRange);
if (this->countAirportsInRange() < 1 || visible)
{
this->ui->tvp_AirportsInRange->updateContainer(this->getIContextSimulator()->getAirportsInRange());
}
@@ -111,6 +114,5 @@ namespace BlackGui
this->tabBar()->setTabText(ap, aps);
}
} // namespace
} // namespace