MCPcopy Index your code
hub / github.com/g3n/engine / applyStyle

Method applyStyle

gui/edit.go:328–344  ·  view source on GitHub ↗

applyStyle applies the specified style

(s *EditStyle)

Source from the content-addressed store, hash-verified

326
327// applyStyle applies the specified style
328func (ed *Edit) applyStyle(s *EditStyle) {
329
330 ed.SetBordersFrom(&s.Border)
331 ed.SetBordersColor4(&s.BorderColor)
332 ed.SetPaddingsFrom(&s.Paddings)
333 ed.Label.SetColor4(&s.FgColor)
334 ed.Label.SetBgColor4(&s.BgColor)
335 //ed.Label.SetBgAlpha(s.BgAlpha)
336
337 if !ed.focus && len(ed.text) == 0 && len(ed.placeHolder) > 0 {
338 ed.Label.SetColor4(&s.HolderColor)
339 ed.Label.setTextCaret(ed.placeHolder, editMarginX, ed.width, -1, ed.col)
340 } else {
341 ed.Label.SetColor4(&s.FgColor)
342 ed.redraw(ed.focus)
343 }
344}

Callers 1

updateMethod · 0.95

Calls 7

redrawMethod · 0.95
SetBordersFromMethod · 0.80
SetBordersColor4Method · 0.80
SetPaddingsFromMethod · 0.80
setTextCaretMethod · 0.80
SetColor4Method · 0.45
SetBgColor4Method · 0.45

Tested by

no test coverage detected