generated from MrSphay/codex-agent-repository-kit
Fix GUI hover animation color capture
All checks were successful
Build MrTrust / build (push) Successful in 5m47s
All checks were successful
Build MrTrust / build (push) Successful in 5m47s
This commit is contained in:
@@ -92,16 +92,19 @@ function Add-AnimatedButton {
|
|||||||
[Parameter(Mandatory)][Drawing.Color]$Hover
|
[Parameter(Mandatory)][Drawing.Color]$Hover
|
||||||
)
|
)
|
||||||
|
|
||||||
|
$normalColor = $Normal
|
||||||
|
$hoverColor = $Hover
|
||||||
|
$textColor = $colors.Text
|
||||||
|
$borderColor = $colors.Border
|
||||||
|
|
||||||
$Button.FlatStyle = "Flat"
|
$Button.FlatStyle = "Flat"
|
||||||
$Button.FlatAppearance.BorderColor = $colors.Border
|
$Button.FlatAppearance.BorderColor = $borderColor
|
||||||
$Button.FlatAppearance.BorderSize = 1
|
$Button.FlatAppearance.BorderSize = 1
|
||||||
$Button.BackColor = $Normal
|
$Button.BackColor = $normalColor
|
||||||
$Button.ForeColor = $colors.Text
|
$Button.ForeColor = $textColor
|
||||||
$Button.Cursor = [Windows.Forms.Cursors]::Hand
|
$Button.Cursor = [Windows.Forms.Cursors]::Hand
|
||||||
$Button.Add_MouseEnter({ param($sender, $eventArgs) $sender.BackColor = $Hover })
|
$Button.Add_MouseEnter({ param($sender, $eventArgs) $sender.BackColor = $hoverColor }.GetNewClosure())
|
||||||
$Button.Add_MouseLeave({ param($sender, $eventArgs) $sender.BackColor = $Normal })
|
$Button.Add_MouseLeave({ param($sender, $eventArgs) $sender.BackColor = $normalColor }.GetNewClosure())
|
||||||
$Button.Add_MouseDown({ param($sender, $eventArgs) $sender.Location = [Drawing.Point]::new($sender.Location.X, $sender.Location.Y + 1) })
|
|
||||||
$Button.Add_MouseUp({ param($sender, $eventArgs) $sender.Location = [Drawing.Point]::new($sender.Location.X, $sender.Location.Y - 1) })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function New-Label {
|
function New-Label {
|
||||||
|
|||||||
Reference in New Issue
Block a user