Преглед изворни кода

refactored call of gui panel z coord. calculation

leonsal пре 8 година
родитељ
комит
9561d53f4c
2 измењених фајлова са 2 додато и 11 уклоњено
  1. 1 1
      gui/panel.go
  2. 1 10
      gui/root.go

+ 1 - 1
gui/panel.go

@@ -488,7 +488,7 @@ func (p *Panel) Add(ichild IPanel) *Panel {
 	node.SetParent(p)
 	if p.root != nil {
 		ichild.SetRoot(p.root)
-		p.root.setChildrenZ()
+		p.root.setZ(0, deltaZunb)
 	}
 	if p.layout != nil {
 		p.layout.Recalc(p)

+ 1 - 10
gui/root.go

@@ -66,7 +66,7 @@ func (r *Root) SubscribeWin() {
 // Overrides the Panel version because it needs to set the root panel field
 func (r *Root) Add(ipan IPanel) {
 
-	// Sets the root panel field of the child
+	// Sets the root panel field of the child to be added
 	ipan.GetPanel().root = r
 	// Add this panel to the root panel children.
 	// This will also set the root panel for all the child children
@@ -170,15 +170,6 @@ func (r *Root) SetCursorVResize() {
 	r.win.SetStandardCursor(window.VResizeCursor)
 }
 
-// setChildrenZ sets the z coordinates of all children of this root panel
-func (r *Root) setChildrenZ() {
-
-	if r == nil {
-		return
-	}
-	r.setZ(0, deltaZunb)
-}
-
 // onKey is called when key events are received
 func (r *Root) onKey(evname string, ev interface{}) {