Uhr: doppelter Toggle-Bug behoben, Position nach Render, PreviewKeyDown entfernt
This commit is contained in:
parent
085a904444
commit
1505218706
1 changed files with 11 additions and 6 deletions
|
|
@ -111,7 +111,6 @@ public partial class MainWindow : Window
|
|||
Loaded += MainWindow_Loaded;
|
||||
Closing += MainWindow_Closing;
|
||||
KeyDown += MainWindow_KeyDown;
|
||||
PreviewKeyDown += MainWindow_KeyDown;
|
||||
}
|
||||
|
||||
private void OnVideoDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
|
|
@ -736,8 +735,10 @@ public partial class MainWindow : Window
|
|||
// Separates Fenster (fuer WebView-Modus, schwebt ueber allem)
|
||||
_clockWindow = new ClockWindow { Owner = this };
|
||||
_clockWindow.UpdateTime(time);
|
||||
PositionClockWindow();
|
||||
_clockWindow.Show();
|
||||
// Nach Show() ist ActualWidth bekannt
|
||||
_clockWindow.Dispatcher.BeginInvoke(() => PositionClockWindow(),
|
||||
System.Windows.Threading.DispatcherPriority.Render);
|
||||
|
||||
_clockTimer.Start();
|
||||
BtnClock.Foreground = new System.Windows.Media.SolidColorBrush(
|
||||
|
|
@ -1280,14 +1281,20 @@ public partial class MainWindow : Window
|
|||
// WM_KEYDOWN abfangen damit Strg+B auch funktioniert wenn WebView2 den Fokus hat
|
||||
private const int WM_KEYDOWN = 0x0100;
|
||||
private const int VK_B = 0x42;
|
||||
private const int VK_U = 0x55;
|
||||
|
||||
private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
|
||||
{
|
||||
if (msg == WM_KEYDOWN && (int)wParam == VK_B)
|
||||
if (msg == WM_KEYDOWN)
|
||||
{
|
||||
var ctrl = (NativeMethods.GetKeyState(0x11) & 0x8000) != 0;
|
||||
if (ctrl)
|
||||
Dispatcher.BeginInvoke(() => BtnSidebarToggle_Click(this, new RoutedEventArgs()));
|
||||
{
|
||||
if ((int)wParam == VK_B)
|
||||
Dispatcher.BeginInvoke(() => BtnSidebarToggle_Click(this, new RoutedEventArgs()));
|
||||
else if ((int)wParam == VK_U)
|
||||
Dispatcher.BeginInvoke(() => ToggleClock());
|
||||
}
|
||||
}
|
||||
return IntPtr.Zero;
|
||||
}
|
||||
|
|
@ -1314,8 +1321,6 @@ public partial class MainWindow : Window
|
|||
case Key.F11: ToggleFullscreen(); e.Handled = true; break;
|
||||
case Key.T when Keyboard.Modifiers == ModifierKeys.Control:
|
||||
BtnAlwaysOnTop_Click(this, new RoutedEventArgs()); e.Handled = true; break;
|
||||
case Key.U when Keyboard.Modifiers == ModifierKeys.Control:
|
||||
ToggleClock(); e.Handled = true; break;
|
||||
case Key.Escape:
|
||||
if (EpgOverlay.Visibility == Visibility.Visible)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue