()
| 24 | func (hb *Button) WidgetValue() any { return &hb.HighlightingName } |
| 25 | |
| 26 | func (hb *Button) Init() { |
| 27 | hb.Button.Init() |
| 28 | hb.SetType(core.ButtonTonal).SetIcon(icons.Brush) |
| 29 | hb.Updater(func() { |
| 30 | hb.SetText(hb.HighlightingName) |
| 31 | }) |
| 32 | core.InitValueButton(hb, false, func(d *core.Body) { |
| 33 | d.SetTitle("Select a syntax highlighting style") |
| 34 | si := 0 |
| 35 | ls := core.NewList(d).SetSlice(&StyleNames).SetSelectedValue(hb.HighlightingName).BindSelect(&si) |
| 36 | ls.OnChange(func(e events.Event) { |
| 37 | hb.HighlightingName = StyleNames[si] |
| 38 | }) |
| 39 | }) |
| 40 | } |
| 41 | |
| 42 | // Editor opens an editor of highlighting styles. |
| 43 | func Editor(st *Styles) { |
nothing calls this directly
no test coverage detected