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

Method resetStyleWidget

core/style.go:83–98  ·  view source on GitHub ↗

resetStyleWidget resets the widget styles and applies the basic default styles specified in [styles.Style.Defaults].

()

Source from the content-addressed store, hash-verified

81// resetStyleWidget resets the widget styles and applies the basic
82// default styles specified in [styles.Style.Defaults].
83func (wb *WidgetBase) resetStyleWidget() {
84 s := &wb.Styles
85
86 // need to persist state
87 state := s.State
88 *s = styles.Style{}
89 s.Defaults()
90 s.State = state
91
92 // default to state layer associated with the state,
93 // which the developer can override in their stylers
94 // wb.Transition(&s.StateLayer, s.State.StateLayer(), 200*time.Millisecond, LinearTransition)
95 s.StateLayer = s.State.StateLayer()
96
97 s.SetMono(false)
98}
99
100// runStylers runs the [WidgetBase.Stylers].
101func (wb *WidgetBase) runStylers() {

Callers 1

StyleMethod · 0.95

Calls 3

StateLayerMethod · 0.80
SetMonoMethod · 0.80
DefaultsMethod · 0.65

Tested by

no test coverage detected