Merge pull request #12865 from LillyJadeKatrin/retroachievements-dialog-sizing

Add word wrap to Achievement Dialog text
This commit is contained in:
Admiral H. Curtiss 2024-06-15 18:27:15 +02:00 committed by GitHub
commit 56fd9c177c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 0 deletions

View File

@ -27,8 +27,10 @@ AchievementBox::AchievementBox(QWidget* parent, rc_client_achievement_t* achieve
m_badge = new QLabel(); m_badge = new QLabel();
QLabel* title = new QLabel(QString::fromUtf8(achievement->title, strlen(achievement->title))); QLabel* title = new QLabel(QString::fromUtf8(achievement->title, strlen(achievement->title)));
title->setWordWrap(true);
QLabel* description = QLabel* description =
new QLabel(QString::fromUtf8(achievement->description, strlen(achievement->description))); new QLabel(QString::fromUtf8(achievement->description, strlen(achievement->description)));
description->setWordWrap(true);
QLabel* points = new QLabel(tr("%1 points").arg(achievement->points)); QLabel* points = new QLabel(tr("%1 points").arg(achievement->points));
m_status = new QLabel(); m_status = new QLabel();
m_progress_bar = new QProgressBar(); m_progress_bar = new QProgressBar();

View File

@ -29,6 +29,9 @@ AchievementHeaderWidget::AchievementHeaderWidget(QWidget* parent) : QWidget(pare
m_game_progress = new QProgressBar(); m_game_progress = new QProgressBar();
m_rich_presence = new QLabel(); m_rich_presence = new QLabel();
m_name->setWordWrap(true);
m_points->setWordWrap(true);
m_rich_presence->setWordWrap(true);
QSizePolicy sp_retain = m_game_progress->sizePolicy(); QSizePolicy sp_retain = m_game_progress->sizePolicy();
sp_retain.setRetainSizeWhenHidden(true); sp_retain.setRetainSizeWhenHidden(true);
m_game_progress->setSizePolicy(sp_retain); m_game_progress->setSizePolicy(sp_retain);

View File

@ -55,7 +55,9 @@ void AchievementLeaderboardWidget::UpdateData(bool clean_all)
const auto* leaderboard = leaderboard_bucket.leaderboards[board]; const auto* leaderboard = leaderboard_bucket.leaderboards[board];
m_leaderboard_order[leaderboard->id] = row; m_leaderboard_order[leaderboard->id] = row;
QLabel* a_title = new QLabel(QString::fromUtf8(leaderboard->title)); QLabel* a_title = new QLabel(QString::fromUtf8(leaderboard->title));
a_title->setWordWrap(true);
QLabel* a_description = new QLabel(QString::fromUtf8(leaderboard->description)); QLabel* a_description = new QLabel(QString::fromUtf8(leaderboard->description));
a_description->setWordWrap(true);
QVBoxLayout* a_col_left = new QVBoxLayout(); QVBoxLayout* a_col_left = new QVBoxLayout();
a_col_left->addWidget(a_title); a_col_left->addWidget(a_title);
a_col_left->addWidget(a_description); a_col_left->addWidget(a_description);