Skip to content
Snippets Groups Projects
Commit 1bc3b616 authored by Benjamin Arnaud's avatar Benjamin Arnaud Committed by Hugo Beauzée-Luyssen
Browse files

qt/interface_window_handler: Update MediaLibrary key filtering condition

fix #26453
parent f37fcb13
No related branches found
No related tags found
1 merge request!1192qt/interface_window_handler: Update MediaLibrary key filtering condition
Pipeline #179803 passed with stages
in 39 minutes and 34 seconds
......@@ -356,30 +356,24 @@ bool InterfaceWindowHandler::applyKeyEvent(QKeyEvent * event) const
{
int key = event->key();
// NOTE: We have to make sure tab and backtab are never used as hotkeys.
if (key == Qt::Key_Tab || key == Qt::Key_Backtab)
return false;
// NOTE: When browsing the MediaLibrary, we let the view handle the navigation keys.
if (m_mainCtx->preferHotkeys() == false && (KeyHelper::matchLeft(event) ||
KeyHelper::matchRight(event) ||
KeyHelper::matchUp(event) ||
KeyHelper::matchDown(event) ||
KeyHelper::matchCancel(event)))
// NOTE: We have to make sure tab and backtab are never used as hotkeys. When browsing the
// MediaLibrary, we let the view handle the navigation keys.
if (key == Qt::Key_Tab || key == Qt::Key_Backtab || m_mainCtx->preferHotkeys() == false)
{
return false;
}
QQuickItem * item = p_intf->p_compositor->activeFocusItem();
if (item && item->inherits("QQuickControl"))
// NOTE: When this item is a control and has visual focus we let it handle the key.
if (item && item->inherits("QQuickControl")
&&
QQmlProperty(item, "visualFocus", qmlContext(item)).read().toBool())
{
// NOTE: This item has visual focus so we let it handle the key.
if (QQmlProperty(item, "visualFocus", qmlContext(item)).read().toBool())
return false;
event->accept();
return true;
return false;
}
return false;
event->accept();
return true;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment