MCPcopy Create free account
hub / github.com/cogentcore/core / settingsEditorToolbarBase

Function settingsEditorToolbarBase

core/settingseditor.go:15–31  ·  view source on GitHub ↗

settingsEditorToolbarBase is the base toolbar configuration function used in [SettingsEditor].

(p *tree.Plan)

Source from the content-addressed store, hash-verified

13// settingsEditorToolbarBase is the base toolbar configuration
14// function used in [SettingsEditor].
15func settingsEditorToolbarBase(p *tree.Plan) {
16 tree.Add(p, func(w *FuncButton) {
17 w.SetFunc(AppearanceSettings.SaveScreenZoom).SetIcon(icons.ZoomIn)
18 w.SetAfterFunc(func() {
19 AppearanceSettings.Apply()
20 UpdateAll()
21 })
22
23 p.Parent.(*Toolbar).AddOverflowMenu(func(m *Scene) {
24 NewFuncButton(m).SetFunc(resetAllSettings).SetConfirm(true).SetText("Reset settings").SetIcon(icons.Delete)
25
26 NewFuncButton(m).SetFunc(AppearanceSettings.deleteSavedWindowGeoms).SetConfirm(true).SetIcon(icons.Delete)
27 NewFuncButton(m).SetFunc(ProfileToggle).SetShortcut("Control+Alt+R").SetText("Profile performance").SetIcon(icons.Analytics)
28 NewSeparator(m)
29 })
30 })
31}
32
33// SettingsWindow opens a window for editing user settings.
34func SettingsWindow() { //types:add

Callers 1

SettingsEditorFunction · 0.85

Calls 12

AddFunction · 0.92
UpdateAllFunction · 0.85
NewFuncButtonFunction · 0.85
NewSeparatorFunction · 0.85
SetFuncMethod · 0.80
SetAfterFuncMethod · 0.80
AddOverflowMenuMethod · 0.80
SetConfirmMethod · 0.80
SetShortcutMethod · 0.80
SetIconMethod · 0.65
ApplyMethod · 0.65
SetTextMethod · 0.45

Tested by

no test coverage detected