Uhr: Topmost=False, separates Fenster nur bei WebView
This commit is contained in:
parent
1505218706
commit
2b8ed17f52
2 changed files with 32 additions and 12 deletions
|
|
@ -6,7 +6,7 @@
|
|||
Background="Transparent"
|
||||
ShowInTaskbar="False"
|
||||
IsHitTestVisible="False"
|
||||
Topmost="True"
|
||||
Topmost="False"
|
||||
SizeToContent="WidthAndHeight">
|
||||
<Border Background="#AA000000" CornerRadius="8" Padding="20,10">
|
||||
<TextBlock x:Name="TxtClock"
|
||||
|
|
|
|||
|
|
@ -425,6 +425,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 +471,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 +746,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