Take the label field off the sheet while the name is hidden

An element whose name must not be drawn left its label field behind
as an empty frame: selected along with the element, ready to click,
drawing nothing. The field now follows the Show name box both ways:

- a field bound to the label is hidden while Element::labelShown()
  says no, and shown again the moment the box is ticked again, both
  through the same signals which refresh the text (elementInfoChange,
  the label connection refresh, binding the field to another
  information), so it can never get stuck on one side;
- a hidden field is deselected and gets no resize handles, and one
  which comes back gets its handles back when its element is still
  selected;
- every other field, composite texts included, is drawn as always,
  and the data of the element never changes - only the drawing.

Adds a test: the field is visible, goes away with the name, and
comes back with it.
This commit is contained in:
Kellermorph
2026-10-22 13:18:55 +02:00
parent edf761c2b6
commit 337502edfc
4 changed files with 76 additions and 2 deletions
+4
View File
@@ -1690,6 +1690,10 @@ void Element::addDynamicTextItem(DynamicElementTextItem *deti)
m_dynamic_text_list.append(deti);
//An element whose name must not be drawn does not keep the
//field of its label on the sheet either (@sa Element::labelShown)
deti->refreshLabelShown();
//A field of its own for the terminal number is what the label
//leaves the number to: the fields which draw the label follow
//when such a field lands on the symbol