mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 00:46:12 +02:00
Set WindowState of main window to Minimized when closing
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
<DockPanel Margin="0,0,2.5,0">
|
||||
<Grid DockPanel.Dock="Top">
|
||||
<Rectangle Grid.Row="1" Fill="#FFECECEC" Height="24" />
|
||||
<CheckBox x:Name="EditCheckBox" VerticalAlignment="Center" Grid.Row="1" Content="{DynamicResource edit}" Click="EditCheckBox_Click" Foreground="Black" BorderBrush="#FF323232" Style="{StaticResource MaterialDesignDarkCheckBox}" IsChecked="True" />
|
||||
<CheckBox x:Name="editCheckBox" VerticalAlignment="Center" Grid.Row="1" Content="{DynamicResource edit}" Click="EditCheckBox_Click" Foreground="Black" BorderBrush="#FF323232" Style="{StaticResource MaterialDesignDarkCheckBox}" IsChecked="True" />
|
||||
</Grid>
|
||||
<ScrollViewer Background="#FFBBBBBB" PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||
<ItemsControl ItemsSource="{Binding Settings.CurrentLayout.Plugins}">
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace DesktopMagic
|
||||
Items =
|
||||
{
|
||||
new System.Windows.Forms.ToolStripMenuItem((string)App.LanguageDictionary["open"], null, (s, e) => RestoreWindow()),
|
||||
new System.Windows.Forms.ToolStripMenuItem((string)App.LanguageDictionary ["toggleEditMode"], null, (s, e) => { EditCheckBox.IsChecked = !EditCheckBox.IsChecked; EditCheckBox_Click(null, null); }),
|
||||
new System.Windows.Forms.ToolStripMenuItem((string)App.LanguageDictionary["toggleEditMode"], null, (s, e) => { editCheckBox.IsChecked = !editCheckBox.IsChecked; EditCheckBox_Click(null, null); }),
|
||||
new System.Windows.Forms.ToolStripMenuItem((string)App.LanguageDictionary["pluginManager"], null, (s, e) => PluginManagerButton_Click(null!, null!)),
|
||||
new System.Windows.Forms.ToolStripMenuItem("GitHub", null, (s, e) => GitHubButton_Click(null!, null!)),
|
||||
new System.Windows.Forms.ToolStripMenuItem((string)App.LanguageDictionary["quit"], null, (s, e) => Quit()),
|
||||
@@ -174,7 +174,7 @@ namespace DesktopMagic
|
||||
{
|
||||
foreach (PluginWindow window in Windows)
|
||||
{
|
||||
window.SetEditMode(EditCheckBox.IsChecked == true);
|
||||
window.SetEditMode(editCheckBox.IsChecked == true);
|
||||
}
|
||||
|
||||
SaveSettings();
|
||||
@@ -264,7 +264,7 @@ namespace DesktopMagic
|
||||
|
||||
window.ShowInTaskbar = false;
|
||||
window.Show();
|
||||
window.SetEditMode(EditCheckBox.IsChecked == true);
|
||||
window.SetEditMode(editCheckBox.IsChecked == true);
|
||||
window.ContentRendered += DisplayWindow_ContentRendered;
|
||||
window.Closing += DisplayWindow_Closing;
|
||||
Windows.Add(window);
|
||||
@@ -284,9 +284,10 @@ namespace DesktopMagic
|
||||
{
|
||||
e.Cancel = true;
|
||||
|
||||
EditCheckBox.IsChecked = false;
|
||||
editCheckBox.IsChecked = false;
|
||||
EditCheckBox_Click(null, null);
|
||||
ShowInTaskbar = false;
|
||||
WindowState = WindowState.Minimized;
|
||||
Visibility = Visibility.Collapsed;
|
||||
|
||||
foreach (Window item in Windows)
|
||||
@@ -588,7 +589,7 @@ namespace DesktopMagic
|
||||
window.Close();
|
||||
}
|
||||
|
||||
EditCheckBox.IsChecked = false;
|
||||
editCheckBox.IsChecked = false;
|
||||
EditCheckBox_Click(null, null);
|
||||
blockWindowsClosing = true;
|
||||
Windows.Clear();
|
||||
|
||||
Reference in New Issue
Block a user