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
|
@ -30,7 +30,12 @@ void ChatTextEdit::keyPressEvent(QKeyEvent * event)
|
||||||
if ((key == Qt::Key_Enter || key == Qt::Key_Return) && !(event->modifiers() & Qt::ShiftModifier))
|
if ((key == Qt::Key_Enter || key == Qt::Key_Return) && !(event->modifiers() & Qt::ShiftModifier))
|
||||||
emit enterPressed();
|
emit enterPressed();
|
||||||
else if (key == Qt::Key_Tab)
|
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())
|
else if (key == Qt::Key_Up && this->toPlainText().isEmpty())
|
||||||
{
|
{
|
||||||
this->setText(lastMessage);
|
this->setText(lastMessage);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user