ui: compact cursor and measurement readouts at the top of the dock

Both views are written from the same variable at the same call site, so the dock cannot disagree with the full panels.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martino FerrariandClaude Sonnet 4.6 committed 2026-11-03 05:22:41 +01:00
1 parent a7a1609d48
commit a0fc0762d5
7 files changed
+350 -22

No files matched your search

+28
View File
@@ -590,6 +590,24 @@ struct App {
int slot = -1;
};
std::vector<CursorLine> cursors_lines;
/// The dock's compact copy of the cursors table (`src/ui_dock.cpp`): one line per `cursors_lines`
/// entry, same order, written from the same strings by `update_cursors_pane()`.
struct DockCursorLine {
GtkWidget* label = nullptr;
GtkWidget* a = nullptr;
GtkWidget* b = nullptr;
GtkWidget* d = nullptr;
};
std::vector<DockCursorLine> dock_cursor_lines;
/// The Readouts section at the top of the dock, and the parts of it the rebuilds and the Edit buttons
/// reach.
GtkWidget* dock_readouts = nullptr;
GtkWidget* dock_cursor_grid = nullptr;
GtkWidget* dock_measures_box = nullptr;
GtkWidget* dock_cursors_edit = nullptr;
GtkWidget* dock_measures_edit = nullptr;
/// One value label per measurement, in `measures` order (the dock's copy of `measure_labels`).
std::vector<GtkWidget*> dock_measure_labels;
/// The measurements the user set up, and what they last computed. The list is the state;
/// the results are recomputed on a throttle (the numbers are window statistics, and the
/// window scrolls every frame -- 60 recomputations a second of every sample is not a
@@ -1756,6 +1774,16 @@ void rebuild_measures_pane(App& app);
void on_cursor_mode_changed(GObject* obj, GParamSpec*, gpointer user);
App::CursorLine cursors_line(App& app, const char* who, plot::Color chip, bool has_chip);
GtkWidget* cursors_header(App& app);
/// The compact readouts at the top of the dock (`src/ui_dock.cpp`). The strings are the pages' own: the
/// pages' writers call the `dock_*` setters from the same variable, so a number is formatted once.
GtkWidget* build_readouts_dock(App& app);
void dock_rebuild_cursors(App& app);
void dock_rebuild_measures(App& app);
void dock_cursor_cell(App& app, std::size_t line, const std::string& a, const std::string& b,
const std::string& d);
void dock_measure_value(App& app, std::size_t i, const std::string& text);
/// The signal chip of a measurement's row, in the colour every other view names that signal with.
std::string measure_chip_markup(App& app, const std::string& signal);
std::string row_unit(App& app, int row);
std::string slot_unit(App& app, int row, int slot);
std::uint32_t bound_slot_mask(App& app);