The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
4.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 7 End-User License
  8. Agreement and JUCE Privacy Policy.
  9. End User License Agreement: www.juce.com/juce-7-licence
  10. Privacy Policy: www.juce.com/juce-privacy-policy
  11. Or: You may also use this code under the terms of the GPL v3 (see
  12. www.gnu.org/licenses).
  13. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  14. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  15. DISCLAIMED.
  16. ==============================================================================
  17. */
  18. #pragma once
  19. //==============================================================================
  20. class ProjucerLookAndFeel : public LookAndFeel_V4
  21. {
  22. public:
  23. ProjucerLookAndFeel();
  24. ~ProjucerLookAndFeel() override;
  25. void drawTabButton (TabBarButton& button, Graphics&, bool isMouseOver, bool isMouseDown) override;
  26. int getTabButtonBestWidth (TabBarButton&, int tabDepth) override;
  27. void drawTabAreaBehindFrontButton (TabbedButtonBar&, Graphics&, int, int) override {}
  28. void drawPropertyComponentBackground (Graphics&, int, int, PropertyComponent&) override {}
  29. void drawPropertyComponentLabel (Graphics&, int width, int height, PropertyComponent&) override;
  30. Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override;
  31. void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
  32. bool isMouseOverButton, bool isButtonDown) override;
  33. void drawButtonText (Graphics&, TextButton&, bool isMouseOverButton, bool isButtonDown) override;
  34. void drawToggleButton (Graphics&, ToggleButton&, bool isMouseOverButton, bool isButtonDown) override;
  35. void drawTextEditorOutline (Graphics&, int, int, TextEditor&) override {}
  36. void fillTextEditorBackground (Graphics&, int width, int height, TextEditor&) override;
  37. void layoutFileBrowserComponent (FileBrowserComponent&, DirectoryContentsDisplayComponent*,
  38. FilePreviewComponent*, ComboBox* currentPathBox,
  39. TextEditor* filenameBox,Button* goUpButton) override;
  40. void drawFileBrowserRow (Graphics&, int width, int height, const File&, const String& filename, Image* icon,
  41. const String& fileSizeDescription, const String& fileTimeDescription,
  42. bool isDirectory, bool isItemSelected, int itemIndex, DirectoryContentsDisplayComponent&) override;
  43. void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) override;
  44. void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
  45. void drawMenuBarItem (Graphics&, int width, int height,
  46. int itemIndex, const String& itemText,
  47. bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar,
  48. MenuBarComponent&) override;
  49. void drawResizableFrame (Graphics&, int w, int h, const BorderSize<int>&) override;
  50. void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
  51. int buttonX, int buttonY, int buttonW, int buttonH,
  52. ComboBox&) override;
  53. void drawTreeviewPlusMinusBox (Graphics&, const Rectangle<float>& area,
  54. Colour backgroundColour, bool isItemOpen, bool isMouseOver) override;
  55. ProgressBar::Style getDefaultProgressBarStyle (const ProgressBar&) override;
  56. //==============================================================================
  57. static Path getArrowPath (Rectangle<float> arrowZone, int direction,
  58. bool filled, Justification justification);
  59. static Path getChoiceComponentArrowPath (Rectangle<float> arrowZone);
  60. static Font getPropertyComponentFont() { return { 14.0f, Font::FontStyleFlags::bold }; }
  61. static int getTextWidthForPropertyComponent (const PropertyComponent& pc) { return jmin (200, pc.getWidth() / 2); }
  62. static ColourScheme getProjucerDarkColourScheme()
  63. {
  64. return { 0xff323e44, 0xff263238, 0xff323e44,
  65. 0xff8e989b, 0xffffffff, 0xffa45c94,
  66. 0xffffffff, 0xff181f22, 0xffffffff };
  67. }
  68. //==============================================================================
  69. void setupColours();
  70. private:
  71. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjucerLookAndFeel)
  72. };