Fix setting window not being displayed correctly
This commit is contained in:
parent
ebd4e8e530
commit
a2f2af87cc
@ -51,7 +51,6 @@ namespace unison
|
|||||||
|
|
||||||
public async void ConnectToMPD()
|
public async void ConnectToMPD()
|
||||||
{
|
{
|
||||||
Trace.WriteLine("Trying to connect...");
|
|
||||||
_connected = await _mpd.MpdCommandConnectionStart(_mpdHost, _mpdPort, _mpdPassword);
|
_connected = await _mpd.MpdCommandConnectionStart(_mpdHost, _mpdPort, _mpdPassword);
|
||||||
if (_connected)
|
if (_connected)
|
||||||
{
|
{
|
||||||
@ -212,17 +211,11 @@ namespace unison
|
|||||||
|
|
||||||
public void Settings_Clicked(object sender, RoutedEventArgs e)
|
public void Settings_Clicked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
SettingsWindow.Show();
|
||||||
|
SettingsWindow.Activate();
|
||||||
|
|
||||||
if (SettingsWindow.WindowState == WindowState.Minimized)
|
if (SettingsWindow.WindowState == WindowState.Minimized)
|
||||||
{
|
|
||||||
SettingsWindow.WindowState = WindowState.Normal;
|
SettingsWindow.WindowState = WindowState.Normal;
|
||||||
SettingsWindow.Show();
|
|
||||||
SettingsWindow.Activate();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SettingsWindow.Hide();
|
|
||||||
SettingsWindow.WindowState = WindowState.Minimized;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Closing(object sender, CancelEventArgs e)
|
private void Window_Closing(object sender, CancelEventArgs e)
|
||||||
|
@ -5,6 +5,7 @@ using System.Reflection;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Interop;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
|
|
||||||
namespace unison
|
namespace unison
|
||||||
@ -36,6 +37,7 @@ namespace unison
|
|||||||
|
|
||||||
public Settings()
|
public Settings()
|
||||||
{
|
{
|
||||||
|
InitHwnd();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
DataContext = this;
|
DataContext = this;
|
||||||
|
|
||||||
@ -84,5 +86,11 @@ namespace unison
|
|||||||
WindowState = WindowState.Minimized;
|
WindowState = WindowState.Minimized;
|
||||||
Hide();
|
Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void InitHwnd()
|
||||||
|
{
|
||||||
|
WindowInteropHelper helper = new(this);
|
||||||
|
helper.EnsureHandle();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user