Layout Problem

I have a Horizontal Layout that is 100% in width and I want to put two components into it: a label and an icon. I want the icon to be just to the right of the label’s text. My problem is in regards to short text vs. long text in the label. If the text is short, I want the icon to be immediately next to the text followed by white space. If the text is long, I want the text to wrap if necessary. I only want about one space in length between the text and the icon. I don’t want the icon to overflow which would cause it to be hidden.

I’ve tried everything I can think of with varying widths and using the expand ratio. Does anyone know how this can be done?

Thanks in advance.

The core layouts can’t really handle this request, since no max-width can be specified for the HorizontalLayout. I’d say your best bet is to use a CustomLayout and an undefined wide Label and override the white-space property of the label using CSS so it’ll wrap when necessary.