ComboBox dropdown text justification


#1

It appears that the ComboBox main label can be centre justified, maybe it would also be useful to allow justification of the dropdown text, unless this is possible already?


#2

Possible I think but probably a bit of a pain.  Jules can confirm, but I think ComboBox uses PopupMenu for rendering the menu. There's a look and feel class in PopupMenu. 

PopupMenu::LookAndFeelMethods::drawPopupMenuItem

It takes a bunch of parameters but none of them are justification. 

So you need to knock up a LookAndFeel class containing an implementation of drawPopupMenuItem that centres the text.  Just copy the code from the LookAndFeel_Vx or other class you are currently using and tweak. 

Then add that LookAndFeel to your ComboBox. 

 


#3

Yeah, there's no easy way to set that at the moment except to just override the whole look+feel and draw the items yourself.