release: LD KickWatch v1.5.0 - Batch chat streaming fix, rock-solid quality ContextMenu, and UI virtualization
This commit is contained in:
parent
bacf36de86
commit
ce27b93e9d
8 changed files with 208 additions and 102 deletions
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
**Kick.com için Modern Masaüstü Canlı Yayın İzleme Stüdyosu ve Sohbet İstemcisi**
|
||||
|
||||
[](https://github.com/LilDosto/LD-KickWatch/releases/latest)
|
||||
[](https://github.com/LilDosto/LD-KickWatch/releases/latest)
|
||||
[-0078D6?style=for-the-badge&logo=windows)](https://github.com/LilDosto/LD-KickWatch)
|
||||
[](https://dotnet.microsoft.com/download/dotnet/8.0)
|
||||
[](./LICENSE)
|
||||
|
||||
Favori **Kick.com** yayıncılarınızı takip edin, anlık canlı yayın ve kategori bildirimleri alın, **Pencere İçi Web Oynatıcı (WebView2)** veya **Pencere İçi Gömülü VLC** ile yayınları izleyin, **2x2 Çoklu Yayın (Squad View)** modunda 4 yayını aynı anda takip edin ve gerçek **Kick Emote** destekli canlı sohbete bağlanın.
|
||||
|
||||
[📦 **Son Sürümü İndir (v1.4.0 Releases)**](https://github.com/LilDosto/LD-KickWatch/releases/latest) • [🚀 **Özellikler**](#-başlıca-özellikler) • [⌨ **Kısayollar**](#-klavye-kısayolları) • [🛠 **Derleme**](#-kaynak-koddan-derleme)
|
||||
[📦 **Son Sürümü İndir (v1.5.0 Releases)**](https://github.com/LilDosto/LD-KickWatch/releases/latest) • [🚀 **Özellikler**](#-başlıca-özellikler) • [⌨ **Kısayollar**](#-klavye-kısayolları) • [🛠 **Derleme**](#-kaynak-koddan-derleme)
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -130,6 +130,11 @@ LD-KickWatch/
|
|||
|
||||
## 🆕 Sürüm Geçmişi
|
||||
|
||||
### 🟢 v1.5.0 (28 Ekim 2026)
|
||||
- **⚡ Akıcı ve Kesintisiz Canlı Sohbet (Background Dispatcher & Batching):** Canlı sohbette mesajların birkaç saniye sonra tıkanması ve akmaması sorunu tamamen çözüldü. Gelen mesajlar non-blocking kuyruk (`ConcurrentQueue`) ve 75 ms toplu arka plan işleme (`DispatcherTimer`) ile UI'ya aktarılıyor; 100.000 izleyicili yayınlarda dahi sohbet su gibi akıyor.
|
||||
- **🛡 UI Virtualization Entegrasyonu:** Sohbet kutusuna UI sanallaştırma ve geri dönüşüm (`Recycling`) eklendi, gereksiz DOM ölçümleri ve CPU darboğazı ortadan kaldırıldı.
|
||||
- **🎯 Havada Kalan/Bozulan Kalite Menüsü Yerel Açılır Menüye (ContextMenu) Taşındı:** WinForms (`WindowsFormsHost` / `VlcPanel`) ve WebView2 üzerindeki WPF Airspace (saydam popup çakışması) nedeniyle oluşan donma ve bug'lar tamamen giderildi. Artık YouTube/Twitch tarzı tıklandığında anında açılan, seçili kaliteyi tik işaretiyle (✓) gösteren şık ve sıfır hatalı bir kalite menüsü bulunuyor.
|
||||
|
||||
### 🟢 v1.4.0 (28 Ekim 2026)
|
||||
- **💬 Canlı Sohbet Bağlantı Sorunu Düzeltildi:** Kick'in yenilediği güncel Pusher WebSocket protokolü ve anahtarı entegre edildi. Artık tüm yayıncıların canlı sohbet akışları anında ve kesintisiz bağlanıyor.
|
||||
- **🔍 Kalite Seçim Kutusu Büyütüldü ve Ferahlatıldı:** Oynatıcı çubuğundaki kalite kutucuğu genişletildi, yazıların dikey/yatay kırpılması ve sıkışıklık tamamen giderildi; okunabilir, şık ve ferah bir tasarıma kavuşturuldu.
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<RootNamespace>KickStreamHub</RootNamespace>
|
||||
<AssemblyName>LDKickWatch</AssemblyName>
|
||||
<Version>1.4.0</Version>
|
||||
<AssemblyVersion>1.4.0.0</AssemblyVersion>
|
||||
<FileVersion>1.4.0.0</FileVersion>
|
||||
<Version>1.5.0</Version>
|
||||
<AssemblyVersion>1.5.0.0</AssemblyVersion>
|
||||
<FileVersion>1.5.0.0</FileVersion>
|
||||
<Product>LD KickWatch</Product>
|
||||
<AssemblyTitle>LD KickWatch</AssemblyTitle>
|
||||
<Company>LD KickWatch</Company>
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ public sealed partial class PusherChatService : IAsyncDisposable
|
|||
break;
|
||||
}
|
||||
}
|
||||
catch (JsonException ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
LoggingService.Instance.Warning($"Sohbet mesajı ayrıştırılamadı: {ex.Message}");
|
||||
}
|
||||
|
|
@ -194,39 +194,46 @@ public sealed partial class PusherChatService : IAsyncDisposable
|
|||
|
||||
private void HandleChatMessagePayload(JsonElement root)
|
||||
{
|
||||
if (!root.TryGetProperty("data", out var dataEl)) return;
|
||||
var dataRaw = dataEl.GetString();
|
||||
if (string.IsNullOrEmpty(dataRaw)) return;
|
||||
|
||||
using var innerDoc = JsonDocument.Parse(dataRaw);
|
||||
var inner = innerDoc.RootElement;
|
||||
|
||||
var rawContent = inner.TryGetProperty("content", out var c) ? c.GetString() ?? string.Empty : string.Empty;
|
||||
var content = KickEmoteRegex().Replace(rawContent, ":$1:");
|
||||
|
||||
var sender = inner.TryGetProperty("sender", out var s) ? s : default;
|
||||
|
||||
var username = "?";
|
||||
var color = "#53FC18";
|
||||
if (sender.ValueKind == JsonValueKind.Object)
|
||||
try
|
||||
{
|
||||
if (sender.TryGetProperty("username", out var u)) username = u.GetString() ?? "?";
|
||||
if (sender.TryGetProperty("identity", out var identity) &&
|
||||
identity.TryGetProperty("color", out var colorEl))
|
||||
if (!root.TryGetProperty("data", out var dataEl)) return;
|
||||
var dataRaw = dataEl.GetString();
|
||||
if (string.IsNullOrEmpty(dataRaw)) return;
|
||||
|
||||
using var innerDoc = JsonDocument.Parse(dataRaw);
|
||||
var inner = innerDoc.RootElement;
|
||||
|
||||
var rawContent = inner.TryGetProperty("content", out var c) ? c.GetString() ?? string.Empty : string.Empty;
|
||||
var content = KickEmoteRegex().Replace(rawContent, ":$1:");
|
||||
|
||||
var sender = inner.TryGetProperty("sender", out var s) ? s : default;
|
||||
|
||||
var username = "?";
|
||||
var color = "#53FC18";
|
||||
if (sender.ValueKind == JsonValueKind.Object)
|
||||
{
|
||||
var parsedColor = colorEl.GetString();
|
||||
if (!string.IsNullOrWhiteSpace(parsedColor))
|
||||
color = parsedColor;
|
||||
if (sender.TryGetProperty("username", out var u)) username = u.GetString() ?? "?";
|
||||
if (sender.TryGetProperty("identity", out var identity) &&
|
||||
identity.TryGetProperty("color", out var colorEl))
|
||||
{
|
||||
var parsedColor = colorEl.GetString();
|
||||
if (!string.IsNullOrWhiteSpace(parsedColor))
|
||||
color = parsedColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MessageReceived?.Invoke(this, new ChatMessageEventArgs
|
||||
MessageReceived?.Invoke(this, new ChatMessageEventArgs
|
||||
{
|
||||
Username = username,
|
||||
Message = content,
|
||||
RawMessage = rawContent,
|
||||
ColorHex = color,
|
||||
});
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Username = username,
|
||||
Message = content,
|
||||
RawMessage = rawContent,
|
||||
ColorHex = color,
|
||||
});
|
||||
LoggingService.Instance.Warning($"Sohbet yükü işlenemedi: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private async Task SubscribeToChatroomAsync(CancellationToken ct)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
using System.Collections.Concurrent;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Windows.Threading;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
|
@ -20,6 +21,9 @@ public partial class ChatViewModel : ObservableObject, IAsyncDisposable
|
|||
{
|
||||
private readonly PusherChatService _chatService = new();
|
||||
private readonly Dispatcher _dispatcher;
|
||||
private readonly ConcurrentQueue<ChatMessageItem> _incomingQueue = new();
|
||||
private readonly DispatcherTimer _batchTimer;
|
||||
|
||||
public int MaxMessages { get; set; } = 500;
|
||||
|
||||
[ObservableProperty] private string _channelName = string.Empty;
|
||||
|
|
@ -35,12 +39,51 @@ public partial class ChatViewModel : ObservableObject, IAsyncDisposable
|
|||
public ObservableCollection<ChatMessageItem> Messages { get; } = new();
|
||||
public ObservableCollection<ChatMessageItem> FilteredMessages { get; } = new();
|
||||
|
||||
public event EventHandler? NewMessagesAppended;
|
||||
|
||||
public ChatViewModel()
|
||||
{
|
||||
_dispatcher = Dispatcher.CurrentDispatcher;
|
||||
_chatService.MessageReceived += OnMessageReceived;
|
||||
_chatService.ConnectionStateChanged += (_, connected) =>
|
||||
_dispatcher.BeginInvoke(() => IsConnected = connected);
|
||||
|
||||
_batchTimer = new DispatcherTimer(DispatcherPriority.Background, _dispatcher)
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(75)
|
||||
};
|
||||
_batchTimer.Tick += BatchTimer_Tick;
|
||||
_batchTimer.Start();
|
||||
}
|
||||
|
||||
private void BatchTimer_Tick(object? sender, EventArgs e)
|
||||
{
|
||||
if (_incomingQueue.IsEmpty) return;
|
||||
|
||||
bool hasAppended = false;
|
||||
int processed = 0;
|
||||
while (_incomingQueue.TryDequeue(out var item) && processed < 40)
|
||||
{
|
||||
processed++;
|
||||
Messages.Add(item);
|
||||
while (Messages.Count > MaxMessages)
|
||||
Messages.RemoveAt(0);
|
||||
|
||||
if (!IsPaused && MatchesFilter(item))
|
||||
{
|
||||
FilteredMessages.Add(item);
|
||||
while (FilteredMessages.Count > MaxMessages)
|
||||
FilteredMessages.RemoveAt(0);
|
||||
hasAppended = true;
|
||||
}
|
||||
}
|
||||
|
||||
MessageCount = Messages.Count;
|
||||
|
||||
if (hasAppended && !IsPaused)
|
||||
{
|
||||
NewMessagesAppended?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task ConnectAsync(string channelName, long chatroomId)
|
||||
|
|
@ -50,9 +93,12 @@ public partial class ChatViewModel : ObservableObject, IAsyncDisposable
|
|||
|
||||
ChannelName = channelName;
|
||||
ChatroomId = chatroomId;
|
||||
|
||||
while (_incomingQueue.TryDequeue(out _)) { }
|
||||
Messages.Clear();
|
||||
FilteredMessages.Clear();
|
||||
MessageCount = 0;
|
||||
|
||||
if (chatroomId > 0)
|
||||
await _chatService.ConnectAsync(chatroomId);
|
||||
}
|
||||
|
|
@ -65,29 +111,19 @@ public partial class ChatViewModel : ObservableObject, IAsyncDisposable
|
|||
|
||||
private void OnMessageReceived(object? sender, ChatMessageEventArgs e)
|
||||
{
|
||||
var item = new ChatMessageItem
|
||||
try
|
||||
{
|
||||
Username = e.Username,
|
||||
Message = e.Message,
|
||||
RawMessage = string.IsNullOrEmpty(e.RawMessage) ? e.Message : e.RawMessage,
|
||||
ColorHex = e.ColorHex,
|
||||
};
|
||||
|
||||
_dispatcher.BeginInvoke(() =>
|
||||
{
|
||||
Messages.Add(item);
|
||||
while (Messages.Count > MaxMessages)
|
||||
Messages.RemoveAt(0);
|
||||
|
||||
MessageCount = Messages.Count;
|
||||
|
||||
if (!IsPaused && MatchesFilter(item))
|
||||
var item = new ChatMessageItem
|
||||
{
|
||||
FilteredMessages.Add(item);
|
||||
while (FilteredMessages.Count > MaxMessages)
|
||||
FilteredMessages.RemoveAt(0);
|
||||
}
|
||||
});
|
||||
Username = e.Username,
|
||||
Message = e.Message,
|
||||
RawMessage = string.IsNullOrEmpty(e.RawMessage) ? e.Message : e.RawMessage,
|
||||
ColorHex = e.ColorHex,
|
||||
};
|
||||
|
||||
_incomingQueue.Enqueue(item);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private bool MatchesFilter(ChatMessageItem item)
|
||||
|
|
@ -122,6 +158,7 @@ public partial class ChatViewModel : ObservableObject, IAsyncDisposable
|
|||
[RelayCommand]
|
||||
private void ClearMessages()
|
||||
{
|
||||
while (_incomingQueue.TryDequeue(out _)) { }
|
||||
Messages.Clear();
|
||||
FilteredMessages.Clear();
|
||||
MessageCount = 0;
|
||||
|
|
@ -129,6 +166,7 @@ public partial class ChatViewModel : ObservableObject, IAsyncDisposable
|
|||
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
_batchTimer.Stop();
|
||||
await _chatService.DisposeAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,6 +88,36 @@ public partial class MainViewModel : ObservableObject
|
|||
[ObservableProperty] private string _activePlayerChannel = string.Empty;
|
||||
[ObservableProperty] private string _selectedQuality = "best";
|
||||
|
||||
public string SelectedQualityDisplay => SelectedQuality switch
|
||||
{
|
||||
"best" => "Kaynak (En İyi)",
|
||||
"1080p60" => "1080p 60 FPS",
|
||||
"720p60" => "720p 60 FPS",
|
||||
"720p" => "720p",
|
||||
"480p" => "480p",
|
||||
"360p" => "360p",
|
||||
"160p" => "160p",
|
||||
"worst" => "En Düşük",
|
||||
"audio_only" => "Sadece Ses",
|
||||
_ => SelectedQuality
|
||||
};
|
||||
|
||||
public void SetStreamQuality(string quality)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(quality)) return;
|
||||
if (string.Equals(SelectedQuality, quality, StringComparison.OrdinalIgnoreCase)) return;
|
||||
|
||||
SelectedQuality = quality;
|
||||
OnPropertyChanged(nameof(SelectedQualityDisplay));
|
||||
Config.StreamQuality = quality;
|
||||
_configService.Save(Config);
|
||||
|
||||
if (IsEmbeddedPlaying && IsEmbeddedVlcActive && !string.IsNullOrEmpty(ActivePlayerChannel))
|
||||
{
|
||||
_ = PlayEmbeddedVlcPlayerAsync(ActivePlayerChannel);
|
||||
}
|
||||
}
|
||||
|
||||
// Multi-Stream (Squad View) bindings
|
||||
[ObservableProperty] private bool _isQuadLayout = true;
|
||||
|
||||
|
|
@ -192,14 +222,7 @@ public partial class MainViewModel : ObservableObject
|
|||
|
||||
partial void OnSelectedQualityChanged(string value)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(value)) return;
|
||||
Config.StreamQuality = value;
|
||||
_configService.Save(Config);
|
||||
|
||||
if (IsEmbeddedPlaying && IsEmbeddedVlcActive && !string.IsNullOrEmpty(ActivePlayerChannel))
|
||||
{
|
||||
_ = PlayEmbeddedVlcPlayerAsync(ActivePlayerChannel);
|
||||
}
|
||||
OnPropertyChanged(nameof(SelectedQualityDisplay));
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
|
|
|
|||
|
|
@ -17,17 +17,20 @@ public partial class ChatWindow : Window
|
|||
Loaded += async (_, _) => await _vm.ConnectAsync(channelName, chatroomId);
|
||||
Closed += async (_, _) => await _vm.DisposeAsync();
|
||||
|
||||
_vm.FilteredMessages.CollectionChanged += AutoScrollToBottom;
|
||||
_vm.NewMessagesAppended += (_, _) => AutoScrollToBottom();
|
||||
}
|
||||
|
||||
private void AutoScrollToBottom(object? sender, NotifyCollectionChangedEventArgs e)
|
||||
private void AutoScrollToBottom()
|
||||
{
|
||||
if (_vm.IsPaused) return;
|
||||
|
||||
if ((e.Action == NotifyCollectionChangedAction.Add || e.Action == NotifyCollectionChangedAction.Reset)
|
||||
&& ChatListBox.Items.Count > 0)
|
||||
try
|
||||
{
|
||||
ChatListBox.ScrollIntoView(ChatListBox.Items[^1]);
|
||||
if (ChatListBox.Items.Count > 0)
|
||||
{
|
||||
ChatListBox.ScrollIntoView(ChatListBox.Items[^1]);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -488,36 +488,33 @@
|
|||
</Button.Style>
|
||||
</Button>
|
||||
|
||||
<!-- Stream Quality Dropdown Directly On Player Toolbar (Spacious & Clean) -->
|
||||
<Border Background="#0B1320" CornerRadius="8" BorderBrush="#24344D" BorderThickness="1" Padding="8,2" Margin="6,0,0,0" VerticalAlignment="Center">
|
||||
<!-- Stream Quality Selector (Rock-Solid ContextMenu, No Airspace / Focus Glitches) -->
|
||||
<Button Style="{StaticResource SecondaryButton}"
|
||||
Padding="10,4.5"
|
||||
Margin="6,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Click="QualityButton_Click"
|
||||
ToolTip="Yayın Çözünürlüğü ve Kalitesini Değiştir">
|
||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||
<TextBlock Text="⚙ Kalite:" Foreground="#A0B3CC" FontSize="12" FontWeight="Bold" VerticalAlignment="Center" Margin="0,0,6,0" />
|
||||
<ComboBox SelectedValue="{Binding SelectedQuality, Mode=TwoWay}"
|
||||
SelectedValuePath="Tag"
|
||||
FontSize="12"
|
||||
FontWeight="SemiBold"
|
||||
Padding="8,4"
|
||||
MinHeight="28"
|
||||
MinWidth="155"
|
||||
VerticalContentAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Background="#121B2A"
|
||||
Foreground="#F8FAFC"
|
||||
BorderBrush="#2E4160"
|
||||
BorderThickness="1"
|
||||
ToolTip="Yayın Çözünürlüğü ve Kalitesi (VLC & Harici Oynatıcılar)">
|
||||
<ComboBoxItem Tag="best" Content="Kaynak (En İyi)" Padding="10,6" />
|
||||
<ComboBoxItem Tag="1080p60" Content="1080p 60 FPS" Padding="10,6" />
|
||||
<ComboBoxItem Tag="720p60" Content="720p 60 FPS" Padding="10,6" />
|
||||
<ComboBoxItem Tag="720p" Content="720p (Normal)" Padding="10,6" />
|
||||
<ComboBoxItem Tag="480p" Content="480p" Padding="10,6" />
|
||||
<ComboBoxItem Tag="360p" Content="360p (Tasarruf)" Padding="10,6" />
|
||||
<ComboBoxItem Tag="160p" Content="160p (Düşük)" Padding="10,6" />
|
||||
<ComboBoxItem Tag="worst" Content="En Düşük" Padding="10,6" />
|
||||
<ComboBoxItem Tag="audio_only" Content="Sadece Ses" Padding="10,6" />
|
||||
</ComboBox>
|
||||
<TextBlock Text="⚙ " Foreground="#53FC18" FontSize="11" VerticalAlignment="Center" />
|
||||
<TextBlock Text="{Binding SelectedQualityDisplay, FallbackValue='Kaynak (En İyi)'}"
|
||||
FontSize="12" FontWeight="Bold" Foreground="#F8FAFC" VerticalAlignment="Center" Margin="0,0,6,0" />
|
||||
<TextBlock Text="▾" FontSize="11" Foreground="#94A3B8" VerticalAlignment="Center" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Button.ContextMenu>
|
||||
<ContextMenu x:Name="QualityContextMenu">
|
||||
<MenuItem Header="Kaynak (En İyi)" Tag="best" Click="QualityMenuItem_Click" />
|
||||
<MenuItem Header="1080p 60 FPS" Tag="1080p60" Click="QualityMenuItem_Click" />
|
||||
<MenuItem Header="720p 60 FPS" Tag="720p60" Click="QualityMenuItem_Click" />
|
||||
<MenuItem Header="720p (Normal)" Tag="720p" Click="QualityMenuItem_Click" />
|
||||
<MenuItem Header="480p" Tag="480p" Click="QualityMenuItem_Click" />
|
||||
<MenuItem Header="360p (Tasarruf)" Tag="360p" Click="QualityMenuItem_Click" />
|
||||
<MenuItem Header="160p (Düşük)" Tag="160p" Click="QualityMenuItem_Click" />
|
||||
<MenuItem Header="En Düşük (worst)" Tag="worst" Click="QualityMenuItem_Click" />
|
||||
<MenuItem Header="Sadece Ses" Tag="audio_only" Click="QualityMenuItem_Click" />
|
||||
</ContextMenu>
|
||||
</Button.ContextMenu>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Right: Player Controls (Mute, Reload, Chat, Theater, Fullscreen, Popout, Close) -->
|
||||
|
|
@ -752,7 +749,9 @@
|
|||
ItemsSource="{Binding FilteredMessages}"
|
||||
Background="Transparent" BorderThickness="0"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
VirtualizingPanel.IsVirtualizing="True"
|
||||
VirtualizingPanel.VirtualizationMode="Recycling"
|
||||
VirtualizingPanel.ScrollUnit="Pixel">
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ using System.Collections.Specialized;
|
|||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using KickStreamHub.Services;
|
||||
|
|
@ -44,7 +45,7 @@ public partial class MainWindow : Window
|
|||
_viewModel.MultiSlotStopRequested += ViewModel_MultiSlotStopRequested;
|
||||
_viewModel.MultiSlotMuteRequested += ViewModel_MultiSlotMuteRequested;
|
||||
|
||||
_viewModel.EmbeddedChat.FilteredMessages.CollectionChanged += EmbeddedChat_CollectionChanged;
|
||||
_viewModel.EmbeddedChat.NewMessagesAppended += EmbeddedChat_NewMessagesAppended;
|
||||
|
||||
_notifications.OpenRequested += (_, _) => RestoreAndBringToFront();
|
||||
_notifications.ExitRequested += (_, _) => Close();
|
||||
|
|
@ -296,14 +297,17 @@ public partial class MainWindow : Window
|
|||
|
||||
// ==================== EMBEDDED CHAT AUTO-SCROLL ====================
|
||||
|
||||
private void EmbeddedChat_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
|
||||
private void EmbeddedChat_NewMessagesAppended(object? sender, EventArgs e)
|
||||
{
|
||||
if (_viewModel.EmbeddedChat.IsPaused) return;
|
||||
if ((e.Action == NotifyCollectionChangedAction.Add || e.Action == NotifyCollectionChangedAction.Reset) &&
|
||||
EmbeddedChatListBox.Items.Count > 0)
|
||||
try
|
||||
{
|
||||
EmbeddedChatListBox.ScrollIntoView(EmbeddedChatListBox.Items[^1]);
|
||||
if (EmbeddedChatListBox.Items.Count > 0)
|
||||
{
|
||||
EmbeddedChatListBox.ScrollIntoView(EmbeddedChatListBox.Items[^1]);
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
private void OnViewModelPropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||
|
|
@ -379,6 +383,33 @@ public partial class MainWindow : Window
|
|||
Focus();
|
||||
}
|
||||
|
||||
private void QualityButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is FrameworkElement fe && fe.ContextMenu != null)
|
||||
{
|
||||
foreach (var item in fe.ContextMenu.Items.OfType<System.Windows.Controls.MenuItem>())
|
||||
{
|
||||
var isCurrent = string.Equals(item.Tag as string, _viewModel.SelectedQuality, StringComparison.OrdinalIgnoreCase);
|
||||
var headerStr = item.Header?.ToString() ?? string.Empty;
|
||||
var clean = headerStr.Replace("✓", "", StringComparison.Ordinal).Trim();
|
||||
item.Header = isCurrent ? $"✓ {clean}" : $" {clean}";
|
||||
item.FontWeight = isCurrent ? FontWeights.Bold : FontWeights.Normal;
|
||||
}
|
||||
|
||||
fe.ContextMenu.PlacementTarget = fe;
|
||||
fe.ContextMenu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
|
||||
fe.ContextMenu.IsOpen = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void QualityMenuItem_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is System.Windows.Controls.MenuItem mi && mi.Tag is string q)
|
||||
{
|
||||
_viewModel.SetStreamQuality(q);
|
||||
}
|
||||
}
|
||||
|
||||
private void MainWindow_Closing(object? sender, CancelEventArgs e)
|
||||
{
|
||||
// Pencere kapatıldığında (X veya Alt+F4) uygulama arkaplanda açık kalmaz,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue