git.lucas.co / hou-control
SideFX Houdini customization package
git clone https://git.lucas.co/hou-control.git

commit7bf6960b08c4066eae50cb8f9d61c3bdc64777db
parent50aab36035
authorLucas Galante <[email protected]>
date2026-09-15 12:26
statusbar: open the circle's menu upward

Co-Authored-By: Claude Fable 5.1 <[email protected]>

 python3.13libs/hc/hcstatusbar.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/python3.13libs/hc/hcstatusbar.py b/python3.13libs/hc/hcstatusbar.py
index 7d0c335..136b319 100644
--- a/python3.13libs/hc/hcstatusbar.py
+++ b/python3.13libs/hc/hcstatusbar.py
@@ -185,7 +185,11 @@ class StatusCircle(QWidget):
             # Held on the widget so it outlives this handler; not parented,
             # since setParent would drop the popup window flags.
             self._menu = buildMainMenu()
-            self._menu.popup(self.mapToGlobal(QPoint(0, 0)))
+            # Open upward: bottom-left of the menu on the circle's top-left.
+            # popup() still keeps it on screen if that would not fit.
+            top_left = self.mapToGlobal(QPoint(0, 0))
+            top_left.setY(top_left.y() - self._menu.sizeHint().height())
+            self._menu.popup(top_left)
             event.accept()
             return
         super().mousePressEvent(event)