Adds visual indicator to message length if too long (#2659)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user