panelmanager: improve hover behavior
Fixes issue where QWidget::underMouse would return false if cursor was over a child QOpenGLWindow
This commit is contained in:
@@ -66,8 +66,10 @@ PanelWidget *PanelManager::CurrentlyFocused(bool enable_hover) const
|
||||
|
||||
PanelWidget *PanelManager::CurrentlyHovered() const
|
||||
{
|
||||
QPoint global_mouse = QCursor::pos();
|
||||
|
||||
foreach (PanelWidget* panel, focus_history_) {
|
||||
if (panel->underMouse()) {
|
||||
if (panel->rect().contains(panel->mapFromGlobal(global_mouse))) {
|
||||
return panel;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user