Files
RedLintu16andClaude Opus 5.5 7caaccbd49 Rebuild the CrossSound Game Bar widget from scratch
A new UWP widget against CrossSound's local API (127.0.0.1:8963):
- Player with an interpolated clock, seek-on-release, play/pause, prev/next,
  like, shuffle, volume and mute
- Queue, Discover (history + shelves, refresh, play all, detail views) and
  Search (tracks, playlists, albums, artists)
- /events and /appearance/events loops with back-off and a visible
  connection status; signed-out states shown as such
- RedWhite styling with live theme from CrossSound's /appearance
- deploy.ps1 to build and register for the current user

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 19:58:36 -07:00

390 lines
25 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--
RedWhite tokens. One brush per token, shared by everything through StaticResource;
Services/ThemeManager.cs recolors them live (from CrossSound's /appearance, else the fixed
light/dark palettes). The values here are the light palette, shown until the first apply.
-->
<SolidColorBrush x:Key="RwRed" Color="#FFFF0000" />
<SolidColorBrush x:Key="RwRedHover" Color="#FFFF6459" />
<SolidColorBrush x:Key="RwRedTint" Color="#0FFF0000" />
<SolidColorBrush x:Key="RwRedSoft" Color="#1FFF0000" />
<SolidColorBrush x:Key="RwRedBorder" Color="#38FF0000" />
<SolidColorBrush x:Key="RwOnRed" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="RwBg" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="RwBgSoft" Color="#FFFFF5F5" />
<SolidColorBrush x:Key="RwBg2" Color="#FFFFEBEB" />
<SolidColorBrush x:Key="RwText" Color="#FFFF0000" />
<SolidColorBrush x:Key="RwTextMuted" Color="#FFDA4545" />
<SolidColorBrush x:Key="RwTextSubtle" Color="#FFFF746C" />
<SolidColorBrush x:Key="RwIconInactive" Color="#FFE58B8B" />
<SolidColorBrush x:Key="RwHoverColor" Color="#FFFF7373" />
<SolidColorBrush x:Key="RwField" Color="#12FF0000" />
<SolidColorBrush x:Key="RwFieldFocus" Color="#1FFF0000" />
<SolidColorBrush x:Key="RwLine" Color="#FFFF0000" />
<SolidColorBrush x:Key="RwHair" Color="#FFDD2D4A" />
<!-- Raleway is bundled (Assets/Fonts, OFL); Segoe UI is the fallback. -->
<FontFamily x:Key="RwFont400">ms-appx:///Assets/Fonts/Raleway-Regular.ttf#Raleway, Segoe UI</FontFamily>
<FontFamily x:Key="RwFont500">ms-appx:///Assets/Fonts/Raleway-Medium.ttf#Raleway, Segoe UI</FontFamily>
<FontFamily x:Key="RwFont700">ms-appx:///Assets/Fonts/Raleway-Bold.ttf#Raleway, Segoe UI</FontFamily>
<FontFamily x:Key="RwFont800">ms-appx:///Assets/Fonts/Raleway-ExtraBold.ttf#Raleway, Segoe UI</FontFamily>
<FontFamily x:Key="RwIconFont">Segoe Fluent Icons, Segoe MDL2 Assets</FontFamily>
<!-- Type roles: title 16/700, body 14/500, caption 12.5/500 muted, label 11/700 caps + 0.08em. -->
<Style x:Key="RwTitle" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource RwFont700}" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="16" />
<Setter Property="Foreground" Value="{StaticResource RwText}" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
<Setter Property="TextWrapping" Value="NoWrap" />
</Style>
<Style x:Key="RwBody" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource RwFont500}" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="{StaticResource RwText}" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
<Setter Property="TextWrapping" Value="NoWrap" />
</Style>
<Style x:Key="RwCaption" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource RwFont500}" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="FontSize" Value="12.5" />
<Setter Property="Foreground" Value="{StaticResource RwTextMuted}" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
<Setter Property="TextWrapping" Value="NoWrap" />
</Style>
<Style x:Key="RwSubtle" TargetType="TextBlock" BasedOn="{StaticResource RwCaption}">
<Setter Property="Foreground" Value="{StaticResource RwTextSubtle}" />
</Style>
<Style x:Key="RwLabel" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource RwFont700}" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="11" />
<Setter Property="CharacterSpacing" Value="80" />
<Setter Property="Foreground" Value="{StaticResource RwText}" />
<Setter Property="TextTrimming" Value="CharacterEllipsis" />
<Setter Property="TextWrapping" Value="NoWrap" />
</Style>
<Style x:Key="RwIcon" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource RwIconFont}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<!--
Icon button: square, no fill. Hover = red wash + salmon icon; pressed inverts (red fill,
onRed icon). States fade in 150 ms and out 120 ms, ease-out.
-->
<Style x:Key="RwIconButton" TargetType="Button">
<Setter Property="Width" Value="36" />
<Setter Property="Height" Value="36" />
<Setter Property="Padding" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{StaticResource RwText}" />
<Setter Property="FontFamily" Value="{StaticResource RwIconFont}" />
<Setter Property="FontSize" Value="16" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="UseSystemFocusVisuals" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="Root" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition To="Normal" GeneratedDuration="0:0:0.12">
<VisualTransition.GeneratedEasingFunction><CubicEase EasingMode="EaseOut" /></VisualTransition.GeneratedEasingFunction>
</VisualTransition>
<VisualTransition GeneratedDuration="0:0:0.15">
<VisualTransition.GeneratedEasingFunction><CubicEase EasingMode="EaseOut" /></VisualTransition.GeneratedEasingFunction>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Wash" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Presenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RwHoverColor}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Fill" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Presenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RwOnRed}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0.35" Duration="0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="Wash" Fill="{StaticResource RwRedTint}" Opacity="0" />
<Rectangle x:Name="Fill" Fill="{StaticResource RwRed}" Opacity="0" />
<ContentPresenter x:Name="Presenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Primary (red-filled) button. Hover goes lighter (coral), pressed inverts to bg + red. -->
<Style x:Key="RwPrimaryButton" TargetType="Button">
<Setter Property="MinHeight" Value="32" />
<Setter Property="Padding" Value="14,0" />
<Setter Property="Background" Value="{StaticResource RwRed}" />
<Setter Property="Foreground" Value="{StaticResource RwOnRed}" />
<Setter Property="FontFamily" Value="{StaticResource RwFont700}" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="11" />
<Setter Property="CharacterSpacing" Value="80" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="UseSystemFocusVisuals" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="Root" Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition To="Normal" GeneratedDuration="0:0:0.12">
<VisualTransition.GeneratedEasingFunction><CubicEase EasingMode="EaseOut" /></VisualTransition.GeneratedEasingFunction>
</VisualTransition>
<VisualTransition GeneratedDuration="0:0:0.15">
<VisualTransition.GeneratedEasingFunction><CubicEase EasingMode="EaseOut" /></VisualTransition.GeneratedEasingFunction>
</VisualTransition>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Hover" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Invert" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Presenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RwText}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0.35" Duration="0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="Hover" Fill="{StaticResource RwRedHover}" Opacity="0" />
<Border x:Name="Invert" Background="{StaticResource RwBg}" BorderBrush="{StaticResource RwRed}" BorderThickness="1.5" Opacity="0" />
<ContentPresenter x:Name="Presenter"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Foreground="{TemplateBinding Foreground}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Outline text button (Retry, Refresh, Back...). Pressed inverts to a red fill. -->
<Style x:Key="RwOutlineButton" TargetType="Button" BasedOn="{StaticResource RwIconButton}">
<Setter Property="Width" Value="Auto" />
<Setter Property="Height" Value="28" />
<Setter Property="Padding" Value="10,0" />
<Setter Property="BorderBrush" Value="{StaticResource RwRedBorder}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="FontFamily" Value="{StaticResource RwFont700}" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="11" />
<Setter Property="CharacterSpacing" Value="80" />
</Style>
<!-- Tab: a label with a 2 px bar underneath; the page sets BorderBrush/Foreground for the active tab. -->
<Style x:Key="RwTabButton" TargetType="Button">
<Setter Property="Height" Value="34" />
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Foreground" Value="{StaticResource RwTextMuted}" />
<Setter Property="FontFamily" Value="{StaticResource RwFont700}" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="FontSize" Value="11" />
<Setter Property="CharacterSpacing" Value="80" />
<Setter Property="UseSystemFocusVisuals" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="Root" Background="{TemplateBinding Background}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition To="Normal" GeneratedDuration="0:0:0.12" />
<VisualTransition GeneratedDuration="0:0:0.15" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Wash" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Presenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RwHoverColor}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Fill" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Presenter" Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RwOnRed}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="Wash" Fill="{StaticResource RwRedTint}" Opacity="0" />
<Rectangle x:Name="Fill" Fill="{StaticResource RwRed}" Opacity="0" />
<ContentPresenter x:Name="Presenter"
Content="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<Rectangle Height="2" VerticalAlignment="Bottom" Fill="{TemplateBinding BorderBrush}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- List row: full-width, wash on hover, stronger wash on press. Content sets its own colors. -->
<Style x:Key="RwRowButton" TargetType="Button">
<Setter Property="Padding" Value="8,6" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{StaticResource RwText}" />
<Setter Property="UseSystemFocusVisuals" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid x:Name="Root" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition To="Normal" GeneratedDuration="0:0:0.12" />
<VisualTransition GeneratedDuration="0:0:0.15" />
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Wash" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Press" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0.4" Duration="0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Rectangle x:Name="Wash" Fill="{StaticResource RwRedTint}" Opacity="0" />
<Rectangle x:Name="Press" Fill="{StaticResource RwRedSoft}" Opacity="0" />
<ContentPresenter x:Name="Presenter"
Content="{TemplateBinding Content}"
Foreground="{TemplateBinding Foreground}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- Search field: square, red wash; focus deepens the wash and draws a red edge. -->
<Style x:Key="RwTextBox" TargetType="TextBox">
<Setter Property="MinHeight" Value="32" />
<Setter Property="Padding" Value="10,6,10,6" />
<Setter Property="Foreground" Value="{StaticResource RwText}" />
<Setter Property="SelectionHighlightColor" Value="{StaticResource RwRed}" />
<Setter Property="FontFamily" Value="{StaticResource RwFont500}" />
<Setter Property="FontWeight" Value="Medium" />
<Setter Property="FontSize" Value="14" />
<Setter Property="UseSystemFocusVisuals" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Edge" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RwHoverColor}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Focused">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Edge" Storyboard.TargetProperty="BorderBrush">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RwRed}" />
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Edge" Storyboard.TargetProperty="Background">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource RwFieldFocus}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Edge" Storyboard.TargetProperty="Opacity" To="0.4" Duration="0" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="Edge" Background="{StaticResource RwField}" BorderBrush="{StaticResource RwRedBorder}" BorderThickness="1" />
<ScrollViewer x:Name="ContentElement"
Margin="1"
Padding="{TemplateBinding Padding}"
IsTabStop="False"
ZoomMode="Disabled"
HorizontalScrollMode="Auto"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollMode="Disabled"
VerticalScrollBarVisibility="Hidden"
AutomationProperties.AccessibilityView="Raw" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>