Font not changing on comboBox. What am I doing wrong?
-
I can't get the font to change from the default font for the comboBox:

I must be missing something obvious.
-
@VirtualVirgin That should work unless you have some kind of LAF interfering.
-
@VirtualVirgin I think it's broken, I always use laf.
-
@d-healey said in Font not changing on comboBox. What am I doing wrong?:
@VirtualVirgin I think it's broken, I always use laf.
Thanks :)
-
@d-healey Good to know! I LAF everything so I didnt notice this was even broken.
-
Just digging this up because I came across the issue again. Definitely needs a bug report.
Also found this bit of history where combo box fonts were first implemented: https://forum.hise.audio/topic/548/changing-combobox-font
-
@David-Healey Fixed here: https://github.com/christophhart/HISE/pull/838
The line that applies the LAF to the combo box was commented out. Might be a good reason for that, but this change does fix the bug as reported.
UPDATE: just checked if script LAF can still override the Interface Designer settings and it can, so this fix seems OK.
-
@dannytaurus Hmm it's from this commit. I wonder if he was just testing something and forgot to uncomment it.
-
@David-Healey Maybe, yeah.
-
@dannytaurus fontSize doesn't affect the popup items.
-
Something else interesting. I modified the
drawComboBoxlaf function to include the font.Font font = getComboBoxFont(cb); obj->setProperty("fontName", font.getTypefaceName()); obj->setProperty("fontSize", font.getHeight());The font size is returned correctly but the fontName is always
lato -
@David-Healey said in Font not changing on comboBox. What am I doing wrong?:
@dannytaurus fontSize doesn't affect the popup items.
Seems like font size for items works up to a max size.

-
Ah, it relates to item height, which is set from combo box height.

-
@dannytaurus I'm getting a crash when I load my project - it's a big project - going to try and see what the cause is.
-
@David-Healey So looks like item font size is set to combo box height / 1.3
-
@David-Healey said in Font not changing on comboBox. What am I doing wrong?:
@dannytaurus I'm getting a crash when I load my project - it's a big project - going to try and see what the cause is.
Seems to be one of those crashes that magically resolves itself after restarting HISE a few times...
Still not sure why the font isn't correct in laf. I guess
getComboBoxFontdoesn't pick up the selected font. -
@David-Healey
Which file are you adding this to?Font font = getComboBoxFont(cb); obj->setProperty("fontName", font.getTypefaceName()); obj->setProperty("fontSize", font.getHeight());The font size is returned correctly but the fontName is always
lato -
@dannytaurus
ScriptingGraphics.cppinScriptingObjects::ScriptedLookAndFeel::Laf::drawComboBox() -
@David-Healey Looks like
Font font = getComboBoxFont(cb);might return the global font.// hi_tools/hi_tools/HI_LookAndFeels.cpp Font AlertWindowLookAndFeel::getComboBoxFont(ComboBox& comboBox) { return GLOBAL_FONT(); }There are quite a few definitions of
getComboBoxFontand I don't which is which. -
@dannytaurus Ah yeah that would make sense. I wonder where HISE stores the actual selection from the property editor.