From 1fc04d82cacebd74e63f3c68a4f2b2244d8b49d9 Mon Sep 17 00:00:00 2001 From: Cranken Date: Sat, 7 Apr 2018 21:21:56 +0200 Subject: [PATCH 1/2] Now highlights the text in the channel change dialogue. --- src/widgets/split.cpp | 1 + src/widgets/textinputdialog.cpp | 5 +++++ src/widgets/textinputdialog.hpp | 2 ++ 3 files changed, 8 insertions(+) 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; From 942e8cefccc9ab4ff9d678fb7013464f7ec17abe Mon Sep 17 00:00:00 2001 From: Cranken Date: Sat, 7 Apr 2018 21:42:06 +0200 Subject: [PATCH 2/2] Also now highlights in tab rename. --- src/widgets/helper/notebooktab.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/helper/notebooktab.cpp b/src/widgets/helper/notebooktab.cpp index 36870bc5d..332fe9c2b 100644 --- a/src/widgets/helper/notebooktab.cpp +++ b/src/widgets/helper/notebooktab.cpp @@ -40,6 +40,7 @@ NotebookTab::NotebookTab(Notebook *_notebook) d.setText(""); } else { d.setText(this->getTitle()); + d.highlightText(); } if (d.exec() == QDialog::Accepted) {