mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 22:55:52 -06: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({
|
$sync["Form"].Add_MouseDoubleClick({
|
||||||
if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal) {
|
if ($_.OriginalSource -is [System.Windows.Controls.Grid] -or
|
||||||
$sync["Form"].WindowState = [Windows.WindowState]::Maximized;
|
$_.OriginalSource -is [System.Windows.Controls.StackPanel]) {
|
||||||
} else {
|
if ($sync["Form"].WindowState -eq [Windows.WindowState]::Normal){
|
||||||
$sync["Form"].WindowState = [Windows.WindowState]::Normal;
|
$sync["Form"].WindowState = [Windows.WindowState]::Maximized
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$sync["Form"].WindowState = [Windows.WindowState]::Normal
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user