From 07231e57c9f6dea6552c2a1af7de5a9704030e00 Mon Sep 17 00:00:00 2001 From: Tal Neoran Date: Sun, 27 Jun 2021 15:14:10 +0300 Subject: [PATCH] Fix large timeout duration in moderation buttons (#2921) Large timeout durations in moderation buttons will no longer overlap with other buttons or username. --- CHANGELOG.md | 1 + src/controllers/moderationactions/ModerationAction.cpp | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87195823..a516571e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unversioned - Minor: Added `/openurl` command. Usage: `/openurl `. 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 diff --git a/src/controllers/moderationactions/ModerationAction.cpp b/src/controllers/moderationactions/ModerationAction.cpp index 467f9db5..a24ce9e8 100644 --- a/src/controllers/moderationactions/ModerationAction.cpp +++ b/src/controllers/moderationactions/ModerationAction.cpp @@ -86,7 +86,15 @@ ModerationAction::ModerationAction(const QString &action) } 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"; }