Revert "fix(xrayeye): defer control-panel width-fixing until after first show"

This reverts commit 10b02ca2f1.
This commit is contained in:
x01dc committed 2026-09-17 15:48:07 +02:00
1 parent 99243931ac
commit b43240fbdd
1 file changed
+4 -16
@@ -580,15 +580,11 @@ class OMNY_XRayEye(BECWidget, QWidget):
self._update_calibration_readout()
self.control_panel_layout.addLayout(form)
# Fix panel width and allow vertical expansion. The actual width-fixing
# is deferred (see _fix_control_panel_width()) rather than computed
# here -- sizeHint() called before the widget has ever been shown/laid
# out is unreliable (no real screen geometry yet, fonts not fully
# resolved -- worse over a remote desktop session), which froze
# control_panel at a wrong width until the operator manually resized
# the window (forcing Qt to redo layout with correct geometry).
# Fix panel width and allow vertical expansion
self.control_panel.adjustSize()
p_hint = self.control_panel.sizeHint()
self.control_panel.setFixedWidth(p_hint.width())
self.control_panel.setSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Expanding)
QTimer.singleShot(0, self._fix_control_panel_width)
# Core Layout: image (expanding) | control panel (fixed)
self.core_layout.addWidget(self.image)
@@ -745,14 +741,6 @@ class OMNY_XRayEye(BECWidget, QWidget):
sep.setLineWidth(1)
return sep
def _fix_control_panel_width(self):
"""Lock the control panel to its natural width. Scheduled via
QTimer.singleShot(0, ...) from _init_ui() to run on the next event-loop
iteration, after the widget has actually been shown/laid out at least
once -- sizeHint() is not reliable before that point."""
self.control_panel.adjustSize()
self.control_panel.setFixedWidth(self.control_panel.sizeHint().width())
def _init_gui_trigger(self):
self.dev.omny_xray_gui.read()
self.dev.fsh.read()