From 470d958ba51146d3ac3110f9cc57b0cb936d70d4 Mon Sep 17 00:00:00 2001 From: Anjal Doshi Date: Wed, 2 Oct 2024 11:58:42 -0700 Subject: [PATCH] Update window titlebar button colors --- Source/UI/LookAndFeel/CustomLookAndFeel.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/Source/UI/LookAndFeel/CustomLookAndFeel.cpp b/Source/UI/LookAndFeel/CustomLookAndFeel.cpp index 59e7e12d5..144e236ea 100644 --- a/Source/UI/LookAndFeel/CustomLookAndFeel.cpp +++ b/Source/UI/LookAndFeel/CustomLookAndFeel.cpp @@ -216,7 +216,7 @@ void CustomLookAndFeel::setTheme (ColourTheme theme) setColour (ResizableWindow::backgroundColourId, currentThemeColours[ThemeColours::componentBackground]); - setColour (DocumentWindow::textColourId, currentThemeColours[ThemeColours::defaultText]); + setColour (DocumentWindow::textColourId, currentThemeColours[ThemeColours::controlPanelText]); setColour (AlertWindow::backgroundColourId, currentThemeColours[ThemeColours::componentBackground]); setColour (AlertWindow::textColourId, currentThemeColours[ThemeColours::defaultText]); @@ -950,7 +950,7 @@ class CustomDocumentWindowButton : public Button void paintButton (Graphics& g, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override { - auto background = findColour (ThemeColours::widgetBackground); + auto pathColour = findColour (ThemeColours::controlPanelText); // g.fillAll (background); @@ -960,7 +960,6 @@ class CustomDocumentWindowButton : public Button if (shouldDrawButtonAsHighlighted) { g.fillAll(); - g.setColour (background); } auto& p = getToggleState() ? toggledShape : normalShape; @@ -970,6 +969,7 @@ class CustomDocumentWindowButton : public Button .toFloat() .reduced ((float) getHeight() * 0.3f); + g.setColour (pathColour); g.fillPath (p, p.getTransformToScaleToFit (reducedRect, true)); } @@ -990,14 +990,14 @@ Button* CustomLookAndFeel::createDocumentWindowButton (int buttonType) shape.addLineSegment ({ 0.0f, 0.0f, 1.0f, 1.0f }, crossThickness); shape.addLineSegment ({ 1.0f, 0.0f, 0.0f, 1.0f }, crossThickness); - return new CustomDocumentWindowButton ("close", Colour (0xff9A131D), shape, shape); + return new CustomDocumentWindowButton ("close", Colour (0xffc42b1c), shape, shape); } if (buttonType == DocumentWindow::minimiseButton) { shape.addLineSegment ({ 0.0f, 0.5f, 1.0f, 0.5f }, crossThickness); - return new CustomDocumentWindowButton ("minimise", Colour (0xffaa8811), shape, shape); + return new CustomDocumentWindowButton ("minimise", findColour (ThemeColours::defaultFill), shape, shape); } if (buttonType == DocumentWindow::maximiseButton) @@ -1014,7 +1014,7 @@ Button* CustomLookAndFeel::createDocumentWindowButton (int buttonType) fullscreenShape.addRectangle (45.0f, 45.0f, 100.0f, 100.0f); PathStrokeType (30.0f).createStrokedPath (fullscreenShape, fullscreenShape); - return new CustomDocumentWindowButton ("maximise", Colour (0xff0A830A), shape, fullscreenShape); + return new CustomDocumentWindowButton ("maximise", findColour (ThemeColours::defaultFill), shape, fullscreenShape); } jassertfalse; @@ -1103,6 +1103,7 @@ void CustomLookAndFeel::drawDocumentWindowTitleBar (DocumentWindow& window, Grap else g.setColour (Colours::whitesmoke); + g.setOpacity (isActive ? 1.0f : 0.6f); g.drawText (window.getName(), textX, 0, textW, h, Justification::centredLeft, true); }