mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 08:56:15 +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">
|
<DockPanel Margin="0,0,2.5,0">
|
||||||
<Grid DockPanel.Dock="Top">
|
<Grid DockPanel.Dock="Top">
|
||||||
<Rectangle Grid.Row="1" Fill="#FFECECEC" Height="24" />
|
<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>
|
</Grid>
|
||||||
<ScrollViewer Background="#FFBBBBBB" PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
<ScrollViewer Background="#FFBBBBBB" PreviewMouseWheel="ScrollViewer_PreviewMouseWheel">
|
||||||
<ItemsControl ItemsSource="{Binding Settings.CurrentLayout.Plugins}">
|
<ItemsControl ItemsSource="{Binding Settings.CurrentLayout.Plugins}">
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace DesktopMagic
|
|||||||
Items =
|
Items =
|
||||||
{
|
{
|
||||||
new System.Windows.Forms.ToolStripMenuItem((string)App.LanguageDictionary["open"], null, (s, e) => RestoreWindow()),
|
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((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("GitHub", null, (s, e) => GitHubButton_Click(null!, null!)),
|
||||||
new System.Windows.Forms.ToolStripMenuItem((string)App.LanguageDictionary["quit"], null, (s, e) => Quit()),
|
new System.Windows.Forms.ToolStripMenuItem((string)App.LanguageDictionary["quit"], null, (s, e) => Quit()),
|
||||||
@@ -174,7 +174,7 @@ namespace DesktopMagic
|
|||||||
{
|
{
|
||||||
foreach (PluginWindow window in Windows)
|
foreach (PluginWindow window in Windows)
|
||||||
{
|
{
|
||||||
window.SetEditMode(EditCheckBox.IsChecked == true);
|
window.SetEditMode(editCheckBox.IsChecked == true);
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
@@ -264,7 +264,7 @@ namespace DesktopMagic
|
|||||||
|
|
||||||
window.ShowInTaskbar = false;
|
window.ShowInTaskbar = false;
|
||||||
window.Show();
|
window.Show();
|
||||||
window.SetEditMode(EditCheckBox.IsChecked == true);
|
window.SetEditMode(editCheckBox.IsChecked == true);
|
||||||
window.ContentRendered += DisplayWindow_ContentRendered;
|
window.ContentRendered += DisplayWindow_ContentRendered;
|
||||||
window.Closing += DisplayWindow_Closing;
|
window.Closing += DisplayWindow_Closing;
|
||||||
Windows.Add(window);
|
Windows.Add(window);
|
||||||
@@ -284,9 +284,10 @@ namespace DesktopMagic
|
|||||||
{
|
{
|
||||||
e.Cancel = true;
|
e.Cancel = true;
|
||||||
|
|
||||||
EditCheckBox.IsChecked = false;
|
editCheckBox.IsChecked = false;
|
||||||
EditCheckBox_Click(null, null);
|
EditCheckBox_Click(null, null);
|
||||||
ShowInTaskbar = false;
|
ShowInTaskbar = false;
|
||||||
|
WindowState = WindowState.Minimized;
|
||||||
Visibility = Visibility.Collapsed;
|
Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
foreach (Window item in Windows)
|
foreach (Window item in Windows)
|
||||||
@@ -588,7 +589,7 @@ namespace DesktopMagic
|
|||||||
window.Close();
|
window.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
EditCheckBox.IsChecked = false;
|
editCheckBox.IsChecked = false;
|
||||||
EditCheckBox_Click(null, null);
|
EditCheckBox_Click(null, null);
|
||||||
blockWindowsClosing = true;
|
blockWindowsClosing = true;
|
||||||
Windows.Clear();
|
Windows.Clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user