]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/menu/item/dialog.qc
Merge branch 'master' into Mario/physics
[xonotic/xonotic-data.pk3dir.git] / qcsrc / menu / item / dialog.qc
index e68a0931d13882e0b7c2d51cb8c230eda7e159fb..77037ace61132e48fc3bf57e87f24fc7e249756a 100644 (file)
@@ -13,7 +13,9 @@
 //
 // a subclass may help with using this as a tab
 
-#ifdef INTERFACE
+#ifndef ITEM_DIALOG_H
+#define ITEM_DIALOG_H
+#include "inputcontainer.qc"
 CLASS(Dialog, InputContainer)
        METHOD(Dialog, configureDialog, void(entity)) // no runtime configuration, all parameters are given in the code!
        METHOD(Dialog, fill, void(entity)) // to be overridden by user to fill the dialog with controls
@@ -128,12 +130,15 @@ void Dialog_configureDialog(entity me)
 {
        float absWidth, absHeight;
 
-       me.frame = NEW(BorderImage);
-       me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.borderLines * me.titleHeight);
-       me.frame.zoomedOutTitleBarPosition = me.zoomedOutTitleBarPosition;
-       me.frame.zoomedOutTitleBar = me.zoomedOutTitleBar;
-       me.frame.alpha = me.alpha;
-       me.addItem(me, me.frame, '0 0 0', '1 1 0', 1);
+       if(me.isTabRoot)
+       {
+               me.frame = NEW(BorderImage);
+               me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.borderLines * me.titleHeight);
+               me.frame.zoomedOutTitleBarPosition = me.zoomedOutTitleBarPosition;
+               me.frame.zoomedOutTitleBar = me.zoomedOutTitleBar;
+               me.frame.alpha = me.alpha;
+               me.addItem(me, me.frame, '0 0 0', '1 1 0', 1);
+       }
 
        if (!me.titleFontSize)
                me.titleHeight = 0; // no title bar
@@ -153,7 +158,7 @@ void Dialog_configureDialog(entity me)
 
        me.fill(me);
 
-       if(me.closable && me.borderLines > 0)
+       if(me.isTabRoot && me.closable && me.borderLines > 0)
        {
                entity closebutton;
                closebutton = me.closeButton = me.frame.closeButton = NEW(Button);