Implement "hide empty input" option

Fixes #144
This commit is contained in:
Rasmus Karlsson
2017-12-17 16:19:16 +01:00
parent ef9aedb2cd
commit 151ff057a6
3 changed files with 30 additions and 0 deletions
+7
View File
@@ -198,6 +198,11 @@ void SplitInput::clearSelection()
this->textInput.setTextCursor(c);
}
QString SplitInput::getInputText() const
{
return this->textInput.toPlainText();
}
void SplitInput::refreshTheme()
{
QPalette palette;
@@ -213,6 +218,8 @@ void SplitInput::editTextChanged()
{
QString text = this->textInput.toPlainText();
this->textChanged.invoke(text);
text = text.trimmed();
static QRegularExpression spaceRegex("\\s\\s+");
text = text.replace(spaceRegex, " ");