Fix large timeout duration in moderation buttons (#2921)

Large timeout durations in moderation buttons will no longer overlap with other buttons or username.
This commit is contained in:
Tal Neoran 2021-06-27 15:14:10 +03:00 committed by GitHub
parent 991892ee76
commit 07231e57c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -3,6 +3,7 @@
## Unversioned ## Unversioned
- Minor: Added `/openurl` command. Usage: `/openurl <URL>`. Opens the provided URL in the browser. (#2461, #2926) - Minor: Added `/openurl` command. Usage: `/openurl <URL>`. Opens the provided URL in the browser. (#2461, #2926)
- Bugfix: Fixed large timeout durations in moderation buttons overlapping with usernames or other buttons. (#2865, #2921)
## 2.3.3 ## 2.3.3

View file

@ -86,7 +86,15 @@ ModerationAction::ModerationAction(const QString &action)
} }
else else
{ {
this->line1_ = QString::number(amount / week); // limit to max timeout duration
if (amount > 2 * week)
{
this->line1_ = ">2";
}
else
{
this->line1_ = QString::number(amount / week);
}
this->line2_ = "w"; this->line2_ = "w";
} }