From baaf22d0c4c8f9af920c31b529fd01ed4b7553f8 Mon Sep 17 00:00:00 2001 From: tooomm Date: Sun, 16 Jan 2022 22:49:41 +0100 Subject: [PATCH] UI: Improve alignment in user info (#4524) * fix alignment * tweaking * lint * limit flag to one column * lint * cleanup * Update userinfobox.cpp * re-add manual window resizing * Update cockatrice/src/userinfobox.cpp Co-authored-by: ebbit1q --- cockatrice/src/userinfobox.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cockatrice/src/userinfobox.cpp b/cockatrice/src/userinfobox.cpp index 0de162ce..61e9965e 100644 --- a/cockatrice/src/userinfobox.cpp +++ b/cockatrice/src/userinfobox.cpp @@ -43,7 +43,7 @@ UserInfoBox::UserInfoBox(AbstractClient *_client, bool _editable, QWidget *paren mainLayout->addWidget(&realNameLabel1, 2, 0, 1, 1); mainLayout->addWidget(&realNameLabel2, 2, 1, 1, 2); mainLayout->addWidget(&countryLabel1, 4, 0, 1, 1); - mainLayout->addWidget(&countryLabel2, 4, 1, 1, 2); + mainLayout->addWidget(&countryLabel2, 4, 1, 1, 1, Qt::AlignCenter); mainLayout->addWidget(&countryLabel3, 4, 2, 1, 1); mainLayout->addWidget(&userLevelLabel1, 5, 0, 1, 1); mainLayout->addWidget(&userLevelLabel2, 5, 1, 1, 1); @@ -64,16 +64,16 @@ UserInfoBox::UserInfoBox(AbstractClient *_client, bool _editable, QWidget *paren connect(&avatarButton, SIGNAL(clicked()), this, SLOT(actAvatar())); } - setWindowTitle(tr("User information")); + setWindowTitle(tr("User Information")); setLayout(mainLayout); retranslateUi(); } void UserInfoBox::retranslateUi() { - realNameLabel1.setText(tr("Real name:")); + realNameLabel1.setText(tr("Real Name:")); countryLabel1.setText(tr("Location:")); - userLevelLabel1.setText(tr("User level:")); + userLevelLabel1.setText(tr("User Level:")); accountAgeLabel1.setText(tr("Account Age:")); editButton.setText(tr("Edit")); @@ -98,7 +98,7 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user) if (country.length() != 0) { countryLabel2.setPixmap(CountryPixmapGenerator::generatePixmap(15, country)); - countryLabel3.setText(QString("(%1)").arg(country.toUpper())); + countryLabel3.setText(QString("%1").arg(country.toUpper())); } else { countryLabel2.setText(""); countryLabel3.setText(""); @@ -106,6 +106,7 @@ void UserInfoBox::updateInfo(const ServerInfo_User &user) userLevelLabel2.setPixmap( UserLevelPixmapGenerator::generatePixmap(15, userLevel, false, QString::fromStdString(user.privlevel()))); + userLevelLabel2.setAlignment(Qt::AlignCenter); QString userLevelText; if (userLevel.testFlag(ServerInfo_User::IsAdmin)) userLevelText = tr("Administrator");