mirror of
https://github.com/Baipyrus/ProxySwitcher.git
synced 2024-12-26 04:31:45 +00:00
added icon and toggle display
This commit is contained in:
parent
87d6b4d89f
commit
781baa2d45
BIN
ICON_Disabled.ico
Normal file
BIN
ICON_Disabled.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
ICON_Disabled.png
Normal file
BIN
ICON_Disabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
BIN
ICON_Enabled.ico
Normal file
BIN
ICON_Enabled.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.1 KiB |
BIN
ICON_Enabled.png
Normal file
BIN
ICON_Enabled.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
4
run.ps1
4
run.ps1
@ -5,7 +5,7 @@ Add-Type -AssemblyName System.Drawing
|
||||
# Create a new NotifyIcon
|
||||
$trayIcon = New-Object System.Windows.Forms.NotifyIcon
|
||||
# Use a default application icon
|
||||
$trayIcon.Icon = [System.Drawing.SystemIcons]::Application
|
||||
$trayIcon.Icon = './ICON_Disabled.ico'
|
||||
$trayIcon.Text = 'ProxySwitcher'
|
||||
$trayIcon.Visible = $true
|
||||
|
||||
@ -23,6 +23,7 @@ $ctxProperties.Add_Click({
|
||||
$ctxEnable = New-Object System.Windows.Forms.ToolStripMenuItem
|
||||
$ctxEnable.Text = 'Enable Proxy'
|
||||
$ctxEnable.Add_Click({
|
||||
$trayIcon.Icon = './ICON_Enabled.ico'
|
||||
Start-Process powershell.exe -ArgumentList '-Command', 'go run . set'
|
||||
})
|
||||
|
||||
@ -30,6 +31,7 @@ $ctxEnable.Add_Click({
|
||||
$ctxDisable = New-Object System.Windows.Forms.ToolStripMenuItem
|
||||
$ctxDisable.Text = 'Disable Proxy'
|
||||
$ctxDisable.Add_Click({
|
||||
$trayIcon.Icon = './ICON_Disabled.ico'
|
||||
Start-Process powershell.exe -ArgumentList '-Command', 'go run . unset'
|
||||
})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user