diff --git a/src/widgets/dialogs/UserInfoPopup.cpp b/src/widgets/dialogs/UserInfoPopup.cpp index 55d9f98a8..527d24a44 100644 --- a/src/widgets/dialogs/UserInfoPopup.cpp +++ b/src/widgets/dialogs/UserInfoPopup.cpp @@ -24,10 +24,28 @@ #include #include +#include + #define TEXT_FOLLOWERS "Followers: " #define TEXT_VIEWS "Views: " #define TEXT_CREATED "Created: " + +namespace { + +const auto kBorderColor = QColor(255, 255, 255, 80); + +int calculateTimeoutDuration(const QString &durationPerUnit, + const QString &unit) +{ + static const QMap durations{ + {"s", 1}, {"m", 60}, {"h", 3600}, {"d", 86400}, {"w", 604800}, + }; + return durationPerUnit.toInt() * durations[unit]; +} + +} // namespace + namespace chatterino { UserInfoPopup::UserInfoPopup() @@ -90,9 +108,8 @@ UserInfoPopup::UserInfoPopup() auto usercard = user.emplace(this); usercard->getLabel().setText("Usercard"); - QColor borderColor(255, 255, 255, 80); - usercard->setBorderColor(borderColor); - viewLogs->setBorderColor(borderColor); + usercard->setBorderColor(kBorderColor); + viewLogs->setBorderColor(kBorderColor); auto mod = user.emplace