TextBox tries to get a type face when parented if its face is nil

This commit is contained in:
Sasha Koshka 2024-08-11 11:55:13 -04:00
parent 919f000073
commit e1cf524c57

View File

@ -493,9 +493,9 @@ func (this *textBox) scrollToDot () {
func (this *textBox) handleFaceChange () {
hierarchy := this.getHierarchy()
if hierarchy != nil { return }
if hierarchy == nil { return }
faceSet := hierarchy.getFaceSet()
if faceSet != nil { return }
if faceSet == nil { return }
face := faceSet.Face(tomo.Face(this.attrFace.Value()))
this.face.Set(face, face)
@ -503,3 +503,23 @@ func (this *textBox) handleFaceChange () {
this.invalidateMinimum()
this.invalidateLayout()
}
func (this *textBox) recursiveReApply () {
this.box.recursiveReApply()
hierarchy := this.getHierarchy()
if hierarchy == nil { return }
previousFace := this.face.Value()
if previousFace == nil {
faceSet := hierarchy.getFaceSet()
if faceSet == nil { return }
face := faceSet.Face(tomo.Face(this.attrFace.Value()))
if face != previousFace {
this.face.Set(face, face)
this.drawer.SetFace(face)
this.invalidateMinimum()
this.invalidateLayout()
}
}
}