Adds visual indicator to message length if too long (#2659)

Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
M4tthewDE 2021-05-01 16:42:08 +02:00 committed by GitHub
parent 4636197f12
commit c413a0984e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -2,6 +2,7 @@
## Unversioned
- Minor: Added visual indicator to message length if over 500 characters long (#2659)
- Minor: Added `is:<flags>` search filter to find messages of specific types. (#2653, #2671)
- Minor: Added image links to the badge context menu. (#2667)
- Minor: Added a setting to hide Twitch Predictions badges. (#2668)

View file

@ -24,6 +24,7 @@
#include <QPainter>
namespace chatterino {
const int TWITCH_MESSAGE_LIMIT = 500;
SplitInput::SplitInput(Split *_chatWidget)
: BaseWidget(_chatWidget)
@ -604,6 +605,14 @@ void SplitInput::editTextChanged()
if (text.length() > 0 && getSettings()->showMessageLength)
{
labelText = QString::number(text.length());
if (text.length() > TWITCH_MESSAGE_LIMIT)
{
this->ui_.textEditLength->setStyleSheet("color: red");
}
else
{
this->ui_.textEditLength->setStyleSheet("");
}
}
else
{