Skip to content

Enhance traybar icons #857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions icon/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions icon/icon_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package icon

import _ "embed" // import embed to embed the icon

// GetIcon will return the icon
func GetIcon() []byte {
return data
}

// GetIconHiber will return the hibernated icon
func GetIconHiber() []byte {
return dataHibernate
}

// data represents the icon
//
//go:embed icon_mac.png
var data []byte

// dataHibernate represents the icon hibernated
//
//go:embed icon_mac_hiber.png
var dataHibernate []byte
63 changes: 63 additions & 0 deletions icon/icon_hiber.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 0 additions & 2 deletions icon/iconlinux.go → icon/icon_linux.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build linux

package icon

import _ "embed" // import embed to embed the icon
Binary file modified icon/icon_linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon/icon_linux_hiber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon/icon_mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified icon/icon_mac_hiber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed icon/icon_mac_light.png
Binary file not shown.
Binary file removed icon/icon_mac_light_hiber.png
Binary file not shown.
Binary file modified icon/icon_win.ico
Binary file not shown.
Binary file modified icon/icon_win_hiber.ico
Binary file not shown.
2 changes: 0 additions & 2 deletions icon/iconwin.go → icon/icon_windows.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build windows

package icon

import _ "embed" // import embed to embed the icon
52 changes: 0 additions & 52 deletions icon/icondarwin.go

This file was deleted.

4 changes: 2 additions & 2 deletions systray/systray_real.go
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ func (s *Systray) Quit() {

// start creates a systray icon with menu options to go to arduino create, open debug, pause/quit the agent
func (s *Systray) start() {
systray.SetIcon(icon.GetIcon())
systray.SetTemplateIcon(icon.GetIcon(), icon.GetIcon())

// Add version
menuVer := systray.AddMenuItem("Agent version "+s.Version, "")
@@ -136,7 +136,7 @@ func RemoveCrashes() {

// starthibernate creates a systray icon with menu options to resume/quit the agent
func (s *Systray) startHibernate() {
systray.SetIcon(icon.GetIconHiber())
systray.SetTemplateIcon(icon.GetIconHiber(), icon.GetIconHiber())

mResume := systray.AddMenuItem("Resume Agent", "")
systray.AddSeparator()