fix: countdown timer panel showing under webcam properties

Same root cause as IsChatBox — SourceType binding fails on WebcamSceneConfig,
WPF defaults Visibility to Visible without calling the converter.
Added virtual bool IsCountdown on SceneElement, override in Source.
Swapped binding to BoolToVis. Removed dead SourceTypeToVisibility converters.
This commit is contained in:
2026-08-20 18:13:31 -07:00
parent 7e01c4564e
commit 2f135687cd
3 changed files with 8 additions and 6 deletions
+3 -6
View File
@@ -39,11 +39,8 @@
xmlns:Helpers="clr-namespace:ytLive.Helpers"/> xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<Helpers:EnumToBoolConverter x:Key="EnumToBool" <Helpers:EnumToBoolConverter x:Key="EnumToBool"
xmlns:Helpers="clr-namespace:ytLive.Helpers"/> xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<Helpers:SourceTypeToVisibilityConverter x:Key="SourceTypeToCountdownVis"
xmlns:Helpers="clr-namespace:ytLive.Helpers"
xmlns:models2="clr-namespace:ytLive.Models"/>
<Helpers:SourceTypeToVisibilityConverter x:Key="SourceTypeToWebVis"
xmlns:Helpers="clr-namespace:ytLive.Helpers"/>
<!-- Red dot shown in the taskbar icon while live --> <!-- Red dot shown in the taskbar icon while live -->
<DrawingImage x:Key="LiveOverlay"> <DrawingImage x:Key="LiveOverlay">
@@ -454,7 +451,7 @@
</StackPanel> </StackPanel>
<!-- Countdown config --> <!-- Countdown config -->
<StackPanel Visibility="{Binding SelectedElement.Type, Converter={StaticResource SourceTypeToCountdownVis}, ConverterParameter=Countdown}" Margin="0,0,0,8"> <StackPanel Visibility="{Binding SelectedElement.IsCountdown, Converter={StaticResource BoolToVis}}" Margin="0,0,0,8">
<TextBlock Text="Timer (minutes)" Foreground="#a0a0b0" FontSize="11" Margin="0,0,0,2"/> <TextBlock Text="Timer (minutes)" Foreground="#a0a0b0" FontSize="11" Margin="0,0,0,2"/>
<DockPanel Margin="0,0,0,6"> <DockPanel Margin="0,0,0,6">
<Button DockPanel.Dock="Right" Style="{StaticResource IconButton}" <Button DockPanel.Dock="Right" Style="{StaticResource IconButton}"
+3
View File
@@ -59,6 +59,9 @@ public abstract class SceneElement : INotifyPropertyChanged
/// <summary>True only for ChatBox-type sources. Gates chat overlay properties panel.</summary> /// <summary>True only for ChatBox-type sources. Gates chat overlay properties panel.</summary>
public virtual bool IsChatBox => false; public virtual bool IsChatBox => false;
/// <summary>True only for Countdown-type sources. Gates timer properties panel.</summary>
public virtual bool IsCountdown => false;
private bool _isVisible = true; private bool _isVisible = true;
public bool IsVisible { get => _isVisible; set => Set(ref _isVisible, value); } public bool IsVisible { get => _isVisible; set => Set(ref _isVisible, value); }
+2
View File
@@ -184,6 +184,8 @@ public class Source : SceneElement
public override bool IsChatBox => Type == SourceType.ChatBox; public override bool IsChatBox => Type == SourceType.ChatBox;
public override bool IsCountdown => Type == SourceType.Countdown;
private bool _chatPreviewEnabled = true; private bool _chatPreviewEnabled = true;
public bool ChatPreviewEnabled public bool ChatPreviewEnabled
{ {