I have a small issue, but I think it’s still worth mentioning.
The ComboBox class seems to be missing a colour ID for its outline when in focused state.
Other components do offer it, like for example TextEditor::focusedOutlineColourId, but in ComboBox I can only specify the outline colour while not in focus via ComboBox::outlineColourId.
So in the screenshot below, I have set the regular outline to black, but I have no way to change the gray outline shown when I open the ComboBox.
I know I can just subclass it and override the paint method, but this just seems like something that was overseen or forgotten
I was just looking for the same thing and stumbled on this post.
In the end - I have a look and feel class already so I wanted to override the ComboBox pain method, but when I looked at it - it turned out that “ComboBox::ColourIds::buttonColourId” is used to draw that outline when focused.
So I just changed that colour though, but this is unclear and confusing. The documentation states “Base colour for the button”. Not clear what button is referred to here. I assume it is a button that represents one list item or just the one that triggers the drop down, but it would be much better if we could call this focusedOutlineColourId.
Hi, I’m kind new in JUCE. Can you please let me know how did you set the background colour for the item in combobox. I have been looking but I am pretty stuck. Thanks in advance
Depends on which part you want to modify. The box’s background color itself uses ComboBox::backgroundColourId; look at the code for LookAndFeel_V4::drawComboBox to see what’s going on. The dropdown list uses PopupMenu::backgroundColourId (comboboxes just use a popup menu to display the list).
Thanks for adding that in more than 2 years ago! However, at least Juce 5.3.2’s LookAndFeel_V4::drawComboBox doesn’t pick it up… It has hard-coded ComboBox::outlineColourId in there for the border. I don’t know if this is already fixed in a later version, but see it as a heads up.