Skip to main content

Module ui

Module ui 

Source
Expand description

UI composition.

The egui side of the viewer. draw is called once per frame from DicomViewerApp::update. It paints the panels in this order:

  1. menu_bar — top.
  2. toolbar — top, beneath the menu bar.
  3. status_bar — bottom.
  4. study_browser — left side panel (optional).
  5. metadata_panel — right side panel (optional).
  6. viewport — central area, multi-cell grid.
  7. Modal dialogs (disclaimer, about).

§Drag-and-drop quirks (egui 0.29)

The sidebar uses dnd_drag_source. The inner selectable_label’s response carries click sense (inner.inner.clicked()); the outer response only has hover + drag. The viewport reads the payload via DragAndDrop::payload::<SeriesDragPayload> and consumes it with clear_payload on release. Do not wrap cells in dnd_drop_zone — painted-not-allocated content makes the zone collapse.

Modules§

theme
Workstation Noir theme — radiology instrument-panel aesthetic.

Structs§

UiState
Transient UI state — dialog visibility, active tool, panel visibility, in-progress measurement. Persists across frames but not across runs (use crate::config::UiConfig for the latter).

Enums§

ActiveTool
Which toolbar button is currently active. Drives mouse-drag behaviour in the viewport. Window/Level, Pan, and Zoom are mutually exclusive with the measurement tools; middle-mouse pan works in all modes.
GridLayout
Viewport grid layout — number of columns × rows of cells.
InProgress
Click- or drag-based annotation under construction. All coords are in displayed-image pixels (post-decimation).

Functions§

draw
Paint every UI panel for the current frame. Called once per frame from the app’s update method.