fix(socials): live preview of the bar appearance + the crash on dragging a slider
Two bugs from the creator's first look at the new controls.
1. CRASH — '{DependencyProperty.UnsetValue}' is not a valid value for property 'Fill'.
The token conversion deleted `YtSliderKnobHoverBrush` while two slider triggers still
referenced it. WPF does not fail that at build time: it substitutes UnsetValue and throws at
the next layout, inside `Ellipse.OnRender` — so the first slider touched (the new opacity one)
killed the app. The brush is back, as a glossier version of the rest state.
Guard: `ThemeResourceTests` scans every app XAML and proves each {StaticResource} key is
defined (theme/App resources or the same file). Proven by removing the key again — the test
names it.
2. PREVIEW DID NOTHING — the preview bar is its own XAML rendering (not the rasterized strip the
compositor overlays), and it was hard-wired white-on-transparent, so the drawer's controls had
nothing to move. Now:
- `SocialBarTextBrush` / `SocialBarBackgroundBrush` come from the same `SocialBarStyle` the
renderer bakes, so preview and output cannot disagree.
- the preview draws the plate (same colour + opacity) and the drop shadow.
- the drawer applies changes to the live config as you edit (`ApplyAppearancePreview`), and
Cancel restores the pre-edit snapshot — so the preview tracks the controls without
persisting anything until Save.
46 tests green (theme, socials, design tokens, layout store, real-MainWindow meter test).
This commit is contained in:
@@ -359,6 +359,16 @@
|
||||
<GradientStop Color="{StaticResource Color.Tertiary}" Offset="1"/>
|
||||
</RadialGradientBrush>
|
||||
|
||||
<!-- Hover/drag knob: the same gloss with the highlight spread wider. The conversion to
|
||||
tokens deleted this key while two triggers still referenced it, and WPF turns a missing
|
||||
StaticResource into DependencyProperty.UnsetValue — which crashes Ellipse.OnRender at
|
||||
the next layout. ThemeResourceTests now catches that class of defect. -->
|
||||
<RadialGradientBrush x:Key="YtSliderKnobHoverBrush" Center="0.35,0.3" GradientOrigin="0.35,0.3">
|
||||
<GradientStop Color="#ffffff" Offset="0"/>
|
||||
<GradientStop Color="#ffffff" Offset="0.3"/>
|
||||
<GradientStop Color="{StaticResource Color.Tertiary}" Offset="1"/>
|
||||
</RadialGradientBrush>
|
||||
|
||||
<Style x:Key="YtSliderTrackButton" TargetType="RepeatButton">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Template">
|
||||
|
||||
Reference in New Issue
Block a user