@@ -325,17 +325,30 @@ RecordToggleButton::~RecordToggleButton() {}
325325
326326void RecordToggleButton::paintButton (Graphics& g, bool isMouseOver, bool isButtonDown)
327327{
328- g.setColour (Colour (0 , 0 , 0 ));
329- g.fillRoundedRectangle (0 , 0 , getWidth (), getHeight (), 0.2 * getWidth ());
328+
329+ float alpha = 1 .0f ;
330+
331+ if (!isEnabled ())
332+ {
333+ alpha = 0 .5f ;
334+ }
335+
336+ g.setColour (Colour (0 , 0 , 0 ).withAlpha (alpha));
337+ g.fillRoundedRectangle (0 , 0 , getWidth (), getHeight (), 4 );
330338
331339 if (! getToggleState ())
332- g.setColour (findColour (ThemeColours::widgetBackground));
340+ {
341+ g.setColour (findColour (ThemeColours::widgetBackground).withAlpha (alpha));
342+ }
333343 else
334- g.setColour (Colour (255 , 0 , 0 ));
344+ {
345+ g.setColour (Colour (255 , 0 , 0 ).withAlpha (alpha));
346+ }
347+
335348
336- g.fillRoundedRectangle (1 , 1 , getWidth () - 2 , getHeight () - 2 , 0.2 * getWidth () );
349+ g.fillRoundedRectangle (1 , 1 , getWidth () - 2 , getHeight () - 2 , 3 );
337350
338- g.setColour (Colour (0 , 0 , 0 ));
351+ g.setColour (Colour (0 , 0 , 0 ). withAlpha (alpha) );
339352 g.fillEllipse (0.35 * getWidth (), 0.35 * getHeight (), 0.3 * getWidth (), 0.3 * getHeight ());
340353}
341354
0 commit comments