Moving the editor's frame into math-editor.ui left `math_body` and `math_actions` as <child> elements of the *window* rather than of `math_outer`, because those edits were anchored on the file's tail and closed the outer box two elements early. A GtkWindow takes exactly one default <child>, so nothing failed loudly: the body -- with the canvas and the parameter form inside it -- was left parentless, visible but never mapped, 0x0, drawing nothing. Two symptoms, one cause: the canvas is blank, and the window is sized around the head row and the buttons alone. Measured against the pre-move revision in a worktree, same probe, same environment: before this fix `canvas=0x0 mapped=0 window=756x940`; after it `canvas=420x836 mapped=1 window=938x940`, which is the old revision's own reading exactly. It survived because that slice's probe read the editor's *values* (nodes, gain, output, name, unit) and nothing about its structure. Every other panel moved that day has a structural reading -- `controls_inside=13/13`, `nested=1`, `labels=2 list=1` -- and none of them was affected. `[math-probe] editor frame:` is that reading now: the canvas's allocation, its mapped state, and whether the canvas and the name entry are inside the dialog at all, delayed 500 ms because an allocation only exists after a layout. In the broken build it read `0x0 mapped=0 in_dialog=0`. check_ui passes both files: the XML was valid and every property type-checked.
85 lines
3.4 KiB
XML
85 lines
3.4 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!-- SPDX-License-Identifier: MIT -->
|
|
<!-- SPDX-FileCopyrightText: 2026 Martino Ferrari -->
|
|
<!--
|
|
The math channel editor's window and its identity row: the name the channel is called, and the unit its
|
|
readouts carry.
|
|
|
|
The canvas below them is *declared* here but *drawn* by code (`GtkDrawingArea`); the parameter form beside
|
|
it and the palette are code as well, because the form follows which node is selected and the palette is the
|
|
operation table itself — neither is data a file should hold. What is here is the frame: the window, the
|
|
identity row, the body with the canvas in it, and the two buttons that end the dialog.
|
|
|
|
The window's title is not here: it says which mode the editor is in ("Edit math channel" against "New math
|
|
channel"), which the code that opens it knows and a file cannot.
|
|
|
|
The name takes the slack and the unit does not: the name is also how another graph refers to this channel
|
|
as a source, so it is the one that should grow as the window does.
|
|
-->
|
|
<interface>
|
|
<object class="GtkWindow" id="math_window">
|
|
<property name="default-width">720</property>
|
|
<property name="default-height">420</property>
|
|
<property name="modal">1</property>
|
|
<child>
|
|
<object class="GtkBox" id="math_outer">
|
|
<property name="orientation">vertical</property>
|
|
<property name="spacing">8</property>
|
|
<property name="margin-top">10</property>
|
|
<property name="margin-bottom">10</property>
|
|
<property name="margin-start">10</property>
|
|
<property name="margin-end">10</property>
|
|
<child>
|
|
<object class="GtkBox" id="math_head">
|
|
<property name="orientation">horizontal</property>
|
|
<property name="spacing">8</property>
|
|
<child>
|
|
<object class="GtkEntry" id="math_name">
|
|
<property name="placeholder-text" translatable="yes">name</property>
|
|
<property name="hexpand">1</property>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkEntry" id="math_unit">
|
|
<property name="placeholder-text" translatable="yes">unit (optional)</property>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkBox" id="math_body">
|
|
<property name="orientation">horizontal</property>
|
|
<property name="spacing">10</property>
|
|
<child>
|
|
<object class="GtkDrawingArea" id="math_canvas">
|
|
<property name="width-request">420</property>
|
|
<property name="height-request">300</property>
|
|
<property name="hexpand">1</property>
|
|
<property name="vexpand">1</property>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkBox" id="math_actions">
|
|
<property name="orientation">horizontal</property>
|
|
<property name="spacing">6</property>
|
|
<property name="halign">end</property>
|
|
<child>
|
|
<object class="GtkButton" id="math_cancel">
|
|
<property name="label" translatable="yes">Cancel</property>
|
|
</object>
|
|
</child>
|
|
<child>
|
|
<object class="GtkButton" id="math_apply">
|
|
<property name="label" translatable="yes">Add</property>
|
|
<property name="css-classes">suggested-action</property>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</child>
|
|
</object>
|
|
</interface>
|