Fix popout overlay zone detection: map cursor to window coordinates
This commit is contained in:
parent
c6c4df1e77
commit
5e91e7ebb9
@ -341,13 +341,15 @@ class FullscreenPreview(QMainWindow):
|
||||
self._show_overlay()
|
||||
return True
|
||||
if event.type() == QEvent.Type.MouseMove and self.isActiveWindow():
|
||||
y = event.position().y() if hasattr(event, 'position') else event.pos().y()
|
||||
h = self.centralWidget().height()
|
||||
toolbar_zone = 40 # px from top/bottom edge to trigger
|
||||
if y < toolbar_zone:
|
||||
# Map cursor position to window coordinates
|
||||
cursor_pos = self.mapFromGlobal(event.globalPosition().toPoint() if hasattr(event, 'globalPosition') else event.globalPos())
|
||||
y = cursor_pos.y()
|
||||
h = self.height()
|
||||
zone = 40 # px from top/bottom edge to trigger
|
||||
if y < zone:
|
||||
self._toolbar.show()
|
||||
self._hide_timer.start()
|
||||
elif y > h - toolbar_zone and self._stack.currentIndex() == 1:
|
||||
elif y > h - zone and self._stack.currentIndex() == 1:
|
||||
self._video._controls_bar.show()
|
||||
self._hide_timer.start()
|
||||
self._ui_visible = self._toolbar.isVisible() or self._video._controls_bar.isVisible()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user