-
Notifications
You must be signed in to change notification settings - Fork 10
/
icons.go
44 lines (38 loc) · 1.4 KB
/
icons.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) 2019 Dean Jackson <[email protected]>
// MIT Licence applies http://opensource.org/licenses/MIT
package main
import (
"fmt"
aw "github.com/deanishe/awgo"
)
// Workflow icons
var (
iconError = &aw.Icon{Value: "icons/error.png"}
iconForum = &aw.Icon{Value: "icons/forum.png"}
iconHelp = &aw.Icon{Value: "icons/help.png"}
iconIssue = &aw.Icon{Value: "icons/issue.png"}
iconReload = &aw.Icon{Value: "icons/reload.png"}
iconOn = &aw.Icon{Value: "icons/toggle-on.png"}
iconOff = &aw.Icon{Value: "icons/toggle-off.png"}
iconSettings = &aw.Icon{Value: "icons/settings.png"}
iconSublime = &aw.Icon{Value: "icons/sublime.png"}
iconUpdateAvailable = &aw.Icon{Value: "icons/update-available.png"}
iconUpdateOK = &aw.Icon{Value: "icons/update-ok.png"}
iconVSCode = &aw.Icon{Value: "icons/vscode.png"}
iconWarning = &aw.Icon{Value: "icons/warning.png"}
spinnerIcons = []*aw.Icon{
{Value: "icons/spinner-1.png"},
{Value: "icons/spinner-2.png"},
{Value: "icons/spinner-3.png"},
}
)
func init() {
aw.IconError = iconError
aw.IconWarning = iconWarning
}
// iconSpinner returns a "frame" for a spinning icon.
func iconSpinner() *aw.Icon {
n := wf.Config.GetInt("RELOAD_PROGRESS", 0)
wf.Var("RELOAD_PROGRESS", fmt.Sprintf("%d", n+1))
return spinnerIcons[n%len(spinnerIcons)]
}