fa01b9c8e0
Toggle left of the lava popover hides release content so the visualizer fills the surface; player bar grows to carry the playing release's cover, title, and share. State on WaveformVisualizerControlState; pages and bar observe it.
50 lines
2.3 KiB
Plaintext
50 lines
2.3 KiB
Plaintext
@namespace DeepDrftPublic.Client.Controls
|
|
@using DeepDrftPublic.Client.Services
|
|
@implements IDisposable
|
|
@inject WaveformVisualizerControlState State
|
|
|
|
@* Theater-Mode toggle (Phase 20 §3). The single affordance placed identically on all three release
|
|
detail pages — immediately to the LEFT of the lava-lamp WaveformVisualizerControlPopover trigger.
|
|
It is purely a mutation surface: tapping it flips State.TheaterMode and raises Changed; the detail
|
|
pages observe that to gate their content @if, and the player bar observes it to grow. This component
|
|
reaches into no page and no bar — single source, multiple observers (§6).
|
|
|
|
Visible only when the lava OR waveform subsystem is on — there is nothing to go to theater FOR if both
|
|
are off (§3.2). Disabled until interactive (§3.4), the same prerender guard the lava/Play buttons use.
|
|
Active visual state when Theater is ON. .dd-accent-icon gives the green-accent glyph in both themes
|
|
with zero new CSS (§8) — same treatment as the lava-lamp trigger it sits beside. *@
|
|
|
|
@if (State.LavaEnabled || State.WaveformEnabled)
|
|
{
|
|
<div class="dd-accent-icon">
|
|
<MudTooltip Text="@(State.TheaterMode ? "Exit theater mode" : "Theater mode")">
|
|
<MudIconButton Icon="@Icons.Material.Filled.Theaters"
|
|
Size="@IconSize"
|
|
Color="Color.Secondary"
|
|
Disabled="@(!RendererInfo.IsInteractive)"
|
|
OnClick="@Toggle"
|
|
aria-label="Theater mode"
|
|
aria-pressed="@State.TheaterMode" />
|
|
</MudTooltip>
|
|
</div>
|
|
}
|
|
|
|
@code {
|
|
/// <summary>Trigger-icon size. Defaults Large to match the lava-lamp popover trigger it sits beside.</summary>
|
|
[Parameter] public Size IconSize { get; set; } = Size.Large;
|
|
|
|
protected override void OnInitialized() => State.Changed += OnStateChanged;
|
|
|
|
// The toggle's own visibility and active state both key off State, which another observer (or this
|
|
// button) may mutate, so re-render on every Changed — same idempotent posture the visualizer bridge uses.
|
|
private void OnStateChanged() => InvokeAsync(StateHasChanged);
|
|
|
|
private void Toggle()
|
|
{
|
|
State.TheaterMode = !State.TheaterMode;
|
|
State.NotifyChanged();
|
|
}
|
|
|
|
public void Dispose() => State.Changed -= OnStateChanged;
|
|
}
|