Filter out previous/next drawcall shortcuts when text editing.

Closes #911

editing.
path.
'ad0678a'.
This commit is contained in:
Baldur Karlsson
2018-03-12 12:36:33 +00:00
parent 1a268ace8b
commit 68a3f3a31f
5 changed files with 53 additions and 12 deletions
+5 -3
View File
@@ -380,7 +380,7 @@ MainWindow::MainWindow(ICaptureContext &ctx) : QMainWindow(NULL), ui(new Ui::Mai
QKeySequence ks = a->shortcut();
if(!ks.isEmpty())
{
m_GlobalShortcutCallbacks[ks] = [a]() {
m_GlobalShortcutCallbacks[ks] = [a](QWidget *) {
if(a->isEnabled())
a->trigger();
};
@@ -1942,7 +1942,7 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
// then use that callback
if(widgets.contains(focus))
{
callbacks[focus]();
callbacks[focus](focus);
event->accept();
return true;
}
@@ -1952,10 +1952,12 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
}
}
focus = QApplication::focusWidget();
// if we didn't find matches or no such shortcut is registered, try global shortcuts
if(m_GlobalShortcutCallbacks.contains(pressed))
{
m_GlobalShortcutCallbacks[pressed]();
m_GlobalShortcutCallbacks[pressed](focus);
event->accept();
return true;
}