]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/container.c
Merge remote-tracking branch 'origin/terencehill/color_picker_carets'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / container.c
index 5e924a0eebf7726cc10825984f6e3563e352b312..f14a4ceb7c90c949a41ff322e3d2a3258e5e73ba 100644 (file)
@@ -85,7 +85,7 @@ void Container_showNotify(entity me)
 void Container_hideNotify(entity me)
 {
        entity e;
-       if not(me.shown)
+       if (!me.shown)
                return;
        me.shown = 0;
        for(e = me.firstChild; e; e = e.nextSibling)
@@ -177,6 +177,8 @@ void Container_draw(entity me)
                e.draw(e);
                me.leaveSubitem(me);
        }
+
+       SUPER(Container).draw(me);
 }
 
 void Container_focusLeave(entity me)
@@ -302,8 +304,7 @@ void Container_addItem(entity me, entity other, vector theOrigin, vector theSize
        other.Container_size = theSize;
        me.setAlphaOf(me, other, theAlpha);
 
-       entity f, l;
-       f = me.firstChild;
+       entity l;
        l = me.lastChild;
 
        if(l)
@@ -328,9 +329,7 @@ void Container_removeItem(entity me, entity other)
 
        other.parent = NULL;
 
-       entity n, p, f, l;
-       f = me.firstChild;
-       l = me.lastChild;
+       entity n, p;
        n = other.nextSibling;
        p = other.prevSibling;
 
@@ -348,7 +347,7 @@ void Container_removeItem(entity me, entity other)
 void Container_setFocus(entity me, entity other)
 {
        if(other)
-               if not(me.focused)
+               if (!me.focused)
                        error("Trying to set focus in a non-focused control!");
        if(me.focusedChild == other)
                return;
@@ -369,13 +368,11 @@ void Container_setFocus(entity me, entity other)
 void Container_moveItemAfter(entity me, entity other, entity dest)
 {
        // first: remove other from the chain
-       entity n, p, f, l;
+       entity n, p;
 
        if(other.parent != me)
                error("Can't move in wrong container!");
 
-       f = me.firstChild;
-       l = me.lastChild;
        n = other.nextSibling;
        p = other.prevSibling;
 
@@ -388,7 +385,7 @@ void Container_moveItemAfter(entity me, entity other, entity dest)
                n.prevSibling = p;
        else
                me.lastChild = p;
-       
+
        // now other got removed. Insert it behind dest now.
        other.prevSibling = dest;
        if(dest)