From 25382be02797aa6998cb9f0bea0c978b4486e4a3 Mon Sep 17 00:00:00 2001 From: Alphagocc Date: Sun, 14 Jul 2024 23:46:25 +0800 Subject: [PATCH] fix(dialog): make progress text align center --- makespec/BUILDVERSION | 2 +- src/forms/judgingdialog.ui | 36 ++++++++++++++++++++++-------------- src/judgingdialog.cpp | 1 + 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/makespec/BUILDVERSION b/makespec/BUILDVERSION index 81e5b7ce..864d5650 100644 --- a/makespec/BUILDVERSION +++ b/makespec/BUILDVERSION @@ -1 +1 @@ -267 +268 diff --git a/src/forms/judgingdialog.ui b/src/forms/judgingdialog.ui index bdf9a66e..24489131 100755 --- a/src/forms/judgingdialog.ui +++ b/src/forms/judgingdialog.ui @@ -3,7 +3,7 @@ JudgingDialog - Qt::WindowModal + Qt::WindowModality::WindowModal @@ -34,6 +34,12 @@ + + + 0 + 0 + + 16777215 @@ -43,35 +49,38 @@ 10 - 75 true true - Qt::LeftToRight + Qt::LayoutDirection::LeftToRight + + + QProgressBar { + border: 2px solid; + border-radius: 5px; + text-align:center; + } + QProgressBar::chunk { + background: #0c3; + } - 0 + 1000 - 0 + 500 - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + Qt::AlignmentFlag::AlignCenter true - - Qt::Horizontal - false - - QProgressBar::TopToBottom - %v / %m ms (%p%) @@ -95,7 +104,6 @@ 10 - 50 false @@ -120,7 +128,7 @@ - Qt::Horizontal + Qt::Orientation::Horizontal diff --git a/src/judgingdialog.cpp b/src/judgingdialog.cpp index 465034c2..6e4a9697 100644 --- a/src/judgingdialog.cpp +++ b/src/judgingdialog.cpp @@ -21,6 +21,7 @@ JudgingDialog::JudgingDialog(QWidget *parent) : QDialog(parent), ui(new Ui::JudgingDialog) { ui->setupUi(this); + ui->progressBar->setValue(0); cursor = new QTextCursor(ui->logViewer->document()); connect(ui->cancelButton, &QPushButton::clicked, this, &JudgingDialog::stopJudgingSlot); // connect(ui->skipButton, &QPushButton::clicked, this, &JudgingDialog::skipJudging);