mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
Tabs with modifiers are passed up from chat boxes.
In Qt chat boxes filter out events related to text editing, including tabs. Unfortunately tabs with modifiers like those used to cycle through contacts are being filtered despite not being used for anything. This fixes the keybind for cycling forward through contacts (Ctrl+Tab).
This commit is contained in:
parent
59a8ea13e7
commit
f6a2925331
|
@ -25,12 +25,17 @@ ChatTextEdit::ChatTextEdit(QWidget *parent) :
|
|||
}
|
||||
|
||||
void ChatTextEdit::keyPressEvent(QKeyEvent * event)
|
||||
{
|
||||
{
|
||||
int key = event->key();
|
||||
if ((key == Qt::Key_Enter || key == Qt::Key_Return) && !(event->modifiers() & Qt::ShiftModifier))
|
||||
emit enterPressed();
|
||||
else if (key == Qt::Key_Tab)
|
||||
emit tabPressed();
|
||||
{
|
||||
if (event->modifiers())
|
||||
event->ignore();
|
||||
else
|
||||
emit tabPressed();
|
||||
}
|
||||
else if (key == Qt::Key_Up && this->toPlainText().isEmpty())
|
||||
{
|
||||
this->setText(lastMessage);
|
||||
|
|
Loading…
Reference in New Issue
Block a user