Merge branch 'master' of https://github.com/Chatterino/chatterino2 into master

This commit is contained in:
fourtf 2020-10-22 20:00:14 +02:00
commit 8bc3025a77
2 changed files with 16 additions and 19 deletions

View file

@ -23,7 +23,6 @@
#include <QCheckBox> #include <QCheckBox>
#include <QDesktopServices> #include <QDesktopServices>
#include <QLabel>
#include <QNetworkAccessManager> #include <QNetworkAccessManager>
#include <QNetworkReply> #include <QNetworkReply>
@ -164,10 +163,8 @@ UserInfoPopup::UserInfoPopup(bool closeAutomatically)
.assign(&this->ui_.followerCountLabel); .assign(&this->ui_.followerCountLabel);
vbox.emplace<Label>(TEXT_CREATED.arg("")) vbox.emplace<Label>(TEXT_CREATED.arg(""))
.assign(&this->ui_.createdDateLabel); .assign(&this->ui_.createdDateLabel);
vbox.emplace<Line>(true); vbox.emplace<Label>("").assign(&this->ui_.followageLabel);
vbox.emplace<Label>("") vbox.emplace<Label>("").assign(&this->ui_.subageLabel);
.assign(&this->ui_.followageSubageLabel)
->setMinimumSize(this->minimumSizeHint());
} }
} }
@ -667,34 +664,33 @@ void UserInfoPopup::updateUserData()
return; return;
} }
QString labelText;
if (!subageInfo.followingSince.isEmpty()) if (!subageInfo.followingSince.isEmpty())
{ {
QDateTime followedAt = QDateTime::fromString( QDateTime followedAt = QDateTime::fromString(
subageInfo.followingSince, Qt::ISODate); subageInfo.followingSince, Qt::ISODate);
QString followingSince = followedAt.toString("yyyy-MM-dd"); QString followingSince = followedAt.toString("yyyy-MM-dd");
labelText = "Following since " + followingSince; this->ui_.followageLabel->setText("❤ Following since " +
followingSince);
} }
if (subageInfo.isSubHidden) if (subageInfo.isSubHidden)
{ {
labelText += "\nSubscribtion status hidden"; this->ui_.subageLabel->setText(
"Subscription status hidden");
} }
if (subageInfo.isSubbed) else if (subageInfo.isSubbed)
{ {
labelText += QString("\nTier %1 - Subscribed for %2 months") this->ui_.subageLabel->setText(
.arg(subageInfo.subTier) QString("★ Tier %1 - Subscribed for %2 months")
.arg(subageInfo.totalSubMonths); .arg(subageInfo.subTier)
.arg(subageInfo.totalSubMonths));
} }
else if (subageInfo.totalSubMonths) else if (subageInfo.totalSubMonths)
{ {
labelText += this->ui_.subageLabel->setText(
QString("\nPreviously subscribed for %1 months") QString("Previously subscribed for %1 months")
.arg(subageInfo.totalSubMonths); .arg(subageInfo.totalSubMonths));
} }
this->ui_.followageSubageLabel->setText(labelText);
}, },
[] {}); [] {});
}; };

View file

@ -55,7 +55,8 @@ private:
Label *followerCountLabel = nullptr; Label *followerCountLabel = nullptr;
Label *createdDateLabel = nullptr; Label *createdDateLabel = nullptr;
Label *userIDLabel = nullptr; Label *userIDLabel = nullptr;
Label *followageSubageLabel = nullptr; Label *followageLabel = nullptr;
Label *subageLabel = nullptr;
QCheckBox *follow = nullptr; QCheckBox *follow = nullptr;
QCheckBox *ignore = nullptr; QCheckBox *ignore = nullptr;