]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix use of HEIGHT_DIALOGBORDER:
authorterencehill <piuntn@gmail.com>
Fri, 23 Jul 2010 15:51:23 +0000 (17:51 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 23 Jul 2010 22:19:56 +0000 (00:19 +0200)
- its value was ignored (always used the default value 1)
- the menu didn't handle correctly it anyway

Note:
MARGIN_BOTTOM, MARGIN_LEFT and MARGIN_RIGHT must be changed according to HEIGHT_DIALOGBORDER, as the code DON'T handle directly the border size, while MARGIN_TOP is intended as the distance from the title bar and doesn't depend on HEIGHT_DIALOGBORDER.
FONTSIZE_TITLE and HEIGHT_TITLE must NOT be changed according to HEIGHT_DIALOGBORDER because they change the borders too (I don't know why they behave in this way).

qcsrc/menu/item/borderimage.c
qcsrc/menu/item/dialog.c

index 0229b53a55b9d6e18a72ba6e97bdd313d92d5193..236b2352221259a98b0e5604b4e3e2b06180b5c9 100644 (file)
@@ -13,7 +13,6 @@ CLASS(BorderImage) EXTENDS(Label)
        ATTRIB(BorderImage, isNexposeeTitleBar, float, 0)
        ATTRIB(BorderImage, zoomedOutTitleBarPosition, float, 0)
        ATTRIB(BorderImage, zoomedOutTitleBar, float, 0)
        ATTRIB(BorderImage, isNexposeeTitleBar, float, 0)
        ATTRIB(BorderImage, zoomedOutTitleBarPosition, float, 0)
        ATTRIB(BorderImage, zoomedOutTitleBar, float, 0)
-       ATTRIB(BorderImage, borderLines, float, 1)
 ENDCLASS(BorderImage)
 #endif
 
 ENDCLASS(BorderImage)
 #endif
 
@@ -36,7 +35,8 @@ void BorderImage_resizeNotify(entity me, vector relOrigin, vector relSize, vecto
                me.realFontSize_Nexposeed = me.realFontSize;
        }
        SUPER(BorderImage).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
                me.realFontSize_Nexposeed = me.realFontSize;
        }
        SUPER(BorderImage).resizeNotify(me, relOrigin, relSize, absOrigin, absSize);
-       me.borderVec = me.borderHeight / absSize_y * (eY + eX * (absSize_y / absSize_x));
+       me.borderVec_x = me.borderHeight / absSize_x;
+       me.borderVec_y = me.borderHeight / absSize_y;
        me.realOrigin_y = 0.5 * (me.borderVec_y - me.realFontSize_y);
        if(me.closeButton)
        {
        me.realOrigin_y = 0.5 * (me.borderVec_y - me.realFontSize_y);
        if(me.closeButton)
        {
@@ -60,7 +60,7 @@ void BorderImage_draw(entity me)
        //print(vtos(me.borderVec), "\n");
 
        if(me.src)
        //print(vtos(me.borderVec), "\n");
 
        if(me.src)
-               draw_BorderPicture('0 0 0', me.src, '1 1 0', me.color, 1, me.borderLines * me.borderVec);
+               draw_BorderPicture('0 0 0', me.src, '1 1 0', me.color, 1, me.borderVec);
        if(me.fontSize > 0)
        {
                vector ro, rf, df;
        if(me.fontSize > 0)
        {
                vector ro, rf, df;
index 8202fbbb67e4c358989d96c20bae9eb2dd002cec..3d537bfb92f3bc74f735a00a3031100d335e6118 100644 (file)
@@ -59,6 +59,7 @@ CLASS(Dialog) EXTENDS(InputContainer)
        ATTRIB(Dialog, zoomedOutTitleBar, float, 0)
 
        ATTRIB(Dialog, backgroundImage, string, string_null)
        ATTRIB(Dialog, zoomedOutTitleBar, float, 0)
 
        ATTRIB(Dialog, backgroundImage, string, string_null)
+       ATTRIB(Dialog, borderLines, float, 1)
        ATTRIB(Dialog, closeButtonImage, string, string_null)
 
        ATTRIB(Dialog, frame, entity, NULL)
        ATTRIB(Dialog, closeButtonImage, string, string_null)
 
        ATTRIB(Dialog, frame, entity, NULL)
@@ -128,7 +129,7 @@ void Dialog_configureDialog(entity me)
        float absWidth, absHeight;
 
        me.frame = spawnBorderImage();
        float absWidth, absHeight;
 
        me.frame = spawnBorderImage();
-       me.frame.configureBorderImage(me.frame, me.title, me.titleFontSize, me.color, me.backgroundImage, me.titleHeight);
+       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.frame.zoomedOutTitleBarPosition = me.zoomedOutTitleBarPosition;
        me.frame.zoomedOutTitleBar = me.zoomedOutTitleBar;
        me.frame.alpha = me.alpha;
@@ -138,9 +139,9 @@ void Dialog_configureDialog(entity me)
                me.titleHeight = 0; // no title bar
 
        absWidth = me.intendedWidth * conwidth;
                me.titleHeight = 0; // no title bar
 
        absWidth = me.intendedWidth * conwidth;
-       absHeight = me.titleHeight + me.marginTop + me.rows * me.rowHeight + (me.rows - 1) * me.rowSpacing + me.marginBottom;
+       absHeight = me.borderLines * me.titleHeight + me.marginTop + me.rows * me.rowHeight + (me.rows - 1) * me.rowSpacing + me.marginBottom;
        me.itemOrigin  = eX * (me.marginLeft / absWidth)
        me.itemOrigin  = eX * (me.marginLeft / absWidth)
-                      + eY * ((me.titleHeight + me.marginTop) / absHeight);
+                      + eY * ((me.borderLines * me.titleHeight + me.marginTop) / absHeight);
        me.itemSize    = eX * ((1 - (me.marginLeft + me.marginRight + me.columnSpacing * (me.columns - 1)) / absWidth) / me.columns)
                       + eY * (me.rowHeight / absHeight);
        me.itemSpacing = me.itemSize
        me.itemSize    = eX * ((1 - (me.marginLeft + me.marginRight + me.columnSpacing * (me.columns - 1)) / absWidth) / me.columns)
                       + eY * (me.rowHeight / absHeight);
        me.itemSpacing = me.itemSize