ComboBox - no selection colour
-
when a combobox doesn't have any selection / value it will display it's text content with a darkened version of the text colour. Is there a way to turn this off / display the actual text colour?
-
@DanH laf
-
@d-healey how?
-
const laf = Engine.createGlobalScriptLookAndFeel(); laf.registerFunction("drawComboBox", function(g, obj) { }); laf.registerFunction("drawPopupMenuItem", function(g, obj) { });
-
@d-healey yep got lots of that going on, ok so maybe if value == 0 or something?
-
@DanH oh it was already in there
expcblaf.registerFunction("drawComboBox", function(g, obj) { var a = obj.area; g.setColour(obj.itemColour1); g.fillRoundedRectangle(a, 2); g.setColour(Colours.withAlpha(obj.textColour, (obj.enabled && obj.active) ? 1.0 : 1.0)); // here ; g.setFont("Lucida Console", 13.0); g.drawAlignedText(obj.text, [a[0] + 10, a[1], a[2]-10, a[3]], "left"); });
-
@d-healey ok how about changing the colour of the combobox text / combobox when hovering? I'm trying to squeeze in
if (obj.over) g.setColour(0xFFE3E3E3);
but it doesn't do anything
-
@DanH
Console.print(trace(obj));
-
-
@DanH You need use
obj.hover
notobj.over
-
@d-healey oh right, ha, I get it now, all working, cheers