SmartGwt version: 5.1-p20160131.
When setIcon is called on Label then the alignment is forced to LEFT no matter what setAlign is passed.
Here is the code to demonstrate this:
Additionally, I would like to know if there is a way to have the icon displayed aligned with the first line of the text rather than vertically centered on the text.
When setIcon is called on Label then the alignment is forced to LEFT no matter what setAlign is passed.
Here is the code to demonstrate this:
Code:
[B]public[/B] [B]class[/B] IconLabelTest [B]extends[/B] HLayout { [B]static[/B] [B]private[/B] String [I]LOTS_OF_TEXT[/I] = "Now is the time for all good men to come to the aid of their party"; [B]public[/B] IconLabelTest() { setWidth(300); addMember([B]new[/B] IconLabel([B]false[/B])); addMember([B]new[/B] IconLabel([B]true[/B])); setMembersMargin(3); } [B]private[/B] [B]class[/B] IconLabel [B]extends[/B] Label { [B]public[/B] IconLabel([B]boolean[/B] useIcon) { [B]super[/B]([I]LOTS_OF_TEXT[/I]); setWidth("*"); setBorder("3px solid red"); setAutoHeight(); setAlign(Alignment.[B][I]CENTER[/I][/B]); [B]if[/B] (useIcon) { setIcon("ConversationGuide/RedDot.png"); } } } }
Comment