Skip to content

Commit

Permalink
fix(dialog): make progress text align center
Browse files Browse the repository at this point in the history
  • Loading branch information
alphagocc committed Jul 14, 2024
1 parent 10c809e commit 25382be
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion makespec/BUILDVERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
267
268
36 changes: 22 additions & 14 deletions src/forms/judgingdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<class>JudgingDialog</class>
<widget class="QDialog" name="JudgingDialog">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
<enum>Qt::WindowModality::WindowModal</enum>
</property>
<property name="geometry">
<rect>
Expand Down Expand Up @@ -34,6 +34,12 @@
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QProgressBar" name="progressBar">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
Expand All @@ -43,35 +49,38 @@
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>75</weight>
<bold>true</bold>
<kerning>true</kerning>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
<enum>Qt::LayoutDirection::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true"> QProgressBar {
border: 2px solid;
border-radius: 5px;
text-align:center;
}
QProgressBar::chunk {
background: #0c3;
}</string>
</property>
<property name="maximum">
<number>0</number>
<number>1000</number>
</property>
<property name="value">
<number>0</number>
<number>500</number>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
<property name="textVisible">
<bool>true</bool>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="textDirection">
<enum>QProgressBar::TopToBottom</enum>
</property>
<property name="format">
<string>%v / %m ms (%p%)</string>
</property>
Expand All @@ -95,7 +104,6 @@
<property name="font">
<font>
<pointsize>10</pointsize>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
Expand All @@ -120,7 +128,7 @@
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
Expand Down
1 change: 1 addition & 0 deletions src/judgingdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 25382be

Please sign in to comment.