mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix unnecessary clears of split input selection (#4197)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
a16342fd82
commit
cc661d5f42
|
@ -10,6 +10,7 @@
|
|||
- Bugfix: Fixed popup windows not appearing/minimizing correctly on the Windows taskbar. (#4181)
|
||||
- Bugfix: Fixed white border appearing around maximized window on Windows. (#4190)
|
||||
- Bugfix: Fixed window scaling being applied too many times on startup, causing windows like Settings to be slow. (#4193)
|
||||
- Bugfix: Fixed input text cursor flickering when selecting text in a split. (#4197)
|
||||
|
||||
## 2.4.0-beta
|
||||
|
||||
|
|
|
@ -116,7 +116,7 @@ Split::Split(QWidget *parent)
|
|||
this->updateInputPlaceholder();
|
||||
|
||||
this->view_->selectionChanged.connect([this]() {
|
||||
if (view_->hasSelection())
|
||||
if (this->input_->hasSelection())
|
||||
{
|
||||
this->input_->clearSelection();
|
||||
}
|
||||
|
|
|
@ -796,14 +796,16 @@ void SplitInput::insertCompletionText(const QString &input_)
|
|||
}
|
||||
}
|
||||
|
||||
void SplitInput::clearSelection()
|
||||
bool SplitInput::hasSelection() const
|
||||
{
|
||||
QTextCursor c = this->ui_.textEdit->textCursor();
|
||||
return this->ui_.textEdit->textCursor().hasSelection();
|
||||
}
|
||||
|
||||
c.setPosition(c.position());
|
||||
c.setPosition(c.position(), QTextCursor::KeepAnchor);
|
||||
|
||||
this->ui_.textEdit->setTextCursor(c);
|
||||
void SplitInput::clearSelection() const
|
||||
{
|
||||
auto cursor = this->ui_.textEdit->textCursor();
|
||||
cursor.clearSelection();
|
||||
this->ui_.textEdit->setTextCursor(cursor);
|
||||
}
|
||||
|
||||
bool SplitInput::isEditFirstWord() const
|
||||
|
|
|
@ -45,7 +45,9 @@ public:
|
|||
SplitInput(QWidget *parent, Split *_chatWidget,
|
||||
bool enableInlineReplying = true);
|
||||
|
||||
void clearSelection();
|
||||
bool hasSelection() const;
|
||||
void clearSelection() const;
|
||||
|
||||
bool isEditFirstWord() const;
|
||||
QString getInputText() const;
|
||||
void insertText(const QString &text);
|
||||
|
|
Loading…
Reference in a new issue