# Help with LookAndFeel

**URL:** <https://forum.juce.com/t/help-with-lookandfeel/7121>\
**Category:** General JUCE discussion\
**Created:** [July 4, 2011, 5:29pm UTC](https://forum.juce.com/t/help-with-lookandfeel/7121 "2011-07-04T17:29:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hanley](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/hanley/32/3911_2.png) [@hanley](https://forum.juce.com/u/hanley)\
**Post date:** [July 4, 2011, 5:29pm UTC](https://forum.juce.com/t/help-with-lookandfeel/7121/1 "2011-07-04T17:29:48Z")

</div>

OK. I want to make custom rotary sliders and buttons. I’ve searched through the forums, looked at example projects, and looked at the documentation. I understand that the LookAndFeel class will enable me to do this. I just have no idea how to do it. Can anyone walk me through this? Assume I know nothing, and feel free to talk to me like I’m a five year old, because right now, that’s exactly how I feel. 🙂

---

<div class="post-metadata">

**Author:** ![andrewj](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/andrewj/32/13428_2.png) [@andrewj](https://forum.juce.com/u/andrewj)\
**Post date:** [July 4, 2011, 9:59pm UTC](https://forum.juce.com/t/help-with-lookandfeel/7121/2 "2011-07-04T21:59:52Z")

</div>

+1 - this would be a good one for the wiki I think.

---

<div class="post-metadata">

**Author:** ![ckk](https://avatars.discourse-cdn.com/v4/letter/c/d26b3c/32.png) [@ckk](https://forum.juce.com/u/ckk)\
**Post date:** [July 5, 2011, 6:00am UTC](https://forum.juce.com/t/help-with-lookandfeel/7121/3 "2011-07-05T06:00:31Z")

</div>

A rotary slider will be drawn with LookAndFeel::drawRotarySlider().

My approach to this is to make a new class that inherits LookAndFeel, take the function I want to change (e.g. copy and paste from LookAndFeel for a start), hope there are no calls to private member functions (which is mainly drawShinyButtonShape() in LookAndFeel) and modify it to my likings.  
Not sure if this is the way Jules intended, but it seemed to work for me.

Of course you need to create an object of your LookAndFeel class and set it with setLookAndFeel()/LookAndFeel::setDefaultLookAndFeel().

Not tested, but it might look like this:

```auto
class MyLookAndFeel : public LookAndFeel
{
void drawRotarySlider (Graphics& g,
                                    int x, int y,
                                    int width, int height,
                                    float sliderPos,
                                    const float rotaryStartAngle,
                                    const float rotaryEndAngle,
                                    Slider& slider)
  {
  // Not usefull but it certainly looks different than the Juce rotary sliders
    g.fillAll(slider.findColour (Slider::rotarySliderFillColourId).withAlpha (sliderPos));
  }
};

class MyClass : public Component
{
public:
  MyClass()
  {
    addAndMakeVisible(&slider);
    slider.setSliderStyle(Slider::RotaryHorizontalDrag);
    setLookAnFeel(&myLookAndFeel);
  }
  void resized()
  {
    slider.setBounds(0,0,getWidth(), getHeight());
  }

private:
  Slider slider;
  MyLookAndFeel myLookAndFeel;
};

```

Chris

---

<div class="post-metadata">

**Author:** ![hanley](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/hanley/32/3911_2.png) [@hanley](https://forum.juce.com/u/hanley)\
**Post date:** [July 11, 2011, 2:18pm UTC](https://forum.juce.com/t/help-with-lookandfeel/7121/4 "2011-07-11T14:18:39Z")

</div>

Thanks Chris! (Sorry for the late reply.) I’ll give that a go.
