diff --git a/src/widgets/split.cpp b/src/widgets/split.cpp index 89cbea395..0e9061817 100644 --- a/src/widgets/split.cpp +++ b/src/widgets/split.cpp @@ -190,6 +190,7 @@ bool Split::showChangeChannelPopup(const char *dialogTitle, bool empty) if (!empty) { dialog.setText(this->channel->name); + dialog.highlightText(); } if (dialog.exec() == QDialog::Accepted) { diff --git a/src/widgets/textinputdialog.cpp b/src/widgets/textinputdialog.cpp index deb97e7a6..2cf372095 100644 --- a/src/widgets/textinputdialog.cpp +++ b/src/widgets/textinputdialog.cpp @@ -37,5 +37,10 @@ void TextInputDialog::cancelButtonClicked() close(); } +void TextInputDialog::highlightText() +{ + this->_lineEdit.selectAll(); +} + } // namespace widgets } // namespace chatterino diff --git a/src/widgets/textinputdialog.hpp b/src/widgets/textinputdialog.hpp index 4cf33c591..feb7b0471 100644 --- a/src/widgets/textinputdialog.hpp +++ b/src/widgets/textinputdialog.hpp @@ -27,6 +27,8 @@ public: _lineEdit.setText(text); } + void highlightText(); + private: QVBoxLayout _vbox; QLineEdit _lineEdit;