What's the best way to skin/theme Juice apps?


#1

I see from looking at the source that Juice supports skinning. I’m not clear however on whats the best way to just overide the current bitmap appearance of the default look and field, without modifying the hit-test areas? Is it as simple as replacing some bitmaps?


#2

I’m not sure what you mean by not modifying the hit-test areas, but generally what you do is subclass the LookAndFeel class, and override the method(s) that you’re interested in. When you’re done, you just call the static method LookAndFeel::setDefaultLookAndFeel() with a pointer to your new LookAndFeel class, to set it as the default for your application.

For example, to change the close button in DialogWindows, you’d subclass LookAndFeel, and override the createDialogBoxCloseButton() method, so that it returns a pointer to your button (an interesting(?) point I just realised here is that you don’t have to make it an ImageButton…) rather than the standard JUCE one.

You can also set the LookAndFeel for individual Components, by calling their setLookAndFeel() method.

I’d point you to my Pedal Board program as an example, but my site’s just exceeded it’s bandwidth :frowning: (I need to do something about that…).

  • Niall.

#3

Ok, I tried out your app but for some reason resizing and maximizing the window was utterly slow, as in it took 3-4 seconds to redraw everything. Is this a result of having overridden the L&F? Or is it something else?


#4

3-4 seconds? That’s a lot longer than it takes on my machine - it still noticeably lags when you drag the Resizer component, but not as much as Tracktion 2 does, for example. I was under the impression the slowness was just because of all the graphics operations involved in resizing the window - I don’t think it’s anything to do with overriding the LookAndFeel for one Component (especially one that’s not on screen most of the time, since the main window isn’t a DialogWindow).

  • Niall.

#5

Well to put this in perspective, I do not have this problem with the JUCE Demo app. Its specific to your app. My machine is pretty poweful as well.


#6

Again, I’d point out that my main window is not a DialogWindow (you’ll notice the JUCE demo app is) - are you actually experiencing slowdown when you resize the editor window for a plugin that does not provide it’s own gui? That would be a DialogWindow, and I don’t get any slowdown for that.

  • Niall.

#7