Skip to content

Final UI tweaks#47

Merged
C-Achard merged 7 commits intocy/upgrade-basler-backendfrom
cy/ux-tweaks
Feb 16, 2026
Merged

Final UI tweaks#47
C-Achard merged 7 commits intocy/upgrade-basler-backendfrom
cy/ux-tweaks

Conversation

@C-Achard
Copy link

Final UI polish pass that adds a few nice features.

  • Controls can be hidden and undocked from main viewing window to leave more space to viewer
  • Colormap for keypoints is now selectable on-the-fly
  • Some weird layouts resizing/size policy issues have been fixed.

The latest version should be much more comfortable to use and adapt better to all displays.


This pull request focuses on improving code clarity and user interface consistency in the camera configuration and main window modules. The most significant changes include refactoring UI layout code for maintainability, and enhancing the camera and processor selection interface for better usability.

UI layout and code refactoring:

  • Replaced all uses of the private _make_two_field_row with the public make_two_field_row in ui_blocks.py, improving code clarity and maintainability. [1] [2] [3] [4] [5] [6]
  • Refactored the main window layout in main_window.py to use a docked controls panel (QDockWidget) and separated the stats and video display, making the UI more modular and flexible. [1] [2]

Camera and processor selection UI enhancements:

  • Updated the processor and inference camera selection in the DLCLive group to use custom combo boxes (ShrinkCurrentWidePopupComboBox) and grouped them in a single row for a cleaner, more compact interface.
  • Added placeholder text and improved sizing for the inference camera combo box, and removed the processor and camera combo boxes from being added as separate rows.

Menu and appearance improvements:

  • Added a "Show controls" action to the View menu, allowing users to toggle the controls dock visibility.
  • Renamed group boxes for clarity (e.g., "Camera settings" → "Camera", "DLCLive settings" → "DLCLive"). [1] [2]

Miscellaneous:

  • Commented out the line setting PYLON_CAMEMU for virtual camera emulation to prevent it from being enabled in release builds.

Logging improvements:

  • Changed several logging statements in camera_config_dialog.py from LOGGER.info to LOGGER.debug to reduce log noise for normal operations. [1] [2] [3] [4] [5] [6]

Introduce a new color_dropdowns module to provide colormap and bbox-color QComboBox helpers (gradient swatches, matplotlib registry integration, and enum-based BGR swatches). Refactor layouts.make_two_field_row (renamed and enhanced) to support flexible key/value pairs, styling, and optional spacing, and add enable_combo_shrink_to_current to size combos to their current item. Integrate these into the main window: wire a Visualization group with colormap and bbox color controls, use the new helpers to populate and manage combo state, add _on_colormap_changed, and update bbox color handling. Also update ui_blocks to use make_two_field_row, tweak several UI labels/rows, comment out the PYLON emulation env var, and change several CameraConfigDialog log statements from INFO to DEBUG for less noisy logging.
Introduce a ShrinkCurrentWidePopupComboBox and ComboSizing to make combobox controls shrink to the current selection while the popup widens to fit the longest item. Add factory helpers (make_colormap_combo, make_bbox_color_combo) that create/populate colormap and bbox-color combos with sizing, icons, tooltips and safer Matplotlib handling. Rename/refactor colormap helpers (list_colormap_names, _safe_mpl_colormaps_registry), improve gradient icon creation, and preserve editable behavior if Matplotlib is unavailable. Update main_window to use the new factories, pass sizing and icon options, and adjust key widths for layout consistency.
Add graceful SIGINT handling for the Qt app by installing a signal handler that closes the main window and starting a small QTimer keepalive so Python can process signals while the event loop runs. The timer is stored on QApplication as _sig_timer and cleaned up on aboutToQuit. In the GUI, replace plain QComboBox instances with color_ui.ShrinkCurrentWidePopupComboBox for processor and camera controls, and layout them together using lyts.make_two_field_row to produce a compact, stable row and avoid shifting.
Import the logging module and emit an informational log when a keyboard interrupt triggers _request_quit inside _maybe_allow_keyboard_interrupt. This adds visibility for debugging application shutdowns without changing existing close behavior.
Replace the previous side-panel layout with a QDockWidget-based controls panel to allow docking/undocking and prevent UI shifting. Extract stats layout into _build_stats_layout and enable selectable stats text. Add sizing/shrink options and placeholder for processor and camera combo boxes and call update_shrink_width at key points so combo widths adapt. Add controls toggle to the View menu, set dock features/options, and give the dock a stable objectName for state saving. Also stop the display timer on shutdown and perform minor UI/layout cleanups and refactors (imports and button/preview layout adjustments).
Allow the left controls dock to be closed independently by adding QDockWidget.DockWidgetClosable to its features. Hide the docked title bar by applying a transparent stylesheet to the controls dock to improve visual integration. Also add a separator in the View menu before the Appearance submenu
Prevent the Controls dock from being closed by the user (keep it movable/floatable) and replace the previous toggleViewAction with an explicit, checkable "Show controls" QAction in the View menu. The new action is synchronized with the dock's visibility (action toggled -> dock visibility; dock visibilityChanged -> action checked). Also minor reordering/cleanup of Appearance menu setup and comments.
@C-Achard C-Achard self-assigned this Feb 16, 2026
@C-Achard C-Achard added enhancement New feature or request gui Related to the GUI itself : windows and fields bugs, UI, UX, ... labels Feb 16, 2026
@C-Achard C-Achard merged commit e480b28 into cy/upgrade-basler-backend Feb 16, 2026
@C-Achard C-Achard mentioned this pull request Feb 16, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gui Related to the GUI itself : windows and fields bugs, UI, UX, ...

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments