mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Disable tab to switch between splits
This will be custom made later, as tab is used for emote completion
This commit is contained in:
parent
2425ddbd2c
commit
1f7d0dcead
1 changed files with 5 additions and 1 deletions
|
@ -1,7 +1,6 @@
|
||||||
#include "widgets/resizingtextedit.hpp"
|
#include "widgets/resizingtextedit.hpp"
|
||||||
|
|
||||||
ResizingTextEdit::ResizingTextEdit()
|
ResizingTextEdit::ResizingTextEdit()
|
||||||
: keyPressed()
|
|
||||||
{
|
{
|
||||||
auto sizePolicy = this->sizePolicy();
|
auto sizePolicy = this->sizePolicy();
|
||||||
sizePolicy.setHeightForWidth(true);
|
sizePolicy.setHeightForWidth(true);
|
||||||
|
@ -9,6 +8,8 @@ ResizingTextEdit::ResizingTextEdit()
|
||||||
this->setSizePolicy(sizePolicy);
|
this->setSizePolicy(sizePolicy);
|
||||||
|
|
||||||
QObject::connect(this, &QTextEdit::textChanged, this, &QWidget::updateGeometry);
|
QObject::connect(this, &QTextEdit::textChanged, this, &QWidget::updateGeometry);
|
||||||
|
|
||||||
|
this->setFocusPolicy(Qt::ClickFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
QSize ResizingTextEdit::sizeHint() const
|
QSize ResizingTextEdit::sizeHint() const
|
||||||
|
@ -43,9 +44,11 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
||||||
|
|
||||||
if (event->key() == Qt::Key_Tab) {
|
if (event->key() == Qt::Key_Tab) {
|
||||||
QString currentCompletionPrefix = this->textUnderCursor();
|
QString currentCompletionPrefix = this->textUnderCursor();
|
||||||
|
|
||||||
if (!currentCompletionPrefix.size()) {
|
if (!currentCompletionPrefix.size()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this->nextCompletion) {
|
if (!this->nextCompletion) {
|
||||||
// first selection
|
// first selection
|
||||||
this->completer->setCompletionPrefix(currentCompletionPrefix);
|
this->completer->setCompletionPrefix(currentCompletionPrefix);
|
||||||
|
@ -59,6 +62,7 @@ void ResizingTextEdit::keyPressEvent(QKeyEvent *event)
|
||||||
// wrap over and start again
|
// wrap over and start again
|
||||||
this->completer->setCurrentRow(0);
|
this->completer->setCurrentRow(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
this->completer->complete();
|
this->completer->complete();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue