mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-24 03:45:30 +00:00
Fix: Window Statechange on doubleclick works everywhere (#2768)
* Run the Doubleclick action only on Grid and Stackpanel and cleanup the logic * Remove ternary operator because it is only supported for powershell 7+
This commit is contained in:
parent
b3bbe0dbe5
commit
9136ed9802
@ -255,10 +255,14 @@ $sync["Form"].Add_MouseLeftButtonDown({
|
||||
})
|
||||
|
||||
$sync["Form"].Add_MouseDoubleClick({
|
||||
if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal) {
|
||||
$sync["Form"].WindowState = [Windows.WindowState]::Maximized;
|
||||
} else {
|
||||
$sync["Form"].WindowState = [Windows.WindowState]::Normal;
|
||||
if ($_.OriginalSource -is [System.Windows.Controls.Grid] -or
|
||||
$_.OriginalSource -is [System.Windows.Controls.StackPanel]) {
|
||||
if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal){
|
||||
$sync["Form"].WindowState = [Windows.WindowState]::Maximized
|
||||
}
|
||||
else{
|
||||
$sync["Form"].WindowState = [Windows.WindowState]::Normal
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user