MCPcopy Create free account
hub / github.com/Linloir/GraphBuilder / controlWindowScale

Method controlWindowScale

mainwindow.cpp:410–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408}
409
410void MainWindow::controlWindowScale(){
411 if(!maximized){
412 lastGeometry = this->frameGeometry();
413 windowShadow->setEnabled(false);
414 ui->verticalLayout->setContentsMargins(0, 0, 0, 0);
415 border->hide();
416 QString mainStyle = "QWidget#mainWidget{background-color:" + mainBackGround.name() + ";border-radius:0px;}";
417 ui->mainWidget->setStyleSheet(mainStyle);
418 this->showMaximized();
419 maximized = true;
420 QPainterPath path;
421 path.addRect(ui->mainWidget->rect());
422 QRegion mask(path.toFillPolygon().toPolygon());
423 ui->mainWidget->setMask(mask);
424 }
425 else{
426 ui->verticalLayout->setContentsMargins(30, 30, 30, 30);
427 this->showNormal();
428 QString mainStyle = "QWidget#mainWidget{background-color:" + mainBackGround.name() + QString::asprintf(";border-radius:%dpx", cornerRadius) + "}";
429 ui->mainWidget->setStyleSheet(mainStyle);
430 QPainterPath path;
431 path.addRoundedRect(ui->mainWidget->rect(), cornerRadius - 1, cornerRadius - 1);
432 QRegion mask(path.toFillPolygon().toPolygon());
433 ui->mainWidget->setMask(mask);
434 border->show();
435 windowShadow->setEnabled(true);
436 this->resize(lastGeometry.width(), lastGeometry.height());
437 this->move(lastGeometry.x(), lastGeometry.y());
438 maximized = false;
439 }
440}
441
442MyCanvas* MainWindow::loadCanvas(const QString &path){
443 QFile input(path);

Callers

nothing calls this directly

Calls 3

nameMethod · 0.80
moveMethod · 0.80
setEnabledMethod · 0.45

Tested by

no test coverage detected