Viewport Styling Methods?
-
Hey!
I'm wondering what the best way to style a viewport is nowadays. I saw CSS functionality, but I don't think I'll be able to utilize CSS until there's a way to draw objects within components. I know you can put a panel inside a viewport and style it that way, is that still the way to go for customization, or are there dedicated LAF functions implemented. I found some drawtable methods that seem to go with the viewport, but I cant get them to do anything that styles a viewport.
Thanks!
-
@Casmat I use a panel, and laf for the scrollbar. I think the laf functions for viewports are for when it's in table mode (but I could be wrong).
-
@d-healey Ah ok! Thanks a lot!
-
@d-healey One question, should you use just one panel in the viewport or generate a new panel for each list item you have in the viewport?
In my case, I'm working on a custom preset browser and will have multiple laf elements inside each viewport plus mouse callbacks for hover and click, what do you recommend?
Option 1: Use one panel and using row height + for loop, you draw elements within that panel. However, I'd need to make this parent panel on All Callbacks to get mouse position if I want to have a hover/click effect for each list item.
Option 2: Generate a panel per list item and enable Click + Hover callbacks and do hover/click effects like a normal panel.
Thanks!
-
@Casmat said in Viewport Styling Methods?:
One question, should you use just one panel in the viewport or generate a new panel for each list item you have in the viewport?
If it's a simple list then one panel.
If each item in the list needs an interactive element then use child panels.