change: UI and migrate to gtest

This commit is contained in:
2026-07-27 05:27:32 +08:00
parent dd5508e571
commit a84e75ef47
56 changed files with 4484 additions and 4949 deletions
+32
View File
@@ -44,12 +44,44 @@ MainStatusBar::MainStatusBar(QWidget *parent)
bar_->setMaximum(100);
bar_->setVisible(false);
// Permanent right-hand sequence info chips (resolution + frame rate)
resolution_label_ = new QLabel();
fps_label_ = new QLabel();
resolution_label_->setContentsMargins(6, 0, 6, 0);
fps_label_->setContentsMargins(6, 0, 6, 0);
addPermanentWidget(resolution_label_);
addPermanentWidget(fps_label_);
resolution_label_->setVisible(false);
fps_label_->setVisible(false);
showMessage(tr("Welcome to %1 %2")
.arg(QCoreApplication::applicationName(),
QCoreApplication::applicationVersion()),
10000);
}
void MainStatusBar::set_sequence_info(int width, int height, double fps)
{
if (width <= 0 || height <= 0) {
resolution_label_->setVisible(false);
fps_label_->setVisible(false);
return;
}
resolution_label_->setText(QStringLiteral("%1\u00d7%2").arg(width).arg(height));
// Show the frame rate as an integer when it is whole, otherwise keep one
// decimal place (e.g. 23.976 FPS).
const double rounded = qRound(fps);
QString fps_str = (qFuzzyCompare(fps, rounded))
? QString::number(static_cast<int>(rounded))
: QString::number(fps, 'f', 2);
fps_label_->setText(tr("%1 FPS").arg(fps_str));
resolution_label_->setVisible(true);
fps_label_->setVisible(true);
}
void MainStatusBar::connect_task_manager(EngineEventBridge *bridge)
{
bridge_ = bridge;