Merge pull request #318 from Cranken/highlightText

Now highlights the text in the channel change and tab rename dialogue.
This commit is contained in:
pajlada 2018-04-08 14:39:34 +02:00 committed by GitHub
commit 10f0aadb6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 0 deletions

View file

@ -40,6 +40,7 @@ NotebookTab::NotebookTab(Notebook *_notebook)
d.setText(""); d.setText("");
} else { } else {
d.setText(this->getTitle()); d.setText(this->getTitle());
d.highlightText();
} }
if (d.exec() == QDialog::Accepted) { if (d.exec() == QDialog::Accepted) {

View file

@ -190,6 +190,7 @@ bool Split::showChangeChannelPopup(const char *dialogTitle, bool empty)
if (!empty) { if (!empty) {
dialog.setText(this->channel->name); dialog.setText(this->channel->name);
dialog.highlightText();
} }
if (dialog.exec() == QDialog::Accepted) { if (dialog.exec() == QDialog::Accepted) {

View file

@ -37,5 +37,10 @@ void TextInputDialog::cancelButtonClicked()
close(); close();
} }
void TextInputDialog::highlightText()
{
this->_lineEdit.selectAll();
}
} // namespace widgets } // namespace widgets
} // namespace chatterino } // namespace chatterino

View file

@ -27,6 +27,8 @@ public:
_lineEdit.setText(text); _lineEdit.setText(text);
} }
void highlightText();
private: private:
QVBoxLayout _vbox; QVBoxLayout _vbox;
QLineEdit _lineEdit; QLineEdit _lineEdit;