ui: draw the sidebar tabs without the placeholder icon

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Martino FerrariandClaude Opus 4.6 committed 2026-11-02 12:11:16 +01:00
1 parent 5bb23e6a0a
commit 0c6e69957d
6 files changed
+75 -8

No files matched your search

+6 -1
View File
@@ -252,7 +252,12 @@ Part of [CLAUDE.md](../../CLAUDE.md). These are rules that cost a defect to lear
session file. An icon-only version existed (policy `narrow`, empty titles, the pills named in code by
`name_side_tabs()`, because `narrow` still draws a label beside an icon); it was reversed because the
glyphs were not understandable. A page added with an empty title is a blank pill, and
`switcher: … pills=N labels=N pages=N` reads it as `labels` below `pills`.
`switcher: … pills=N labels=N images=0 pages=N` reads it as `labels` below `pills`. **No icon at all**
is not what "no `icon-name`" gives you: `AdwViewSwitcherButton` always builds a `GtkImage` and falls
back to `image-missing` (the `[x]` placeholder, which also squeezed the title to "Meas..."), and no
property turns it off. `keep_tabs_icon_free()` (`src/ui_source.cpp`) hides every image in the switcher,
re-hides one that is shown again, and re-runs on the stack's `items-changed` (connected *after* the
switcher's own, so the new button exists) and on the switcher's `map`; `images=0` is the reading.
- **An *overlaid* sidebar covers the plot, so a drag out of it has nowhere to land.** `collapsed` in an
`AdwOverlaySplitView` means the sidebar sits *on* the plot rather than beside it: the pointer is over the
list, never over a drop target, and a signal can be dragged but not dropped. `row_drag_sidebar()` hides
+8 -2
View File
@@ -479,9 +479,15 @@ Two lines of the self-check output are assertions in disguise:
substitutes a missing-image placeholder, the button still works, and every other line of the
dump still passes. Changing an icon name is a one-line change in `build_toolbar()` and this
is the only check that it names something that exists.
- `switcher: policy=wide pills=4 labels=4 pages=4 size=308x34` (in the exit dump, beside `panels:`) — the
- `switcher: policy=wide pills=4 labels=4 images=0 pages=4 size=308x34` (in the exit dump, beside `panels:`) — the
sidebar tabs as the switcher actually draws them, and they are **words**: `labels` counts *mapped labels
with text*, so `pills=labels=pages` says every page has a visible title. `pages` is read from the stack
with text*, so `pills=labels=pages` says every page has a visible title. **`images` must be `0`**: it
counts *mapped* `GtkImage`s inside the switcher. `AdwViewSwitcherButton` builds an icon in every tab, and
a page with a title and no `icon-name` gets `image-missing` -- the `[x]` placeholder; the tabs hide it
(`keep_tabs_icon_free()`, which also covers pages `build_source_panels()` adds). A nonzero `images`
names a tab still drawing an icon or its placeholder (`images=pages` is the unfixed state), and
`pills`/`labels` never saw it. Read it on a source with extra pages (`--source probe` under
`UDPSCOPE_PROBE_SOURCE_KINDS`) as well as on UDPS. `pages` is read from the stack
(2 for UDPS, 3 for the probe source, 4 for the E-1608 with its Analog out and Digital I/O tabs). A
`labels` below `pills` is a page added with an empty title; `pills=0` means nothing is mapped, which
makes the rest of the line meaningless rather than a pass. `policy=wide` is read rather than assumed.