-
@d-healey ah yes just seen in the docs too, thanks!
-
@d-healey so you're just using that? Mine goes blank, do you not have to specify colours, fonts etc?
-
@DanH Yes that's only a tiny bit of the code.
```
presetBrowser.registerFunction("drawPresetBrowserColumnBackground", function(g, obj)
{
var a = obj.area;
if (obj.text == "Add a Bank")
obj.text = "Select a Library";
if (obj.text == "Select a Column")
obj.text = "Select a Category";
if (a[2] > 300 && obj.text != "")
obj.text = "No Results";
g.setColour(style.presetBrowser.columnBg);
g.fillRoundedRectangle([a[0], a[1], a[2], a[3]], 10);
g.setColour(obj.textColour);
g.setFont("bold", 20);
g.drawAlignedText(obj.text, a, "centred");
});
```
-
@d-healey perfect, thanks!
-
@d-healey can width of the rectangle be written in % of the maximum length? For being responsive?
```
//colour accent
g.setColour(0x99ED3237);
g.fillRoundedRectangle([a[0], a[1], a[2] - 100, a[3]], {CornerSize: 2, Rounded:[1, 0, 1, 0]});
}
```
100 in this example
-
@Straticah Sure, just multiply a[2] by 0.5 for 50%, or 0.75 for 75%, etc.
-
@d-healey this finally fixed my issue the accent is now the same size on each tab, independent of tab length :) ty for your help. I have learned a lot in only a week.
-
@Straticah snippet! 😂
-
@DanH haha i have too much going on in my project to share, maybe this will help? :)
```
//color preset select
if(obj.selected)
{
g.setColour(0x99521F22);
g.fillRoundedRectangle(obj.area, 3.0);
//red accent
g.setColour(0x99ED3237);
g.fillRoundedRectangle([a[0], a[1], a[2] / 1000 + 3, a[3]], {CornerSize: 2, Rounded:[1, 0, 1, 0]});
}
```
did you mean that?
-
@Straticah yes, thanks!