Removed unneeded Container.reflectChildProperties()
This commit is contained in:
		
							parent
							
								
									b09994973c
								
							
						
					
					
						commit
						7ef95cc751
					
				@ -87,7 +87,6 @@ func (element *Container) Adopt (child elements.Element, expand bool) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// refresh stale data
 | 
						// refresh stale data
 | 
				
			||||||
	element.updateMinimumSize()
 | 
						element.updateMinimumSize()
 | 
				
			||||||
	element.reflectChildProperties()
 | 
					 | 
				
			||||||
	if element.core.HasImage() && !element.warping {
 | 
						if element.core.HasImage() && !element.warping {
 | 
				
			||||||
		element.redoAll()
 | 
							element.redoAll()
 | 
				
			||||||
		element.core.DamageAll()
 | 
							element.core.DamageAll()
 | 
				
			||||||
@ -130,7 +129,6 @@ func (element *Container) Disown (child elements.Element) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	element.updateMinimumSize()
 | 
						element.updateMinimumSize()
 | 
				
			||||||
	element.reflectChildProperties()
 | 
					 | 
				
			||||||
	if element.core.HasImage() && !element.warping {
 | 
						if element.core.HasImage() && !element.warping {
 | 
				
			||||||
		element.redoAll()
 | 
							element.redoAll()
 | 
				
			||||||
		element.core.DamageAll()
 | 
							element.core.DamageAll()
 | 
				
			||||||
@ -158,7 +156,6 @@ func (element *Container) DisownAll () {
 | 
				
			|||||||
	element.children = nil
 | 
						element.children = nil
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	element.updateMinimumSize()
 | 
						element.updateMinimumSize()
 | 
				
			||||||
	element.reflectChildProperties()
 | 
					 | 
				
			||||||
	if element.core.HasImage() && !element.warping {
 | 
						if element.core.HasImage() && !element.warping {
 | 
				
			||||||
		element.redoAll()
 | 
							element.redoAll()
 | 
				
			||||||
		element.core.DamageAll()
 | 
							element.core.DamageAll()
 | 
				
			||||||
@ -256,20 +253,6 @@ func (element *Container) OnFocusMotionRequest (
 | 
				
			|||||||
	element.Propagator.OnFocusMotionRequest(callback)
 | 
						element.Propagator.OnFocusMotionRequest(callback)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (element *Container) reflectChildProperties () {
 | 
					 | 
				
			||||||
	focusable := false
 | 
					 | 
				
			||||||
	for _, entry := range element.children {
 | 
					 | 
				
			||||||
		_, focusable := entry.Element.(elements.Focusable)
 | 
					 | 
				
			||||||
		if focusable {
 | 
					 | 
				
			||||||
			focusable = true
 | 
					 | 
				
			||||||
			break
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if !focusable && element.Focused() {
 | 
					 | 
				
			||||||
		element.Propagator.HandleUnfocus()
 | 
					 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
func (element *Container) childFocusRequestCallback (
 | 
					func (element *Container) childFocusRequestCallback (
 | 
				
			||||||
	child elements.Focusable,
 | 
						child elements.Focusable,
 | 
				
			||||||
) (
 | 
					) (
 | 
				
			||||||
 | 
				
			|||||||
@ -1,5 +1,6 @@
 | 
				
			|||||||
package core
 | 
					package core
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// import "runtime/debug"
 | 
				
			||||||
import "git.tebibyte.media/sashakoshka/tomo/input"
 | 
					import "git.tebibyte.media/sashakoshka/tomo/input"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// FocusableCore is a struct that can be embedded into objects to make them
 | 
					// FocusableCore is a struct that can be embedded into objects to make them
 | 
				
			||||||
@ -71,6 +72,7 @@ func (core *FocusableCore) HandleFocus (
 | 
				
			|||||||
// HandleUnfocus causes this element to mark itself as unfocused.
 | 
					// HandleUnfocus causes this element to mark itself as unfocused.
 | 
				
			||||||
func (core *FocusableCore) HandleUnfocus () {
 | 
					func (core *FocusableCore) HandleUnfocus () {
 | 
				
			||||||
	core.focused = false
 | 
						core.focused = false
 | 
				
			||||||
 | 
						// debug.PrintStack()
 | 
				
			||||||
	if core.drawFocusChange != nil { core.drawFocusChange() }
 | 
						if core.drawFocusChange != nil { core.drawFocusChange() }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user