From c8bc48e5d842e5e903319ea8b75be38d5002856f Mon Sep 17 00:00:00 2001 From: Christian Kolset Date: Mon, 3 Aug 2026 12:14:31 -0600 Subject: Removed floating control panel feature. Floating can make window disappear and no sidebar panel. Possible future implementation. --- main.py | 10 ++-------- ui/main_window.py | 32 ++++---------------------------- ui/windows/settings_window.py | 2 +- 3 files changed, 7 insertions(+), 37 deletions(-) diff --git a/main.py b/main.py index 56a5dab..b023b99 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,5 @@ """ -main.py — LabUI entry point. +main.py — LabDAQ entry point. Run: python main.py @@ -11,19 +11,13 @@ Requirements: import sys, os sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) -# Plugin dependencies installed at runtime land here so the frozen app can import them. -_PLUGIN_PACKAGES = os.path.join(os.path.expanduser("~"), ".labui", "plugin_packages") -if os.path.isdir(_PLUGIN_PACKAGES) and _PLUGIN_PACKAGES not in sys.path: - sys.path.insert(0, _PLUGIN_PACKAGES) - from PyQt6.QtWidgets import QApplication from ui.main_window import MainWindow def main(): app = QApplication(sys.argv) - app.setApplicationName("LabUI") - install_debug_log() # tee stdout/stderr for the Debug window, before anything prints + app.setApplicationName("LabDAQ") qss = os.path.join(os.path.dirname(os.path.abspath(__file__)), "ui", "style_dark.qss") if os.path.exists(qss): diff --git a/ui/main_window.py b/ui/main_window.py index c7e4953..8f7a3be 100644 --- a/ui/main_window.py +++ b/ui/main_window.py @@ -66,7 +66,7 @@ class _CtrlTabStrip(QWidget): class _DockTitleBar(QWidget): """Custom title bar for the Control Panel QDockWidget. - Replaces native title bar; provides Add, Float, and Close buttons.""" + Replaces native title bar; provides Add and Close buttons.""" def __init__(self, dock: QDockWidget, add_callback, parent=None): super().__init__(parent) @@ -83,11 +83,6 @@ class _DockTitleBar(QWidget): add_btn.clicked.connect(add_callback) lay.addWidget(add_btn) - float_btn = QPushButton("⧉"); float_btn.setObjectName("devicesSmallBtn") - float_btn.setFixedSize(22, 22); float_btn.setToolTip("Float / dock") - float_btn.clicked.connect(lambda: dock.setFloating(not dock.isFloating())) - lay.addWidget(float_btn) - close_btn = QPushButton("✕"); close_btn.setObjectName("devicesSmallBtn") close_btn.setFixedSize(22, 22); close_btn.setToolTip("Hide Control Panel") close_btn.clicked.connect(dock.hide) @@ -196,21 +191,9 @@ class MainWindow(QMainWindow): self._view_menu.addAction(self._act_ctrl_panel) self._view_menu.addSeparator() - for label, tab_idx in [ - ("Devices", 0), - ("Channels", 1), - ("Plot Builder", 2), - ]: - act = QAction(label, self); act.setCheckable(True) - act.triggered.connect( - lambda checked, ti=tab_idx: - self._open_config(ti) if checked else - (self._win_config and self._win_config.hide()) - ) - self._view_menu.addAction(act) - self._act_devices = self._view_menu.actions()[-3] - self._act_channels = self._view_menu.actions()[-2] - self._act_plot = self._view_menu.actions()[-1] + act_config = QAction("Configuration", self) + act_config.triggered.connect(lambda: self._open_config(0)) + self._view_menu.addAction(act_config) self._view_plugin_sep = self._view_menu.addSeparator() self._view_plugin_sep.setVisible(False) @@ -281,7 +264,6 @@ class MainWindow(QMainWindow): self._ctrl_dock.setWidget(self._ctrl) self._ctrl_dock.setFeatures( QDockWidget.DockWidgetFeature.DockWidgetMovable | - QDockWidget.DockWidgetFeature.DockWidgetFloatable | QDockWidget.DockWidgetFeature.DockWidgetClosable ) self._ctrl_dock.setAllowedAreas( @@ -525,15 +507,9 @@ class MainWindow(QMainWindow): self._win_config.pipeline_changed.connect(lambda: None) self._win_config.derived_changed.connect(self._on_derived_changed) self._win_config.layout_applied.connect(self._chart.apply_layout) - self._win_config.closed.connect(self._on_config_closed) self._win_config.tabs.setCurrentIndex(tab) self._show_win(self._win_config, "right") - def _on_config_closed(self): - self._act_devices.setChecked(False) - self._act_channels.setChecked(False) - self._act_plot.setChecked(False) - def _open_settings(self): if self._win_settings is None: self._win_settings = SettingsWindow(self.registry, self.engine, diff --git a/ui/windows/settings_window.py b/ui/windows/settings_window.py index a45413d..cea7e5c 100644 --- a/ui/windows/settings_window.py +++ b/ui/windows/settings_window.py @@ -47,7 +47,7 @@ class SettingsWindow(QWidget): engine: AcquisitionEngine, current: dict = None, parent=None, *, plugin_manager=None): - super().__init__(parent, Qt.WindowType.Window | Qt.WindowType.Tool) + super().__init__(parent, Qt.WindowType.Window) self.registry = registry self.engine = engine self._plugin_mgr = plugin_manager -- cgit v1.2.3