feat: re-design client

This commit is contained in:
semenov
2025-07-23 17:39:49 +03:00
parent c4a3d503af
commit 7ec5536875
92 changed files with 339457 additions and 6979 deletions

View File

@@ -15,13 +15,16 @@ MainWindow::MainWindow(QWidget *parent)
{
ui->setupUi(this);
isRecovery = false;
setWindowFlag(Qt::FramelessWindowHint);
setAttribute(Qt::WA_TranslucentBackground);
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
_background.load(":/resource/SSJ_backgroundDarkSM.png");
}
void MainWindow::createObjects()
{
qRegisterMetaType<PacketType>("PacketType");
updateWidget = new UpdateNotifyWidget;
updateWidget->setParent(this);
@@ -68,6 +71,28 @@ void MainWindow::createObjects()
workerThread->setPriority(QThread::HighestPriority);
timer = new QTimer;
}
void MainWindow::paintEvent(QPaintEvent* event) {
QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing);
QPainterPath path;
path.addRoundedRect(rect(), 20, 20);
painter.setClipPath(path);
if (!_background.isNull()) {
int x = (width() - _background.width()) / 2;
int y = (height() - _background.height()) / 2;
painter.drawPixmap(x, y, _background);
}
// подложка
// painter.setClipping(false);
// painter.setBrush(QColor(0, 0, 0, 0));
// painter.drawRoundedRect(rect(), 20, 20);
}
void MainWindow::initialize()
@@ -511,13 +536,6 @@ void MainWindow::showCompleteDialogBox()
{
ui->inlineTextDebug->setText(tr("Загрузка завершена"));
activateLoadingAnimation(true);
// QTime dieTime= QTime::currentTime().addSecs(10); //DELAY ДЛЯ ПЕРЕСЧЕТА ХЭША НА СЕРВЕРЕ
// while (QTime::currentTime() < dieTime)
// QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
// activateLoadingAnimation(false);
// checkUpdate();
}
void MainWindow::startUnityClient()
@@ -548,7 +566,7 @@ void MainWindow::setUpUi()
waitAnimationWidget->setMovie(resourceManager->getMovie());
QSize iconSize(30,30);
QSize iconSize(20,20);
ui->exitButton->setIcon(*resourceManager->getCloseIcon());
ui->exitButton->setIconSize(iconSize);