Compare commits
3 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 60ed10ffef | |||
| d62139afc9 | |||
| 2b8ed17f52 |
3 changed files with 38 additions and 16 deletions
|
|
@ -6,11 +6,11 @@
|
|||
Background="Transparent"
|
||||
ShowInTaskbar="False"
|
||||
IsHitTestVisible="False"
|
||||
Topmost="True"
|
||||
Topmost="False"
|
||||
SizeToContent="WidthAndHeight">
|
||||
<Border Background="#AA000000" CornerRadius="8" Padding="20,10">
|
||||
<TextBlock x:Name="TxtClock"
|
||||
Foreground="White" FontSize="48" FontWeight="Light"
|
||||
FontFamily="Segoe UI"/>
|
||||
Foreground="White" FontSize="48" FontWeight="Light"
|
||||
FontFamily="Consolas"/>
|
||||
</Border>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@
|
|||
IsHitTestVisible="False">
|
||||
<TextBlock x:Name="TxtClock"
|
||||
Foreground="White" FontSize="48" FontWeight="Light"
|
||||
FontFamily="Segoe UI"/>
|
||||
FontFamily="Consolas"/>
|
||||
</Border>
|
||||
|
||||
<!-- Radio-Cover bei Audio-Streams -->
|
||||
|
|
|
|||
|
|
@ -105,12 +105,14 @@ public partial class MainWindow : Window
|
|||
var time = DateTime.Now.ToString("HH:mm:ss");
|
||||
TxtClock.Text = time;
|
||||
_clockWindow?.UpdateTime(time);
|
||||
PositionClockWindow();
|
||||
// Nur neu positionieren wenn Hauptfenster bewegt wurde - nicht jede Sekunde
|
||||
};
|
||||
|
||||
Loaded += MainWindow_Loaded;
|
||||
Closing += MainWindow_Closing;
|
||||
KeyDown += MainWindow_KeyDown;
|
||||
LocationChanged += (_, _) => PositionClockWindow();
|
||||
SizeChanged += (_, _) => PositionClockWindow();
|
||||
}
|
||||
|
||||
private void OnVideoDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
|
|
@ -425,6 +427,14 @@ public partial class MainWindow : Window
|
|||
WebView.Visibility = Visibility.Collapsed;
|
||||
VideoView.Visibility = Visibility.Visible;
|
||||
VideoOverlay.Visibility = Visibility.Visible;
|
||||
// Uhr: separates Fenster -> WPF-Overlay wenn WebView deaktiviert wird
|
||||
if (_clockVisible && _clockWindow != null)
|
||||
{
|
||||
_clockWindow.Close();
|
||||
_clockWindow = null;
|
||||
TxtClock.Text = DateTime.Now.ToString("HH:mm:ss");
|
||||
ClockOverlay.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
if (_libVLC == null || _player == null) return;
|
||||
try
|
||||
|
|
@ -463,6 +473,16 @@ public partial class MainWindow : Window
|
|||
RadioCover.Visibility = Visibility.Collapsed;
|
||||
VideoOverlay.Visibility = Visibility.Collapsed;
|
||||
WebView.Visibility = Visibility.Visible;
|
||||
// Uhr: WPF-Overlay -> separates Fenster wenn WebView aktiv wird
|
||||
if (_clockVisible && _clockWindow == null)
|
||||
{
|
||||
ClockOverlay.Visibility = Visibility.Collapsed;
|
||||
_clockWindow = new ClockWindow { Owner = this };
|
||||
_clockWindow.UpdateTime(DateTime.Now.ToString("HH:mm:ss"));
|
||||
_clockWindow.Show();
|
||||
_clockWindow.Dispatcher.BeginInvoke(() => PositionClockWindow(),
|
||||
System.Windows.Threading.DispatcherPriority.Render);
|
||||
}
|
||||
// Titelleiste via ApplySidebarLayout gesetzt
|
||||
|
||||
TxtEpgNow.Text = "🌐 Browser";
|
||||
|
|
@ -728,18 +748,20 @@ public partial class MainWindow : Window
|
|||
var time = DateTime.Now.ToString("HH:mm:ss");
|
||||
if (_clockVisible)
|
||||
{
|
||||
// WPF-Overlay (fuer TV-Modus innerhalb VideoView)
|
||||
TxtClock.Text = time;
|
||||
ClockOverlay.Visibility = Visibility.Visible;
|
||||
|
||||
// Separates Fenster (fuer WebView-Modus, schwebt ueber allem)
|
||||
_clockWindow = new ClockWindow { Owner = this };
|
||||
_clockWindow.UpdateTime(time);
|
||||
_clockWindow.Show();
|
||||
// Nach Show() ist ActualWidth bekannt
|
||||
_clockWindow.Dispatcher.BeginInvoke(() => PositionClockWindow(),
|
||||
System.Windows.Threading.DispatcherPriority.Render);
|
||||
|
||||
// WPF-Overlay fuer TV/Radio, separates Fenster nur fuer WebView
|
||||
if (WebView.Visibility == Visibility.Visible)
|
||||
{
|
||||
_clockWindow = new ClockWindow { Owner = this };
|
||||
_clockWindow.UpdateTime(time);
|
||||
_clockWindow.Show();
|
||||
_clockWindow.Dispatcher.BeginInvoke(() => PositionClockWindow(),
|
||||
System.Windows.Threading.DispatcherPriority.Render);
|
||||
}
|
||||
else
|
||||
{
|
||||
ClockOverlay.Visibility = Visibility.Visible;
|
||||
}
|
||||
_clockTimer.Start();
|
||||
BtnClock.Foreground = new System.Windows.Media.SolidColorBrush(
|
||||
System.Windows.Media.Color.FromRgb(0x00, 0x78, 0xD4));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue