mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 00:46:12 +02:00
Send plugin windows to front when edit mode enabled and to back when disabled
This commit is contained in:
@@ -159,17 +159,6 @@ namespace DesktopMagic
|
||||
|
||||
#region Windows
|
||||
|
||||
private static void DisplayWindow_ContentRendered(object? sender, EventArgs e)
|
||||
{
|
||||
if (sender is not Window window)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WindowPos.SendWpfWindowBack(window);
|
||||
WindowPos.SendWpfWindowBack(window);
|
||||
}
|
||||
|
||||
private void EditCheckBox_Click(object? sender, RoutedEventArgs? e)
|
||||
{
|
||||
foreach (PluginWindow window in Windows)
|
||||
@@ -265,7 +254,6 @@ namespace DesktopMagic
|
||||
window.ShowInTaskbar = false;
|
||||
window.Show();
|
||||
window.SetEditMode(editCheckBox.IsChecked == true);
|
||||
window.ContentRendered += DisplayWindow_ContentRendered;
|
||||
window.Closing += DisplayWindow_Closing;
|
||||
Windows.Add(window);
|
||||
WindowNames.Add(window.Title);
|
||||
@@ -289,12 +277,6 @@ namespace DesktopMagic
|
||||
ShowInTaskbar = false;
|
||||
WindowState = WindowState.Minimized;
|
||||
Visibility = Visibility.Collapsed;
|
||||
|
||||
foreach (Window item in Windows)
|
||||
{
|
||||
WindowPos.SendWpfWindowBack(item);
|
||||
WindowPos.SendWpfWindowBack(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,7 @@ public partial class PluginWindow : Window
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
Topmost = true;
|
||||
panel.Visibility = Visibility.Visible;
|
||||
imageBorder.BorderThickness = new Thickness(3);
|
||||
image.Margin = new(-3);
|
||||
@@ -103,9 +104,12 @@ public partial class PluginWindow : Window
|
||||
}
|
||||
else
|
||||
{
|
||||
Topmost = false;
|
||||
panel.Visibility = Visibility.Collapsed;
|
||||
imageBorder.BorderThickness = new Thickness(0);
|
||||
image.Margin = new Thickness(0);
|
||||
WindowPos.SendWpfWindowBack(this);
|
||||
WindowPos.SendWpfWindowBack(this);
|
||||
WindowPos.SetIsLocked(this, true);
|
||||
tileBar.CaptionHeight = 0;
|
||||
ResizeMode = ResizeMode.NoResize;
|
||||
|
||||
Reference in New Issue
Block a user