The core of the way the theming works in how images are drawn. Here's an example that's used for each row of the quick panel (i.e., Goto Anything):
- Code: Select all
"layer0.texture": "Theme - Default/quick_panel_row.png",
"layer0.inner_margin": [0, 0, 0, 3],
The inner_margin specifies 4 values: left, top, right, bottom. It specifies how the image is stretched over the control area. If all the values are 0, then the imaged is simply scaled to the size of the control and drawn.
Most images have some sort of border area, which shouldn't be stretched, and a center area, which should be. The inner_margin specifies the size of this border area. In the case of quick_panel_row.png, it's a simple flat image with a 2px border at the bottom. The inner_margin specifies that the bottom 3 pixels of the image shouldn't be scaled, but the rest can be.
The draw_center flag is an optimisation. The inner_margin setting divides the image up into 9 areas: 4 corners, 4 edges, and a center portion. If the center portion doesn't need to be drawn (in the case of the quick panel, the center portion is the same color as the background, and so doesn't need to be drawn), then draw_center can be set to false.
fatalentity: the "sidebar_heading" class can be used to change the appearance of "FOLDERS" etc.