fixed visual artifact when add/remove sessions while window open
This commit is contained in:
parent
4f3f8b3e56
commit
cb320da8cd
2 changed files with 12 additions and 4 deletions
|
|
@ -628,18 +628,21 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent, uint64_t i
|
|||
}
|
||||
|
||||
|
||||
|
||||
void EndpointWidget::addSessionWidget(CustomWidgetEvent<SessionHandler*>* ev){
|
||||
this->setUpdatesEnabled(false);
|
||||
uint64_t index = this->sessionWidgets.size();
|
||||
SessionWidget* sw = new SessionWidget(index, ev->payload, this);
|
||||
ev->payload->setFrontIndex(index);
|
||||
sw->calculateSize(currentWidth, currentHeight);
|
||||
this->widgetLayout->addWidget(sw, row, 0, 1, 4);
|
||||
row++;
|
||||
sessionWidgets.push_back(sw);
|
||||
this->setUpdatesEnabled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
void EndpointWidget::removeSessionWidget(CustomWidgetEvent<SessionHandler*>* ev){
|
||||
this->setUpdatesEnabled(false);
|
||||
uint64_t i = ev->payload->getFrontIndex();
|
||||
SessionWidget* deceased = sessionWidgets.at(i);
|
||||
deceased->setParent(nullptr);
|
||||
|
|
@ -649,6 +652,7 @@ void EndpointWidget::removeSessionWidget(CustomWidgetEvent<SessionHandler*>* ev)
|
|||
sessionWidgets.at(i) = nullptr;
|
||||
//row--;
|
||||
ev->payload->setFrontIndex(INT_MAX);
|
||||
this->setUpdatesEnabled(true);
|
||||
//this->sessionWidgetsUpdateTimer->start();
|
||||
return;
|
||||
}
|
||||
|
|
@ -736,6 +740,8 @@ void MainWindow::reorderEndpointWidgetCollection() {
|
|||
|
||||
void EndpointWidget::calculateSize(uint64_t width, uint64_t height) {
|
||||
/* og 1080p 120% testing values */
|
||||
this->currentWidth = width;
|
||||
this->currentHeight = height;
|
||||
log_to_file("[EndpointWidget %s sizes]\n", converter.to_bytes(this->getEndpointHandler()->getName()).c_str());
|
||||
log_to_file("Params: {Width: %u Height: %u}\n", width, height);
|
||||
this->mainLabel->setMaximumWidth((int)(width * 0.50) /* 1080p 120%*/);
|
||||
|
|
@ -1068,11 +1074,11 @@ void MainWindow::reloadEndpointWidgets() {
|
|||
log_wdebugcpp(L"epw name: " + epw->getEndpointHandler()->getName());
|
||||
if ((epw->getEndpointHandler()->getRoles() == Roles::ROLE_ALL) ||
|
||||
(epw->getEndpointHandler()->getRoles() & Roles::ROLE_MULTIMEDIA))
|
||||
ews[0] = epw;
|
||||
{ ews[0] = epw; epw->setIndex(0); }
|
||||
else if (epw->getEndpointHandler()->getRoles() & Roles::ROLE_COMMUNICATIONS)
|
||||
ews[1] = epw;
|
||||
{ ews[1] = epw; epw->setIndex(1); }
|
||||
else
|
||||
ews.push_back(epw);
|
||||
{ ews.push_back(epw); epw->setIndex(ews.size() - 1); }
|
||||
}
|
||||
}
|
||||
//todo: ya no está aquí tirao como tal, y de hecho, no ha fallado de la manera arriba descrita
|
||||
|
|
|
|||
|
|
@ -201,6 +201,8 @@ private:
|
|||
ChannelWidget* cw;
|
||||
std::vector<SessionWidget*> sessionWidgets;
|
||||
QSize minimum;
|
||||
uint64_t currentWidth = 1;
|
||||
uint64_t currentHeight = 1;
|
||||
//std::vector<EndpointHandler*> *ephs;
|
||||
//std::vector<QSlider> *sliders;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue