Page 1 of 1

ListboxItemText selection brush padding.

Posted: Tue Jul 19, 2016 19:06
by frigopie
Hi,

I'm trying to add a padding to the selection brush in a Combobox. I have created a subclass of ListboxTextItem for creating my custom items. In the constructor of this subclass I am appending the string "[padding='l:5 t:3 r:0 b:3']" to create the required padding, but then, when an item is selected, the combobox selection is showing the formatting tag (it looks perfect in the drop down list) as text.
I have tried to increase the size of 'targetRect' in the ListboxTextItem::draw method but it's adding the padding outside the selection brush, and not looking ok.
How can I accomplish what I want?

CEGUI vesion: 0.7.5

Thanks for your help.

Re: ListboxItemText selection brush padding.

Posted: Tue Jul 19, 2016 19:39
by YaronCT
Cegui 0.7? Gosh, I wasn't even born then.. Let me c what I can do.

Re: ListboxItemText selection brush padding.

Posted: Thu Jul 21, 2016 10:03
by YaronCT
@frigopie: In "FalagardEditbox::renderTextNoBidi" search for "hlarea" - it defines the area of the highlight. Try to play with it as u wish. If it works, we'll perhaps add a property that controls its padding.