LAF Preset Browser glitches when expansion is changed.
-
Hi, I'm trying to make a custom preset browser with LAF, But there are some kind of visual problems when I change the expansion. What can cause this? Is there a way to prevent this? Because it is useless like this.
-
@mehmethand Difficult to say without knowing what you're doing.
-
@d-healey I'm just using Preset Browser LAF which I copied from HISE documentation. I just changed colors. Default Preset Browser is working just fine. But the custom one has visual problems.
laf.registerFunction("drawPresetBrowserBackground", function(g, obj) { g.fillAll(noColour); }); laf.registerFunction("drawPresetBrowserSearchBar", function(g, obj) { }); laf.registerFunction("drawPresetBrowserColumnBackground", function(g, obj) { g.setColour(presetOnColour); g.drawRoundedRectangle(obj.area, 4,1); }); laf.registerFunction("drawPresetBrowserListItem", function(g, obj) { g.setFont("Font1",18); g.setColour(presetOffColour); g.drawAlignedText(" "+ obj.text, obj.area, "left"); if(obj.selected) { g.setFont("Font1 Bold",18); g.setColour(presetOffColour); g.fillRoundedRectangle(obj.area,4); g.setColour(presetOnColour); g.drawAlignedText(" " + obj.text, obj.area, "left"); } }); inline function removeFromTop(area, amountToRemove) { local a = [area[0], area[1], area[2], amountToRemove]; area[1] += amountToRemove; area[2] -= amountToRemove; return a; } laf.registerFunction("drawPresetBrowserDialog", function(g, obj) { g.fillAll(noColour); g.setColour(preP21); g.fillRoundedRectangle(obj.area, 4.0); g.setColour(presetOnColour); g.fillRoundedRectangle(obj.labelArea, 4.0); g.setColour(presetOffColour); g.setFont("Font1 Bold",22); g.drawAlignedText(obj.text, removeFromTop(obj.area, 50), "centred"); }); laf.registerFunction("drawDialogButton", function(g, obj) { if (obj.value) { g.setColour(myWhite); g.fillRoundedRectangle(obj.area,4); g.setColour(myBlack); g.drawAlignedText(obj.text,obj.area,"centred"); } if (obj.value==0) { g.setColour(presetOffColour); g.fillRoundedRectangle(obj.area,4); g.setColour(presetOnColour); g.drawAlignedText(obj.text,obj.area,"centred"); } if (obj.value==0 && obj.over) { g.setColour(presetOnColour); g.drawRoundedRectangle(obj.area,4,2); } });
-
@mehmethand Can you include the colours you're using in your code? Then I can make a test project.
-
@d-healey
```
global presetOffColour=0xFFc6c6c6;
global presetOnColour=0xFF202020;
global noColour=0xFF000000;
global myWhite=0xFFc6c6c6;
global myBlack=0xFF202020; -
@mehmethand Are you using global or local laf?
-
I can't recreate the issue here. Let me know if you see it with this example.
HiseSnippet 1500.3ocsX0saaaCEVxMpnxcCcEXO.D9hBGTWCY2zthUjsZmDWDrlTi3rtADDTvHQayEJRCJ5jXTj61CvtduE6YYuH6tcY2gjxV9GYWGCLY.awye76b3gGdnaKEgjjDgzw0+zQCHNtekWmQbU+85iobmC22w89dJRhxo4nA3jDRjiq68dqlmq+VNlm+4GahYXdHIijiyGDzPx6nwTUF01u4mnLVKbD4TZ7TRuyaNLTv2SvDCAbbOu.mA3vKw8HGi0hUvC.wAQTkP1QgAv.xzTDMpSew0bq7eflPufQzCp4zALjkryd8orn1i8wDGG2sZm4w2y5weq2QzH5D5Yd92XXfxzX5XfagUAoZ2AH4NEj1xBoG60ITRGnx3nwyC8NjqHxtXHTOMTrx5T3uef2dBPBtpZL9RRKILXhFkeYPPED701utXQHbmnPLbWztnC38nbR0PIAbj2xDWfYVC9Ng3xF7nVDBqrVodFdnARRBQ89tcsKX6FbSqVguT+40yIBeJIpGn+LQBtXJdAlmI7hG8K8oJRdFNdTSFjZLiEKBtQUIoGMA7zVC4gJpfWtTjDecaCNZJEWmPjMAE6IEC4Qkpf5NVtdUPhK9ssK9ohH3oW0tPFZCFq7X.BN9sau9SRGBVF1uIVl+bbmrE.fgw70C1fVV7Vd1XOLcVAzV+DsUHQmPBUXdOFoLXhpXXcuBZmJ0tid56.ANTQhyGU9E8MfpEjBVtj96ZkpT6UZ66mCZGmLA78sXsAi1iShNkbCnOBU5oZKWUACMyQJrKwHcUkzZYbSZWiKkPXfKRh11P7SFd9n4wCpofEkBJT5ypgVlT5rjkGM2Y0VjmiAyykQeAeVq4snzbJJmA6hmrTfjjXwU5R.wmJFT1pINFfr5TwIFdiSdXhPXmEFpDblVryBNGjT+Rsw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z4+fbF8Wj
-
@d-healey I tried both global and local laf. This snippet is working fine on my system. I don't know what I messed up in my project.
-
@mehmethand It must be something that is set to saveInPreset that is causing the issue since it only triggers when the preset is changed.
-
@d-healey ok I found the solution. I deleted HISE and rebuild it again now everything is working fine. So I learned something more. When things go weird, rebuild HISE again.