ui: the sidebar is two tabs, and a toggle disables its pane
Replace the sidebar's five-panel scrolling column with an AdwViewStack carrying two pages — Measure (cursors + measurements) and Signals (trigger + math + channel list) — with an AdwViewSwitcher above it. The trigger and cursors toggles change from "reveal/hide my pane" to "enable/disable my feature, leaving the pane insensitive", following the disable-not-hide principle. The keys probe loses a duplicate registration that was toggling the sidebar back on before the exit probe captured its state; the exit-probe captures now read adw_overlay_split_view_get_show_ sidebar() instead of gtk_widget_get_visible(), which AdwOverlaySplitView never changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
e10a92fc52
commit
44d2fd35dc
11 files changed
+227
-232
No files matched your search
+2
-14
@@ -3,7 +3,7 @@
|
||||
<!-- SPDX-FileCopyrightText: 2026 Martino Ferrari -->
|
||||
<!--
|
||||
The header bar: the time-window control's slot, the trigger, pause and events group with the separator that
|
||||
marks where the *view's* controls end, and the five at the far end.
|
||||
marks where the *view's* controls end, and the three at the far end.
|
||||
|
||||
The bar carries only the controls you reach for *while watching a signal*; everything you set up once lives
|
||||
in the overflow menu, which is code — its rows act on the `RowSet` directly and two of them are toggles
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
The order is the file's, and it is the one thing here that is not self-evident: `pack_end()` lays its
|
||||
children out right to left, so a `<child type="end">` is added leftwards-from-the-right in document order
|
||||
and the screen reads the reverse of it — cursors, measurements, math, sidebar, menu.
|
||||
and the screen reads the reverse of it — cursors, sidebar, menu.
|
||||
|
||||
The first start child is a slot and not the control: the time-window control is code (its menu's rows come
|
||||
from the buffer's limits), and `gtk_header_bar_pack_start()` appends *after* whatever a file has already
|
||||
@@ -64,18 +64,6 @@
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="math_toggle">
|
||||
<property name="icon-name">udpscope-math-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">channels derived from the others by a graph of operations: gain, absolute value, filters, sums and the rest. An enabled one is acquired, plotted and measured exactly like a signal</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="measures_toggle">
|
||||
<property name="icon-name">udpscope-measure-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">compute a value over the visible window of a signal, and optionally mark it on the plot</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="cursors_toggle">
|
||||
<property name="icon-name">udpscope-cursors-symbolic</property>
|
||||
|
||||
+58
-13
@@ -3,7 +3,7 @@
|
||||
<!-- SPDX-FileCopyrightText: 2026 Martino Ferrari -->
|
||||
<!--
|
||||
The main window's skeleton: the window, the split view that puts the sidebar beside the plot, the
|
||||
events pane's divider, the plot column with the status line under it, and the sidebar's scroller.
|
||||
events pane's divider, the plot column with the status line under it, and the sidebar's tab stack.
|
||||
|
||||
The sidebar is an `AdwOverlaySplitView`, which is what a utility sidebar is in GNOME (as against
|
||||
`AdwNavigationSplitView`, which is for navigation lists). Three things follow from that, and they are
|
||||
@@ -20,7 +20,7 @@
|
||||
What is *not* here is as deliberate as what is. Everything this file nests is fixed — the shape of
|
||||
the window does not depend on the stream, the trigger or the layout — while the subtrees that do are
|
||||
built by code and put in place: the events pane, into `events_divider`'s start side; the two plot
|
||||
areas, into the split inside `plot_box`; the sidebar's panels, appended to `side_column`; and the
|
||||
areas, into the split inside `plot_box`; the sidebar's panels, appended to `measure_page` and `signals_page`; and the
|
||||
status popover, attached to `status_info`.
|
||||
|
||||
The header bar is not here either: it is the window's own titlebar, built by `build_toolbar()`
|
||||
@@ -48,18 +48,63 @@
|
||||
<property name="min-sidebar-width">320</property>
|
||||
<property name="max-sidebar-width">320</property>
|
||||
<property name="sidebar">
|
||||
<!-- The column scrolls as a whole, so a long signal list or a revealed trigger panel can
|
||||
never push either panel out of the window. -->
|
||||
<object class="GtkScrolledWindow" id="side_scroll">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<property name="min-content-width">300</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="side_column">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="width-request">300</property>
|
||||
<!-- A switcher above a stack, and a scroller *per page*: the two pages are different
|
||||
heights, so one shared scroller around the stack would leave a tab switch scrolled
|
||||
to somewhere the new page never asked for. The switcher is the sibling above, not a
|
||||
child of either scroller: the one control that chooses what you are looking at must
|
||||
not be the first thing to scroll away. -->
|
||||
<object class="GtkBox" id="side_column">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="width-request">300</property>
|
||||
<child>
|
||||
<object class="AdwViewSwitcher" id="side_switcher">
|
||||
<property name="stack">side_stack</property>
|
||||
<property name="policy">wide</property>
|
||||
<property name="margin-top">4</property>
|
||||
<property name="margin-bottom">4</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
</object>
|
||||
</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStack" id="side_stack">
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<object class="AdwViewStackPage">
|
||||
<property name="name">measure</property>
|
||||
<property name="title" translatable="yes">Measure</property>
|
||||
<property name="child">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="measure_page">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="AdwViewStackPage">
|
||||
<property name="name">signals</property>
|
||||
<property name="title" translatable="yes">Signals</property>
|
||||
<property name="child">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<property name="child">
|
||||
<object class="GtkBox" id="signals_page">
|
||||
<property name="orientation">vertical</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</property>
|
||||
<property name="content">
|
||||
|
||||
Reference in new issue
Block a user