diff --git a/Source/Hurl.BrowserSelector/App.xaml.cs b/Source/Hurl.BrowserSelector/App.xaml.cs index 458780bd..06c50aeb 100644 --- a/Source/Hurl.BrowserSelector/App.xaml.cs +++ b/Source/Hurl.BrowserSelector/App.xaml.cs @@ -72,7 +72,7 @@ protected override void OnStartup(StartupEventArgs e) { if (Current.MainWindow is { } window) { - _mainWindow.MaximizeWindow(); + _mainWindow.ShowWindow(); } else { diff --git a/Source/Hurl.BrowserSelector/Controls/BrowsersList.xaml b/Source/Hurl.BrowserSelector/Controls/BrowsersList.xaml index 1e51e1d9..083f4b3b 100644 --- a/Source/Hurl.BrowserSelector/Controls/BrowsersList.xaml +++ b/Source/Hurl.BrowserSelector/Controls/BrowsersList.xaml @@ -55,7 +55,7 @@ CornerRadius="5" Cursor="Hand" Focusable="True" - MouseLeftButtonUp="BtnArea_MouseLeftButtonUp" + MouseLeftButtonUp="BrowserButton_Click" Tag="{Binding}" ToolTip="{Binding Path=Name}"> diff --git a/Source/Hurl.BrowserSelector/Controls/BrowsersList.xaml.cs b/Source/Hurl.BrowserSelector/Controls/BrowsersList.xaml.cs index 4140bbe6..79c304f8 100644 --- a/Source/Hurl.BrowserSelector/Controls/BrowsersList.xaml.cs +++ b/Source/Hurl.BrowserSelector/Controls/BrowsersList.xaml.cs @@ -41,9 +41,9 @@ private void OnPreviewKeyUp(object sender, KeyEventArgs e) //if (Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) { } } - private void BtnArea_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) + private void BrowserButton_Click(object sender, MouseButtonEventArgs e) { - var tag = (sender as Border).Tag as Browser; + var tag = ((Border)sender).Tag as Browser; OpenLink(tag); MinimizeWindow(); } @@ -66,7 +66,7 @@ private void AdditionalBtn_Click(object sender, RoutedEventArgs e) private void MenuItem_Click(object sender, RoutedEventArgs e) { - var alt = (sender as MenuItem).Tag as AltLaunchParentConverter.AltLaunchParent; + var alt = ((MenuItem)sender).Tag as AltLaunchParentConverter.AltLaunchParent; OpenAltLaunch(alt.AltLaunch, alt.Browser); MinimizeWindow(); } diff --git a/Source/Hurl.BrowserSelector/Windows/MainWindow.xaml b/Source/Hurl.BrowserSelector/Windows/MainWindow.xaml index eba6496f..3da2109c 100644 --- a/Source/Hurl.BrowserSelector/Windows/MainWindow.xaml +++ b/Source/Hurl.BrowserSelector/Windows/MainWindow.xaml @@ -16,7 +16,7 @@ Deactivated="Window_Deactivated" ExtendsContentIntoTitleBar="True" PreviewKeyUp="Window_KeyEvents" - SizeChanged="UiWindow_SizeChanged" + SizeChanged="Window_SizeChanged" Topmost="True" WindowBackdropType="Mica" WindowStartupLocation="CenterScreen" diff --git a/Source/Hurl.BrowserSelector/Windows/MainWindow.xaml.cs b/Source/Hurl.BrowserSelector/Windows/MainWindow.xaml.cs index fff526b0..d97d3cda 100644 --- a/Source/Hurl.BrowserSelector/Windows/MainWindow.xaml.cs +++ b/Source/Hurl.BrowserSelector/Windows/MainWindow.xaml.cs @@ -136,7 +136,7 @@ private void MinimizeWindow() Hide(); } - public void MaximizeWindow() + public void ShowWindow() { PositionWindowUnderTheMouse(); WindowState = WindowState.Normal; @@ -153,7 +153,7 @@ private void TrayMenuItem_OnClick(object sender, RoutedEventArgs e) switch (tag) { case "open": - MaximizeWindow(); + ShowWindow(); break; case "settings": Process.Start("explorer", "\"" + Constants.APP_SETTINGS_MAIN + "\""); @@ -176,7 +176,7 @@ private void TrayMenuItem_OnClick(object sender, RoutedEventArgs e) } } - private void NotifyIcon_LeftClick(object sender, RoutedEventArgs e) => MaximizeWindow(); + private void NotifyIcon_LeftClick(object sender, RoutedEventArgs e) => ShowWindow(); private void Window_Deactivated(object sender, EventArgs e) { @@ -209,7 +209,7 @@ private void Button_Click(object sender, RoutedEventArgs e) forcePreventWindowDeactivationEvent = false; } - private void UiWindow_SizeChanged(object sender, SizeChangedEventArgs e) => SettingsGlobal.AdjustWindowSize(e); + private void Window_SizeChanged(object sender, SizeChangedEventArgs e) => SettingsGlobal.AdjustWindowSize(e); async private void Linkpreview_Click(object sender, RoutedEventArgs e) { diff --git a/Source/Hurl.BrowserSelector/Windows/TimeSelectWindow.xaml b/Source/Hurl.BrowserSelector/Windows/TimeSelectWindow.xaml index b7d44939..b5cdda9b 100644 --- a/Source/Hurl.BrowserSelector/Windows/TimeSelectWindow.xaml +++ b/Source/Hurl.BrowserSelector/Windows/TimeSelectWindow.xaml @@ -40,13 +40,13 @@ ItemsSource="{Binding}" /> - + Cancel Current diff --git a/Source/Hurl.BrowserSelector/Windows/TimeSelectWindow.xaml.cs b/Source/Hurl.BrowserSelector/Windows/TimeSelectWindow.xaml.cs index 7c917e84..e134e479 100644 --- a/Source/Hurl.BrowserSelector/Windows/TimeSelectWindow.xaml.cs +++ b/Source/Hurl.BrowserSelector/Windows/TimeSelectWindow.xaml.cs @@ -19,7 +19,7 @@ public TimeSelectWindow(List x) DataContext = x.ConvertAll(y => y.Name); } - private void Button_Click(object sender, System.Windows.RoutedEventArgs e) + private void SetBtn_Click(object sender, System.Windows.RoutedEventArgs e) { var x = TimeBox.Value; var y = BrowserBox.SelectedIndex; @@ -32,7 +32,7 @@ private void Button_Click(object sender, System.Windows.RoutedEventArgs e) } } - private void Button_Click_1(object sender, System.Windows.RoutedEventArgs e) + private void CancelBtn_Click(object sender, System.Windows.RoutedEventArgs e) { TimedBrowserSelect.DeleteCurrent(); Close();