Fletch
Fletch

Reputation: 5229

Add padding to a titlewindow in Flex 4 (ideally using skins)?

By default TitleWindows seem to have no padding. I tried the properties "left", "right" etc and it doesn't work. Actually I'd like to have a default for my whole app, so I tried creating a skin but no matter where in the skin I add 'left="50"' it just doesn't create padding on the left. You'd think that you should add it to the element with id="contentGroup", as described on this Adobe Skinning help page, but that does not work.

Surely this is something almost everyone wants to do?

Upvotes: 2

Views: 1281

Answers (2)

sshongru
sshongru

Reputation: 896

The contentGroup in the default TitleWindowSkin is inside a VerticalLayout which does not respect top/left/right/bottom constraints.

You could do this by duplicating the default TitleWindowSkin and wrapping the contentGroup with a Group with width/height of 100%:

...
<s:Group width="100%" height="100%">
    <!--- @copy spark.components.SkinnableContainer#contentGroup -->
    <s:Group id="contentGroup" top="10" left="10" right="10" bottom="10" minWidth="0" minHeight="0" />
</s:Group>
...

Upvotes: 2

Jason Towne
Jason Towne

Reputation: 8050

Since the TitleWindow extends the Panel component, it doesn't support the padding properties a HGroup or VGroup based component would. As far as I know, there's no way to skin a TitleWindow so that the padding properties are automatically set.

All I do is set the x and y coordinates of my components within the TitleWindow so that they are laid out where I want them.

Upvotes: 0

Related Questions