feat: the cursors panel is a UI file

src/ui/cursors-panel.ui holds the panel's shape -- the header with the mode dropdown and the reset
button, and the grid the two cursor times are read in. What is not in it is the grid's contents,
which follow the cursor mode and the rows and are rebuilt whenever either changes.

Panels need a builder that outlives them, unlike the dialogs, which are rebuilt on every opening: a
widget belongs to the builder that built it, so App::ui_builders holds each panel's for the life of
the window. ui_load() is that, in ui_widgets.cpp.

make test-ui also checks that udpscope-ui.gresource.xml lists every .ui file now. That was the third
trap of this refactor -- a file on disk but not in the resource is a Gtk-ERROR at load, which aborts
-- and it is a compile-time mistake that nothing else in the build could see. Verified by unlisting
the new file and watching the check fail, then restoring it.

[cursors-probe] reads as it did: all four modes, pane=1, the timings and the drag cases.
This commit is contained in:
Martino Ferrari committed 2026-10-12 10:47:34 +02:00
1 parent 7a982da6c4
commit ed82abd405
8 files changed
+118 -25

No files matched your search

+50
View File
@@ -0,0 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-License-Identifier: MIT -->
<!-- SPDX-FileCopyrightText: 2026 Martino Ferrari -->
<!--
The cursors panel: a header with the mode's dropdown and the reset button, and the grid the two
cursor times are read in, one line per row of the figure.
The grid's *contents* are not here: they follow the cursor mode and the rows, and they are rebuilt
whenever either changes (`rebuild_cursors_pane()`). What is here is the panel's shape, the dropdown
and the button, and the grid they sit above.
-->
<interface>
<object class="GtkBox" id="cursors_panel">
<property name="orientation">vertical</property>
<property name="spacing">4</property>
<property name="margin-top">6</property>
<property name="margin-bottom">6</property>
<property name="margin-start">6</property>
<property name="margin-end">6</property>
<child>
<object class="GtkBox" id="head">
<property name="orientation">horizontal</property>
<property name="spacing">8</property>
<child>
<object class="GtkLabel" id="title">
<property name="label" translatable="yes">Cursors</property>
<property name="halign">start</property>
<property name="hexpand">1</property>
</object>
</child>
<child>
<object class="GtkDropDown" id="mode_drop"/>
</child>
<child>
<object class="GtkButton" id="reset">
<property name="icon-name">edit-clear-symbolic</property>
<property name="valign">center</property>
<property name="css-classes">flat</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkGrid" id="body">
<property name="row-spacing">2</property>
<property name="column-spacing">4</property>
</object>
</child>
</object>
</interface>
+1
View File
@@ -14,5 +14,6 @@
<file preprocess="xml-stripblanks">help.ui</file>
<file preprocess="xml-stripblanks">source-form.ui</file>
<file preprocess="xml-stripblanks">main-window.ui</file>
<file preprocess="xml-stripblanks">cursors-panel.ui</file>
</gresource>
</gresources>