diff --git a/code/commands.go b/code/commands.go index b1860508..f8fde9d1 100644 --- a/code/commands.go +++ b/code/commands.go @@ -818,17 +818,14 @@ func CommandMenu(fn *filetree.Node) func(mm *core.Scene) { continue } cmdCat := cc[0] - ic := icons.Icon(strings.ToLower(cmdCat)) - if !ic.IsValid() { - fmt.Println("icon not found", cmdCat) - } - cb := core.NewButton(mm).SetText(cmdCat).SetType(core.ButtonMenu).SetIcon(ic) + icon := CommandIcons[cmdCat] + cb := core.NewButton(mm).SetText(cmdCat).SetType(core.ButtonMenu).SetIcon(icon) cb.SetMenu(func(m *core.Scene) { for ii := 1; ii < n; ii++ { ii := ii it := cc[ii] cmdNm := CommandName(cmdCat, it) - bt := core.NewButton(m).SetText(it).SetIcon(ic) + bt := core.NewButton(m).SetText(it).SetIcon(icon) bt.OnClick(func(e events.Event) { // e.SetHandled() // note: this allows menu to stay open :) cmd := CmdName(cmdNm) @@ -845,3 +842,5 @@ func CommandMenu(fn *filetree.Node) func(mm *core.Scene) { } } } + +var CommandIcons = map[string]icons.Icon{"File": icons.File, "Git": icons.Git, "Build": icons.Build, "Core": icons.CogentCore, "Go": icons.Go} diff --git a/code/console.go b/code/console.go index 2e483263..e99e8f2d 100644 --- a/code/console.go +++ b/code/console.go @@ -11,6 +11,7 @@ import ( "sync" "cogentcore.org/core/base/errors" + "cogentcore.org/core/colors" "cogentcore.org/core/core" "cogentcore.org/core/texteditor" ) @@ -107,7 +108,8 @@ func MarkupStdout(out []byte) []byte { } func MarkupStderr(out []byte) []byte { - sst := []byte(``) + ec := colors.AsHex(colors.ToUniform(colors.Scheme.Error.Base)) + sst := []byte(``) est := []byte(``) esz := len(sst) + len(est)