DeadlyNightshade
01-05-2013, 11:03 PM
http://img801.imageshack.us/img801/2489/paddingissues.jpg
The picture is scaled up 400%
The UI parts that I want are the black thumbnail -like squares labeled 1 to 5, and their attached labels of grey color. All other colors in this creenshots comes from backgroundColor -flags on the rowLayout and columnLayouts that I've added for error checking purposes.
The problem is that I can't get rid of this padding!
The child objects does not have any border -flags - so it's not them that's causing the problems (1 to 5 are made up of the same code). To confirm this I isolated the thumbnail-like objects in a completely new UI window, took a print screen and looked at it in Photoshop: no added padding around the child objects.
So what's happening here is that all my columnLayouts are adding a 1px thick padding on the inside of themselves. And all my rowLayouts does the same. The rowLayouts also add a 2px horizontal padding between their child elements.
My immediate question to all this is: Is this normal Maya behavior? Does these UI commands add this padding by default?
Code is here below:
frameLayout
-label "TEST"
;
rowLayout
-backgroundColor 0.7 0.7 0.7
-numberOfColumns 2;
columnLayout
-backgroundColor 0.0 0.0 1.0;
// Square ONE
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 15
-style "textOnly"
-width 128
myLabel1;
setParent ..; // columnLayout
columnLayout
-backgroundColor 1.0 0.0 0.0;
rowLayout
-backgroundColor 0.5 1.0 0.5
-numberOfColumns 2;
// Square TWO
// Square THREE
setParent ..; // rowLayout
rowLayout
-backgroundColor 1.0 1.0 1.0
-numberOfColumns 2;
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 12
-style "textOnly"
-width 64
myLabel2;
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 12
-style "textOnly"
-width 64
myLabel3;
setParent ..; // rowLayout
rowLayout
-backgroundColor 1.0 1.0 0.0
-numberOfColumns 2;
// SQUARE FOUR
// SQUARE FIVE
setParent ..; // rowLayout
rowLayout
-backgroundColor 0.0 1.0 1.0
-numberOfColumns 2;
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 12
-style "textOnly"
-width 64
myLabel4;
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 12
-style "textOnly"
-width 64
myLabel5;
setParent ..; // rowLayout
setParent ..; // columnLayout
setParent ..; // rowLayout
setParent ..; // frameLayout
I've experiemented with different flags, such as setting -enableBackground to false, or -rowSpacing to 0, none of it has helped. And hardcoding the dimensions of the elements only pushes the child objects outside of view.
The picture is scaled up 400%
The UI parts that I want are the black thumbnail -like squares labeled 1 to 5, and their attached labels of grey color. All other colors in this creenshots comes from backgroundColor -flags on the rowLayout and columnLayouts that I've added for error checking purposes.
The problem is that I can't get rid of this padding!
The child objects does not have any border -flags - so it's not them that's causing the problems (1 to 5 are made up of the same code). To confirm this I isolated the thumbnail-like objects in a completely new UI window, took a print screen and looked at it in Photoshop: no added padding around the child objects.
So what's happening here is that all my columnLayouts are adding a 1px thick padding on the inside of themselves. And all my rowLayouts does the same. The rowLayouts also add a 2px horizontal padding between their child elements.
My immediate question to all this is: Is this normal Maya behavior? Does these UI commands add this padding by default?
Code is here below:
frameLayout
-label "TEST"
;
rowLayout
-backgroundColor 0.7 0.7 0.7
-numberOfColumns 2;
columnLayout
-backgroundColor 0.0 0.0 1.0;
// Square ONE
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 15
-style "textOnly"
-width 128
myLabel1;
setParent ..; // columnLayout
columnLayout
-backgroundColor 1.0 0.0 0.0;
rowLayout
-backgroundColor 0.5 1.0 0.5
-numberOfColumns 2;
// Square TWO
// Square THREE
setParent ..; // rowLayout
rowLayout
-backgroundColor 1.0 1.0 1.0
-numberOfColumns 2;
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 12
-style "textOnly"
-width 64
myLabel2;
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 12
-style "textOnly"
-width 64
myLabel3;
setParent ..; // rowLayout
rowLayout
-backgroundColor 1.0 1.0 0.0
-numberOfColumns 2;
// SQUARE FOUR
// SQUARE FIVE
setParent ..; // rowLayout
rowLayout
-backgroundColor 0.0 1.0 1.0
-numberOfColumns 2;
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 12
-style "textOnly"
-width 64
myLabel4;
iconTextButton
-backgroundColor 0.5 0.8 0.5
-command ("")
-height 12
-style "textOnly"
-width 64
myLabel5;
setParent ..; // rowLayout
setParent ..; // columnLayout
setParent ..; // rowLayout
setParent ..; // frameLayout
I've experiemented with different flags, such as setting -enableBackground to false, or -rowSpacing to 0, none of it has helped. And hardcoding the dimensions of the elements only pushes the child objects outside of view.
