| 408 | } |
| 409 | |
| 410 | void 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 | |
| 442 | MyCanvas* MainWindow::loadCanvas(const QString &path){ |
| 443 | QFile input(path); |
nothing calls this directly
no test coverage detected