Properties: a hidden-slots toggle, and bools filled by their state
@hidden is now filtered by default. niagara.html says hidden slots "are
designed to be invisible to the user" and that interfaces should rarely
display them; every one under Sedona home is a void action a kit uses
internally, such as HdwAI.checkType. A "Hidden slots (n)" checkbox in the
footer brings them back and the answer sticks for the session. The checkbox
only appears on a type that has some, and the rows are always built -- the
toggle grid_removes and re-grids them, so an emptied grid row collapses rather
than leaving a gap.
A bool now says which state it is in by the colour of its field rather than by
a dot beside it that had to be learnt: green true, red false, blue null, with
the words left black so they read as easily as every other value. Dropping the
dot also lets a bool's field line up with the numbers above and below it.
Two things that needed changing to get there:
- a dropdown is offered only where there is a choice to make. A read-only
bool or enum gets a plain field, since a disabled dropdown is an arrow
that does nothing -- and a read-only bool is still filled, because a
runtime bool has a state too.
- the dropdown is a tk.OptionMenu, not a ttk.Combobox. On the Windows themes
a Combobox draws its field with a native element and ignores
fieldbackground outright, so a bool could never be filled with its colour.
An OptionMenu reports through its variable rather than an event, which means
loading a row looks exactly like choosing one -- so the load is flagged and the
unsaved-state tint left alone until every row is in, or the view would open
already claiming edits nobody made.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,7 +5,7 @@ component hierarchy as a navigation tree, paints the selected folder's children
|
||||
wiresheet of draggable component boxes, draws the links between them, and writes box
|
||||
positions back into each component's `meta` property on save.
|
||||
|
||||
Current version: **0.0.0.048** (see [Versioning](#versioning)).
|
||||
Current version: **0.0.0.051** (see [Versioning](#versioning)).
|
||||
|
||||
## Requirements
|
||||
|
||||
@@ -151,7 +151,7 @@ than leaving the selection looking like it did nothing. So does deleting the com
|
||||
is showing, from anywhere -- every delete in the UI goes through `delete_component`,
|
||||
because `sax_file` does its own view refresh rather than going through `refresh_all_views`.
|
||||
|
||||
It lists **every** slot the manifest declares,
|
||||
It lists every slot the manifest declares -- bar one kind, see **Hidden slots** below --
|
||||
in manifest order, each row numbered with the same slot id the wiresheet box uses. The
|
||||
box's visibility rules do not apply here: they are right for a diagram and wrong for the
|
||||
one place a value is meant to be changed, so `HvacControl` shows all 47 rows rather than
|
||||
@@ -177,10 +177,27 @@ A runtime slot holds a live value that no offline file carries, so nothing here
|
||||
usefully write one; a `@readonly` config slot is the manifest saying the same about a
|
||||
value that *is* persisted. Both read the same way on screen.
|
||||
|
||||
A **dropdown is offered only where there is a choice to make**. A read-only bool or enum
|
||||
gets a plain field instead, since a disabled dropdown is an arrow that does nothing -- and
|
||||
a read-only bool is still filled by its state, because a runtime bool has a state too.
|
||||
|
||||
The dropdown is a `tk.OptionMenu` rather than a `ttk.Combobox`, for one reason: on the
|
||||
Windows themes a Combobox draws its field with a native element and **ignores
|
||||
`fieldbackground` outright**, so a bool could never be filled with its colour. The plain Tk
|
||||
widget takes the colour it is given. It reports a change through its variable rather than
|
||||
an event, which also catches a value set from anywhere else -- and means loading a row
|
||||
looks exactly like choosing one, so the load is flagged and the tint left alone until every
|
||||
row is in.
|
||||
|
||||
Each row is drawn from the slot's facets, so it reads the way the kit author meant it to:
|
||||
|
||||
- `@trueText` / `@falseText` turn a bool into its own two words -- `Disabled` / `Enabled`
|
||||
rather than false / true -- in a dropdown, with a red or green dot beside it.
|
||||
rather than false / true -- and **the field is filled by the state**: green for true,
|
||||
red for false, blue for null. It began as a coloured dot beside the field, which meant
|
||||
learning what the dot stood for, then as coloured text; a block of colour carries down a
|
||||
long list of slots where a letterform does not, and the words stay black so they read as
|
||||
easily as every other value. Dropping the dot also let a bool's field line up with the
|
||||
numbers above and below it.
|
||||
- **Null is a value, not an absence.** Sedona models it as NaN for a float and a sentinel
|
||||
for the integer types, and a config slot can genuinely hold it: `control::WriteFloat`
|
||||
pairs an `in` property with a `setNull` action, and the sample app carries
|
||||
@@ -262,6 +279,19 @@ system selection.
|
||||
`mark_clean` through a callback `main` registers -- the same shape `undo` uses for its view
|
||||
refresh, and what keeps `app_state` free of any idea that a Properties view exists.
|
||||
|
||||
### Hidden slots
|
||||
|
||||
`@hidden` is the one facet the view filters on, and only by default. niagara.html says
|
||||
hidden slots "are designed to be invisible to the user" and that interfaces should rarely
|
||||
display them; every one under Sedona home is a `void` action a kit uses internally, such
|
||||
as `HdwAI.checkType`. A **Hidden slots (n)** checkbox in the footer brings them back, and
|
||||
the answer sticks for the session rather than being asked again for every component.
|
||||
|
||||
The rows are always built -- the checkbox `grid_remove`s and re-`grid`s them, which keeps
|
||||
each widget's options so putting a row back needs no arithmetic, and an emptied grid row
|
||||
collapses rather than leaving a gap. The checkbox itself only appears on a type that has
|
||||
something to reveal, so most components carry no control for a thing they do not have.
|
||||
|
||||
### Unsaved edits in the Properties view
|
||||
|
||||
An edited field paints the whole view in **`app_state.DIRTY_TINT`** -- the same colour
|
||||
@@ -431,7 +461,6 @@ Read against `SedonaDoc/niagara.html`, which is what tells Niagara -- and so thi
|
||||
|
||||
| Facet | Where it is used | Why not |
|
||||
|---|---|---|
|
||||
| `hidden` | 129 slots, every one a `void` action such as `HdwAI.checkType` | The doc says user interfaces should rarely display hidden slots, and the reference tool appears not to. This view shows every slot because that is what it is for; say the word and it will skip them. |
|
||||
| `fieldWidth` | 3082 slots | A per-slot column count for the text field. Applying it would make the value column ragged; a table reads better with one width. |
|
||||
| `radix`, `showSeparators`, `multiLine`, `fieldEditor` | unused by any kit under Sedona home | Nothing to render. |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user