Files
LlamaCasty/SocialsDialog.xaml.cs
T
gramps 7ae30d4cfc Right rail, top bar, bottom bar and chat border: Socials slide-out drawer, tab icons and colors, EDIT toggle, stream readouts moved to the top-left cell, webcam border restored, chat border controls, 30fps vertical tier
- Socials: the dialog is a right-rail drawer (same pattern as Stream Info/YPP/TEST); the live-screen button is removed
- Right rail: Stream Info (was Stream Settings) and YPP show the YouTube logo; Socials and TEST get icons; tab colors and label colors per spec
- Top bar: EDIT toggle beside REC (orange when on, blue when off); going live on YouTube turns it off
- Stream readouts (bitrate, FPS, dropped n (x.y%), Live hh:mm:ss, health) and the resolution dropdown moved to the top-left cell; bottom bar emptied at the same height
- Webcam border drawing restored (it was removed with the CRT bezel change)
- YouTube chat layer: border color, thickness, and opacity controls
- Vertical 1080p30 tier added

Not related to the fps gate yet; no gating is enforced.
2026-10-26 18:24:09 -07:00

68 lines
2.1 KiB
C#

using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using ytLive.Helpers;
using ytLive.ViewModels;
namespace ytLive;
public partial class SocialsDialog : UserControl
{
private SocialsDialogViewModel _viewModel => (SocialsDialogViewModel)DataContext;
public SocialsDialog()
{
InitializeComponent();
}
private void SignInButton_Click(object sender, RoutedEventArgs e)
=> _viewModel.SignInCommand.Execute(null);
private void SlotAdd_Click(object sender, RoutedEventArgs e)
{
if (sender is FrameworkElement { Tag: int index })
_viewModel.StartEdit(index);
}
private void SlotEdit_Click(object sender, RoutedEventArgs e)
{
if (sender is FrameworkElement { Tag: int index })
_viewModel.StartEdit(index);
}
private async void SlotDelete_Click(object sender, RoutedEventArgs e)
{
if (sender is not FrameworkElement { Tag: int index } element) return;
var slot = element.DataContext as SocialSlotViewModel;
var confirm = index == 0
? "Remove your YouTube channel from the bar and sign out of LlamaCasty?"
: slot is { IsFilled: true }
? $"Remove {slot.Handle}?"
: "Remove this social?";
if (MessageBox.Show(confirm, "Remove Social", MessageBoxButton.YesNo, MessageBoxImage.Question)
== MessageBoxResult.Yes)
await _viewModel.DeleteSlotAsync(index);
}
private void SocialEdit_KeyDown(object sender, KeyEventArgs e)
{
if (sender is not FrameworkElement { DataContext: SocialSlotViewModel slot }) return;
if (e.Key == Key.Enter)
{
_viewModel.ConfirmEdit(slot.Index);
}
else if (e.Key == Key.Escape)
{
slot.IsEditing = false;
slot.Error = null;
}
}
private void SocialEdit_LostFocus(object sender, RoutedEventArgs e)
{
if (sender is FrameworkElement { DataContext: SocialSlotViewModel slot })
_viewModel.ConfirmEdit(slot.Index);
}
}