Wire the develop panels through globals, so a second copy is one line
Every panel in the develop column declared its inputs and its callbacks and had `app.slint` bind each one to a property or a callback on the window root. That is fine while a panel is drawn once. N9 draws them a second time, in the portrait dock, and the wiring is what would have to be copied: `MaskPanel` alone ran to forty lines of forwarding, and a callback added to one copy and not the other compiles, renders, and simply does nothing on the layout nobody was looking at. So the wiring moved to Slint globals. A panel reads the global and calls the global; Rust hooks the global instead of the window; and the instantiation in the column is now the panel's name and a pair of braces — every one of the ten children of the column, with no property that differs by placement left to supply. There is a global per panel family rather than one for all of them, and the reason is an import cycle. Each panel's model struct — `ParamRow`, `MaskRow`, `HistogramView` — is declared in the panel's own file, so a single global holding `[MaskRow]` and `[ParamRow]` would have to live in a file importing `masks.slint` and `adjust.slint` while both imported the global back, which Slint rejects. Breaking that needs six model declarations relocated, which is a change to the data model and not to the plumbing this is about. A global beside the panel it serves also lets each name drop the prefix it was carrying only because the window root is one flat namespace: `root.spot-radius` is `Repair.radius`, and `root.peaking-on` is `Peaking.showing`. `session.slint` is new and holds the two facts every family needs and none of them owns: whether there is an open photograph to edit, and which mode the view is in, with the three readings of the mode derived once instead of at each of the dozen places that tested one. `ViewMode` moves there from `adjust.slint`, where it was only ever a lodger. Nothing on screen changes. What is not here: the tool rail and the status strip still take their properties at the instantiation, because they are drawn once and N9 does not copy them; the preset sheet's own state stays on the window, because the library grid opens the same sheet and a global cannot bind the window's state — which is why `Transfer.open-presets` is handled in `presets.rs`, beside the summary it already had to compute.
This commit is contained in:
+26
-14
@@ -208,14 +208,17 @@ export component StatusBar inherits Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
// Capture metadata. Read-only; the adjustment controls live in AdjustPanel,
|
||||
// which is generated from pipeline capabilities rather than written here.
|
||||
//
|
||||
// Flat, like everything else in this column. This was briefly a collapsible
|
||||
// section so that every panel could be put away; the sidebar as a whole now
|
||||
// closes from the status strip instead, which is the control that was actually
|
||||
// wanted, and the per-group lids only stood between the user and the controls.
|
||||
export component InfoPanel inherits Rectangle {
|
||||
/// What the file says about how the photograph was taken.
|
||||
///
|
||||
/// A global rather than four properties on the panel, for the reason
|
||||
/// `session.slint` gives at length: the panel is drawn twice — once in the
|
||||
/// develop column and once in the portrait dock — and four lines of forwarding
|
||||
/// copied into the second composition is four lines that can fall behind the
|
||||
/// first without anything failing.
|
||||
///
|
||||
/// Nothing here is a control. It is the one panel in the column that only
|
||||
/// reports, which is why this global carries no callback at all.
|
||||
export global Capture {
|
||||
in property <string> camera;
|
||||
/// TRACES: FR-DEV-3
|
||||
/// The lens, and whether it matched a correction profile.
|
||||
@@ -230,7 +233,16 @@ export component InfoPanel inherits Rectangle {
|
||||
in property <string> lens;
|
||||
in property <string> exposure;
|
||||
in property <string> dimensions;
|
||||
}
|
||||
|
||||
// Capture metadata. Read-only; the adjustment controls live in AdjustPanel,
|
||||
// which is generated from pipeline capabilities rather than written here.
|
||||
//
|
||||
// Flat, like everything else in this column. This was briefly a collapsible
|
||||
// section so that every panel could be put away; the sidebar as a whole now
|
||||
// closes from the status strip instead, which is the control that was actually
|
||||
// wanted, and the per-group lids only stood between the user and the controls.
|
||||
export component InfoPanel inherits Rectangle {
|
||||
background: transparent;
|
||||
height: panel.preferred-height;
|
||||
|
||||
@@ -243,23 +255,23 @@ export component InfoPanel inherits Rectangle {
|
||||
PanelHeading { text: "IMAGE"; }
|
||||
|
||||
Value {
|
||||
text: root.camera == "" ? "—" : root.camera;
|
||||
placeholder: root.camera == "";
|
||||
text: Capture.camera == "" ? "—" : Capture.camera;
|
||||
placeholder: Capture.camera == "";
|
||||
wrap: word-wrap;
|
||||
}
|
||||
|
||||
Label { text: root.exposure; }
|
||||
Label { text: Capture.exposure; }
|
||||
|
||||
// Dim, like the dimensions below it: this is something the file says,
|
||||
// not something the photographer chose. An empty string draws nothing
|
||||
// — a session built from pixels with no header has no lens to report,
|
||||
// and an empty row is honest where "Unknown" would be noise.
|
||||
Caption {
|
||||
text: root.lens;
|
||||
visible: root.lens != "";
|
||||
text: Capture.lens;
|
||||
visible: Capture.lens != "";
|
||||
wrap: word-wrap;
|
||||
}
|
||||
|
||||
Caption { text: root.dimensions; }
|
||||
Caption { text: Capture.dimensions; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user