Changing Fonts and Color Palette w/ ControlP5 + Changing Font and Padding of ScrollableList items

edited July 2016 in Library Questions

I'm trying to implement controlp5 system-wide for the latest OpenBCI GUI

I'm having a lot of trouble changing the default font, color, and styling of all controller elements to match our design aesthetic. It would be great if there was a function (or series of functions) to do it from the cp5 object.

After extensive tinkering/tweaking, I've managed to update the colors and even the font.

However, now that I have updated the font I am unable to change the padding top of the items of a ScrollableList. The top "captionLabel" is not a problem, but the text in the list items float to the top of the bars that they are inside of. Any suggestions? See photo below:

Screen Shot 2016-07-23 at 3.08.51 PM

I tried looping through the items and grabbing the captionLabels one at a time, but it didn't work.

Here's the code that allowed me to change the primary captionLabel:

cp5_GUI.getController("Max Freq.") .getCaptionLabel() //.setFont(controlFonts[0]) //.setSize(12) .getStyle() .setPaddingTop(4) ;

Here's what I attempted, in trying to change the captionLabels of the list items" (w/ no success)

println(i); println(cp5_GUI.get(ScrollableList.class, "Max Freq.").getItem(i)); //cp5_GUI.get(ScrollableList.class, "Max Freq.").getItem(i).get("captionlabel").getStyle().setPaddingTop(4); //Map myMap = cp5_GUI.get(ScrollableList.class, "Max Freq.").getItem("captionLabel"); println(cp5_GUI.get(ScrollableList.class, "Max Freq.").getItem("captionLabel")); println(cp5_GUI.get(ScrollableList.class, "Max Freq.").getItem(i).get("captionLabel")); //cp5_GUI.get(ScrollableList.class, "Max Freq.").getController("20 Hz").

Any thoughts?

-Conor

Sign In or Register to comment.