The creator asked why the Stream Alerts "Display" drop-down was not in the same
style as the other drop-downs. It was never given the theme's YtComboBox style -
only a hand-painted Background/Foreground. Setting colours changes the paint, not
the template, so WPF still drew the light system ComboBox (grey border, system
arrow, white popup list) on top of the dark panel. The chat Font drop-down was a
copy of the same mistake, and every check box was the light system one.
The sweep of the whole properties panel (then the app):
- ComboBox x2 (chat Font, alert Display) -> YtComboBox, hand-painted colours gone
- TextBox x16 in the properties panel -> YtTextBoxCompact (new, BasedOn YtTextBox:
11px / padding 4,2 - the panel is dense, the full 13px box would double it)
- CheckBox x2 (chat) + x3 (preview broadcast) + x1 (socials dialog) -> YtCheckBox
(new: a 14x14 rounded box + tick path, accent fill when checked)
- the layer-rename field -> YtTextBoxCompact via BasedOn, still borderless
- buttons, pills, sliders: already themed, untouched
The sweep also killed a typo'd foreground (#e0d0e0 for #e0e0e0) and the only
remaining hand-painted colour is the deliberate dimming of the two read-only path
fields.
Guard: ytLive.Tests/PropertiesStyleTests.cs (the ONE Good Dog test) parses the app
XAML and fails if an unstyled drop-down, check box or properties field comes back.
431/431 green, 0 warnings.
129 lines
8.3 KiB
XML
129 lines
8.3 KiB
XML
<Window x:Class="ytLive.SocialsDialog"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
Title="Social Media Site Promotion" Height="520" Width="520"
|
|
Icon="/Assets/llamacasty-icon.png"
|
|
WindowStartupLocation="CenterOwner" ResizeMode="NoResize"
|
|
ShowInTaskbar="False" Background="#1a1a2e">
|
|
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<BooleanToVisibilityConverter x:Key="BoolToVis"/>
|
|
</ResourceDictionary>
|
|
</Window.Resources>
|
|
|
|
<Grid Margin="24">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="Auto"/>
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock Grid.Row="0" Text="Social Media Site Promotion" FontSize="18" FontWeight="Bold"
|
|
Foreground="#e0e0e0" Margin="0,0,0,12"/>
|
|
|
|
<!-- Show/hide the bar on the stream -->
|
|
<CheckBox Grid.Row="1" IsChecked="{Binding BarEnabled}" Style="{StaticResource YtCheckBox}" Margin="0,0,0,10">
|
|
<TextBlock Text="Show the social bar on the stream" Foreground="#e0e0e0" FontSize="13"/>
|
|
</CheckBox>
|
|
|
|
<!-- Sign-in gate: the first slot is always your YouTube channel -->
|
|
<Border Grid.Row="2" Background="#16213e" CornerRadius="5" Padding="10,8" Margin="0,0,0,10"
|
|
Visibility="{Binding ShowSignInBanner, Converter={StaticResource BoolToVis}}">
|
|
<StackPanel>
|
|
<TextBlock Text="Sign in to YouTube first — the first slot is your channel."
|
|
Foreground="#e0e0e0" FontSize="12" TextWrapping="Wrap"/>
|
|
<Button Content="Sign in to YouTube" Command="{Binding SignInCommand}"
|
|
Style="{StaticResource YtButtonSecondary}" HorizontalAlignment="Left"
|
|
Margin="0,8,0,0" Padding="12,4" FontSize="11"/>
|
|
</StackPanel>
|
|
</Border>
|
|
<TextBlock Grid.Row="2" Text="Signing in… open the browser to authorize, then come back here."
|
|
Foreground="#e94560" FontSize="12" Margin="0,0,0,10"
|
|
Visibility="{Binding IsBusy, Converter={StaticResource BoolToVis}}"/>
|
|
|
|
<!-- The six fixed slots -->
|
|
<ScrollViewer Grid.Row="3" VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl ItemsSource="{Binding Slots}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Grid Margin="0,6">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="34"/>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<!-- Service icon: logo, lock (Premium) or do-not (empty/invalid) -->
|
|
<Border Grid.Column="0" Width="30" Height="30" CornerRadius="15"
|
|
Background="#16213e" HorizontalAlignment="Left" VerticalAlignment="Top">
|
|
<Grid>
|
|
<Path Data="{Binding LogoData}" Fill="White" Stretch="Uniform"
|
|
Width="15" Height="15" HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Visibility="{Binding ShowLogo, Converter={StaticResource BoolToVis}}"/>
|
|
<Path Data="{Binding LockedIconData}" Fill="#8a93a8" Stretch="Uniform"
|
|
Width="15" Height="15" HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Visibility="{Binding IsLocked, Converter={StaticResource BoolToVis}}"/>
|
|
<Path Data="{Binding DoNotIconData}" Fill="#5a5a6e" Stretch="Uniform"
|
|
Width="15" Height="15" HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Visibility="{Binding ShowDoNot, Converter={StaticResource BoolToVis}}"/>
|
|
</Grid>
|
|
</Border>
|
|
|
|
<!-- Handle text / edit box / status -->
|
|
<Grid Grid.Column="1" Margin="10,0,8,0">
|
|
<TextBlock Text="{Binding DisplayText}" Foreground="#e0e0e0" FontSize="14"
|
|
VerticalAlignment="Top" Margin="0,6,0,0"
|
|
TextTrimming="CharacterEllipsis"
|
|
Visibility="{Binding ShowDisplay, Converter={StaticResource BoolToVis}}"/>
|
|
<TextBox Text="{Binding EditText, UpdateSourceTrigger=PropertyChanged}"
|
|
Style="{StaticResource YtTextBox}" FontSize="13"
|
|
KeyDown="SocialEdit_KeyDown" LostFocus="SocialEdit_LostFocus"
|
|
Visibility="{Binding ShowEditBox, Converter={StaticResource BoolToVis}}"/>
|
|
<TextBlock Text="{Binding Error}" Foreground="#e94560" FontSize="11"
|
|
TextWrapping="Wrap" Margin="0,32,0,0"
|
|
Visibility="{Binding ShowError, Converter={StaticResource BoolToVis}}"/>
|
|
<TextBlock Text="Checking…" Foreground="#a0a0b0" FontSize="11" Margin="0,32,0,0"
|
|
Visibility="{Binding ShowBusy, Converter={StaticResource BoolToVis}}"/>
|
|
</Grid>
|
|
|
|
<!-- Row actions -->
|
|
<StackPanel Grid.Column="2" Orientation="Horizontal" VerticalAlignment="Top"
|
|
Margin="0,3,0,0">
|
|
<Button Content="Sign in" Click="SignInButton_Click"
|
|
Style="{StaticResource YtButtonSecondary}" Padding="10,3"
|
|
FontSize="11" Margin="0,0,6,0"
|
|
Visibility="{Binding ShowSignInButton, Converter={StaticResource BoolToVis}}"/>
|
|
<Button Content="+" Click="SlotAdd_Click" Tag="{Binding Index}"
|
|
Style="{StaticResource IconButton}" Width="26" Height="26"
|
|
ToolTip="Add a social" FontSize="16" FontWeight="Bold"
|
|
Visibility="{Binding ShowAddButton, Converter={StaticResource BoolToVis}}"/>
|
|
<Button Content="✏️" Click="SlotEdit_Click" Tag="{Binding Index}"
|
|
Style="{StaticResource IconButton}" Width="26" Height="26"
|
|
ToolTip="Edit" FontSize="13"
|
|
Visibility="{Binding ShowEditButton, Converter={StaticResource BoolToVis}}"/>
|
|
<Button Content="🗑️" Click="SlotDelete_Click" Tag="{Binding Index}"
|
|
Style="{StaticResource IconButton}" Width="26" Height="26"
|
|
ToolTip="Remove" FontSize="12" Foreground="#e94560"
|
|
Visibility="{Binding ShowDeleteButton, Converter={StaticResource BoolToVis}}"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
|
|
<!-- Actions -->
|
|
<StackPanel Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
|
|
<Button Content="Cancel" Command="{Binding CancelCommand}"
|
|
Style="{StaticResource YtButtonSecondary}" Margin="0,0,8,0" IsCancel="True"/>
|
|
<Button Content="Save" Command="{Binding SaveCommand}" Style="{StaticResource YtButton}" MinWidth="110"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
</Window>
|