Customizing combo boxes - how?
-
@Christoph-Hart I love these moments!
-
-
@Christoph-Hart awesome, thanks so much!
-
It's super awesome, but the only thing I can't get to work properly on this window is the font of the main text - it works fine on the headers. It works for fonts that are installed in the system like the mighty Comic Sans, but when I want to load a custom font from the images folder it doesn't work:
obj.font = "MyFont";
I've loaded the font previously with:
Engine.loadFontAs("{PROJECT_FOLDER}Fonts/MyFont.ttf", "MyFont"); Engine.setGlobalFont("MyFont");
Should I add it somehow else so that the obj.font can see it? It doesn’t work with the laf global font class either.
And one more thing - if I got rid of the icons, how can I center text to the center of the box?
-
-
It would also be amazing to be able to specify the height of the menu items to customize the vertical spacing between items! Or is it possible already?
-
This post is deleted! -
Hey @Christoph-Hart, I noticed you added the fix to the font problem in the latest version, thank you!
In case anyone else was wondering about the height of the right-click popups and menu items, look at line 242 in HI_LookAndFeels.h file. You can change the height multiplier there.
-
The last question is - how to center the text box of the alert window if there's no icon? I guess it should be doable in one of the .cpp files but I'd really appreciate some direction as to where to look for it :-)
-
I've changed it so that if you want to not use any icon at all, just set the
obj.type
property to-1
in the script lookandfeelcreateIcon()
method -
Ok, I'm a little lost. Should I call it in the script editor or modify some file?
-
@tomekslesicki Some examples are in the link posted. Have you checked those out yet?
https://docs.hise.audio/glossary/custom_lookandfeel.html#alert-windows -
Yeah, I tried:
laf.registerFunction("drawAlertWindowIcon", function(g, obj) { obj.type = -1; });
But it doesn't work unfortunately.
-
Have you pulled the latest version? I‘ve added this just now.
-
Yeah, my bad, didn't download both updated files... Sorry for that. It's kind of close now, but not there yet, I think?
I'd like the margins on both sides (left & right) to be the same. With the icon previously it was offset to the right. Now it's to the left.
-
I can experiment with this myself, just tell me where to look for it in the source files.
-
Search for MessageWithIcon ;)
-
If anybody would like to change that, too, please, look at line 2904 in PresetHandler.cpp file:
b.removeFromLeft(img.getWidth() - X);
The X bit should be a number, it offsets the text to the right by the amount of pixels you specify.