mirror of
https://github.com/prashantgupta24/automatic-mouse-mover.git
synced 2024-12-22 16:34:11 +00:00
about + enable default
This commit is contained in:
parent
42b7aea859
commit
b7b8ed2ecd
10
cmd/main.go
10
cmd/main.go
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/go-vgo/robotgo"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/getlantern/systray"
|
"github.com/getlantern/systray"
|
||||||
@ -15,6 +16,8 @@ func main() {
|
|||||||
func onReady() {
|
func onReady() {
|
||||||
go func() {
|
go func() {
|
||||||
systray.SetIcon(icon.Data)
|
systray.SetIcon(icon.Data)
|
||||||
|
about := systray.AddMenuItem("About AMM", "Information about the app")
|
||||||
|
systray.AddSeparator()
|
||||||
ammStart := systray.AddMenuItem("Start", "start the app")
|
ammStart := systray.AddMenuItem("Start", "start the app")
|
||||||
ammStop := systray.AddMenuItem("Stop", "stop the app")
|
ammStop := systray.AddMenuItem("Stop", "stop the app")
|
||||||
ammStop.Disable()
|
ammStop.Disable()
|
||||||
@ -23,6 +26,9 @@ func onReady() {
|
|||||||
// Sets the icon of a menu item. Only available on Mac.
|
// Sets the icon of a menu item. Only available on Mac.
|
||||||
//mQuit.SetIcon(icon.Data)
|
//mQuit.SetIcon(icon.Data)
|
||||||
mouseMover := mousemover.GetInstance()
|
mouseMover := mousemover.GetInstance()
|
||||||
|
mouseMover.Start()
|
||||||
|
ammStart.Disable()
|
||||||
|
ammStop.Enable()
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ammStart.ClickedCh:
|
case <-ammStart.ClickedCh:
|
||||||
@ -43,6 +49,10 @@ func onReady() {
|
|||||||
mouseMover.Quit()
|
mouseMover.Quit()
|
||||||
systray.Quit()
|
systray.Quit()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
case <-about.ClickedCh:
|
||||||
|
log.Infof("Requesting about")
|
||||||
|
robotgo.ShowAlert("Automatic-mouse-mover app", "Developed by Prashant Gupta. \n\nMore info at: https://github.com/prashantgupta24/automatic-mouse-mover")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user