wip: reintroduced fake show
This commit is contained in:
parent
5b3b50a0d2
commit
4f637b4397
2 changed files with 34 additions and 16 deletions
|
|
@ -99,6 +99,12 @@ void MainWindow::compose() {
|
|||
epw->setSize(windowWidth, screenHeight);
|
||||
}
|
||||
|
||||
this->setAttribute(Qt::WA_DontShowOnScreen, true);
|
||||
this->show();
|
||||
this->widget->layout()->update();
|
||||
this->hide();
|
||||
this->setAttribute(Qt::WA_DontShowOnScreen, false);
|
||||
|
||||
/*
|
||||
* Calculating window height
|
||||
*/
|
||||
|
|
@ -110,9 +116,10 @@ void MainWindow::compose() {
|
|||
windowHeight += ews[i]->sizeHint().height();
|
||||
windowHeight += top;
|
||||
windowHeight += bottom;
|
||||
log_debugcpp("windowHeight loop: " + std::to_string(windowHeight));
|
||||
}
|
||||
windowHeight += mainMenuBar->height();
|
||||
|
||||
log_debugcpp("windowHeight final value: " + std::to_string(windowHeight));
|
||||
/*
|
||||
* Establishing initial window size and position
|
||||
*/
|
||||
|
|
@ -371,7 +378,7 @@ EndpointWidget::EndpointWidget(EndpointHandler* eph, QWidget *parent, uint64_t i
|
|||
*/
|
||||
|
||||
uint32_t epChannelCount = eph->getChannelCount();
|
||||
if(epChannelCount) {
|
||||
if(epChannelCount > 1) {
|
||||
cw = new ChannelWidget(epChannelCount, eph, this);
|
||||
//cw->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
|
||||
widgetLayout->addWidget(cw, row++, 0, 1, 4 /*colmax*/, Qt::AlignTop);
|
||||
|
|
@ -670,6 +677,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||
QEvent::registerEventType(CustomQEvent::EndpointDefaultChange);
|
||||
QEvent::registerEventType(CustomQEvent::SessionWidgetObsolete);
|
||||
QEvent::registerEventType(CustomQEvent::SessionWidgetCreated);
|
||||
QEvent::registerEventType(CustomQEvent::RecomposeMainWindow);
|
||||
;
|
||||
/* This spacer provides proper spacing when window vertically > widgets. */
|
||||
lastRowSpacer = new QSpacerItem(1, 1, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding);
|
||||
|
|
@ -759,10 +767,13 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||
this->ews[0] = newDef;
|
||||
QCoreApplication::instance()->postEvent(newDef->getDefaultRolesWidgets().at(Roles::ROLE_ALL), new QEvent((QEvent::Type)CustomQEvent::EndpointDefaultChange));
|
||||
} else if ((newDefRoles & Roles::ROLE_MULTIMEDIA) ||
|
||||
(newDefRoles & Roles::ROLE_CONSOLE)){ newDef->setIndex(0);
|
||||
this->ews[0] = newDef;
|
||||
} else if (newDefRoles & Roles::ROLE_COMMUNICATIONS) { newDef->setIndex(1);
|
||||
this->ews[1] = newDef;}
|
||||
(newDefRoles & Roles::ROLE_CONSOLE)){
|
||||
newDef->setIndex(0);
|
||||
this->ews[0] = newDef;
|
||||
} else if (newDefRoles & Roles::ROLE_COMMUNICATIONS) {
|
||||
newDef->setIndex(1);
|
||||
this->ews[1] = newDef;
|
||||
}
|
||||
log_debugcpp("newDef new idx: " + std::to_string(newDef->getIndex()));
|
||||
newDef->getDefaultRolesWidgets().at(role)->blockSignals(false);
|
||||
|
||||
|
|
@ -774,15 +785,21 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|||
oldDefRoles = oldDef->getEndpointHandler()->getRoles();
|
||||
//this->ews[oldDef->getIndex()] = nullptr;
|
||||
if ((oldDefRoles & Roles::ROLE_MULTIMEDIA) &&
|
||||
(oldDefRoles & Roles::ROLE_CONSOLE)) { this-> ews[0] = oldDef;
|
||||
oldDef->setIndex(0);
|
||||
} else if (oldDefRoles & Roles::ROLE_COMMUNICATIONS) { this-> ews[1] = oldDef;
|
||||
oldDef->setIndex(1);
|
||||
} else { if (newDefIdx > 1) { this->ews[newDefIdx] = oldDef;
|
||||
oldDef->setIndex(newDefIdx);
|
||||
} else { this->ews.push_back(oldDef);
|
||||
oldDef->setIndex(this->ews.size() - 1);
|
||||
} }
|
||||
(oldDefRoles & Roles::ROLE_CONSOLE)) {
|
||||
this-> ews[0] = oldDef;
|
||||
oldDef->setIndex(0);
|
||||
} else if (oldDefRoles & Roles::ROLE_COMMUNICATIONS) {
|
||||
this-> ews[1] = oldDef;
|
||||
oldDef->setIndex(1);
|
||||
} else {
|
||||
if (newDefIdx > 1) {
|
||||
this->ews[newDefIdx] = oldDef;
|
||||
oldDef->setIndex(newDefIdx);
|
||||
} else {
|
||||
this->ews.push_back(oldDef);
|
||||
oldDef->setIndex(this->ews.size() - 1);
|
||||
}
|
||||
}
|
||||
log_debugcpp("oldDef new idx: " + std::to_string(oldDef->getIndex()));
|
||||
oldDef->getDefaultRolesWidgets().at(role)->blockSignals(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue