TASK 59: the properties panel is a hierarchy, and the shape is a choice
The creator's ruling on the webcam's properties: a "Shape" title above the
Mirror/Rect row; the drag hint indented under that row "to show parentage";
the same for Geometry, Border Color, Border Thickness; Remove and Blur indented
under Background; Strength indented under Blur.
One rule covers it: a title owns its content and the content is indented one
level (10px) under it - two levels where a title is itself nested (Strength
under Blur under Background). The titles are SemiBold 11px #a0a0b0 like the
ones already there.
The shape also stops being a toggle button that shows the NEXT action ("Round"
when the camera was a rectangle) and becomes a CHOICE: two segment options,
Rect | Circle, with Rect selected by default - which is what the creator asked
for ("Rect should be selected as a default if none exists"). The old
ShapeButtonText is gone.
The mutual exclusion lives in the MODEL: IsRectShape/IsRoundShape on
SceneElement, each setter flipping the shape through ToggleClipShape() (so the
pre-round rect is still stored/restored) and always re-raising, so a refused
write - the vertical Chat layout is rect-only (TASK 57) - makes the UI snap
back instead of sticking. Deliberately NOT a WPF RadioButton group: a group
unchecks its siblings by setting IsChecked in code, which makes WPF drop the
binding (stackoverflow 7376373; the same trap measured in 50980687/57275046).
The Circle option stays hidden where CanToggleClipShape is false, so the circle
is still not offered in the vertical Chat layout.
Guard: ytLive.Tests/PropertiesHierarchyTests.cs - the model half (Rect by
default, pick circle, pick rect, the locked Chat layout refuses the circle) and
the panel half (the Shape title owns both options, the circle is the gated one,
the hint is indented and follows the row, every titled block's content is at
10px, Strength at 20px). 432/432 green, 0 warnings.
This commit is contained in:
+30
-2
@@ -120,7 +120,36 @@ public abstract class SceneElement : INotifyPropertyChanged
|
||||
set
|
||||
{
|
||||
if (Set(ref _clipShape, value))
|
||||
Raise(nameof(ShapeButtonText));
|
||||
{
|
||||
Raise(nameof(IsRectShape));
|
||||
Raise(nameof(IsRoundShape));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>True when the element's clip is the plain rectangle — the shape a
|
||||
/// camera has when none was ever picked (TASK 59: the properties panel shows
|
||||
/// the shape as a CHOICE, and Rect is the selected default).</summary>
|
||||
public bool IsRectShape
|
||||
{
|
||||
get => ClipShape != ClipShape.Round;
|
||||
set
|
||||
{
|
||||
// Round -> rect (restores the pre-round rect, like the toggle does).
|
||||
if (value && ClipShape == ClipShape.Round) ToggleClipShape();
|
||||
Raise(nameof(IsRectShape));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>True when the element's clip is a circle (TASK 59).</summary>
|
||||
public bool IsRoundShape
|
||||
{
|
||||
get => ClipShape == ClipShape.Round;
|
||||
set
|
||||
{
|
||||
// Rect -> round (stores the pre-round rect, like the toggle does).
|
||||
if (value && ClipShape != ClipShape.Round) ToggleClipShape();
|
||||
Raise(nameof(IsRoundShape));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -170,7 +199,6 @@ public abstract class SceneElement : INotifyPropertyChanged
|
||||
|
||||
public double MirrorScale => IsMirrored ? -1 : 1;
|
||||
public string MirrorButtonText => IsMirrored ? "Unmirror" : "Mirror";
|
||||
public string ShapeButtonText => ClipShape == ClipShape.Round ? "Rect" : "Round";
|
||||
|
||||
// Live camera frames: the shared WriteableBitmap owned by CameraManager.
|
||||
private WriteableBitmap? _videoImageSource;
|
||||
|
||||
Reference in New Issue
Block a user