ui: the readouts strip is also shown in a collapsed window

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martino FerrariandClaude Sonnet 4.6 committed 2026-11-03 10:50:55 +01:00
1 parent 3526ce0541
commit 1d144663b9
4 files changed
+36 -22

No files matched your search

+10 -5
View File
@@ -11,7 +11,8 @@
//
// The same strings are shown a third time in the readouts strip under the plot (`readouts_strip`, one
// fixed-height line: a "Cursors" button, one chip per cursor line with its delta, a "Measures" button, one
// chip per measurement with its value), which is on screen exactly when the dock is not. The setters below
// chip per measurement with its value), which is on screen whenever the dock is not beside the plot (hidden
// with the Dock button, or the window collapsed and the dock an overlay). The setters below
// write the strip's labels in the same call as the dock's, from the same argument, so there is still one
// string and no second formatter.
//
@@ -345,10 +346,14 @@ void dock_set_cursors_sensitive(App& app, bool on) {
void sync_readouts_strip(App& app) {
if (app.readouts_strip == nullptr || app.side_view == nullptr) return;
// The strip is on screen exactly when the dock is not: `show-sidebar` is false when the dock is hidden
// with the Dock button, and when the window is collapsed and the dock is not currently overlaid.
const bool want =
!adw_overlay_split_view_get_show_sidebar(ADW_OVERLAY_SPLIT_VIEW(app.side_view));
// The strip is on screen whenever the dock is not *beside* the plot: hidden with the Dock button, or
// the window collapsed (compact mode), where the dock overlays the plot -- even while the overlay is
// open -- and is not a readout you can keep an eye on while looking at the trace. `collapsed` is the
// split view's value from the previous frame (the tick calls this before `set_collapsed()`), so the
// strip follows a collapse or a widening one tick late; `show-sidebar` is the wish just re-asserted.
AdwOverlaySplitView* split = ADW_OVERLAY_SPLIT_VIEW(app.side_view);
const bool want = !adw_overlay_split_view_get_show_sidebar(split) ||
adw_overlay_split_view_get_collapsed(split);
if ((gtk_widget_get_visible(app.readouts_strip) != FALSE) != want) {
gtk_widget_set_visible(app.readouts_strip, want);
}