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.

91 lines
4.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - ROLI Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #pragma once
  18. //==============================================================================
  19. class ProjucerLookAndFeel : public LookAndFeel_V4
  20. {
  21. public:
  22. ProjucerLookAndFeel();
  23. void drawTabButton (TabBarButton& button, Graphics&, bool isMouseOver, bool isMouseDown) override;
  24. int getTabButtonBestWidth (TabBarButton&, int tabDepth) override;
  25. void drawTabAreaBehindFrontButton (TabbedButtonBar&, Graphics&, int, int) override {}
  26. void drawPropertyComponentBackground (Graphics&, int, int, PropertyComponent&) override {}
  27. void drawPropertyComponentLabel (Graphics&, int width, int height, PropertyComponent&) override;
  28. Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override;
  29. void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
  30. bool isMouseOverButton, bool isButtonDown) override;
  31. void drawButtonText (Graphics&, TextButton&, bool isMouseOverButton, bool isButtonDown) override;
  32. void drawToggleButton (Graphics&, ToggleButton&, bool isMouseOverButton, bool isButtonDown) override;
  33. Font getTextButtonFont (TextButton&, int buttonHeight) override;
  34. void drawTextEditorOutline (Graphics&, int, int, TextEditor&) override {}
  35. void fillTextEditorBackground (Graphics&, int width, int height, TextEditor&) override;
  36. void layoutFileBrowserComponent (FileBrowserComponent&, DirectoryContentsDisplayComponent*,
  37. FilePreviewComponent*, ComboBox* currentPathBox,
  38. TextEditor* filenameBox,Button* goUpButton) override;
  39. void drawFileBrowserRow (Graphics&, int width, int height, const String& filename, Image* icon,
  40. const String& fileSizeDescription, const String& fileTimeDescription,
  41. bool isDirectory, bool isItemSelected, int itemIndex, DirectoryContentsDisplayComponent&) override;
  42. void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) override;
  43. void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
  44. void drawMenuBarItem (Graphics&, int width, int height,
  45. int itemIndex, const String& itemText,
  46. bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar,
  47. MenuBarComponent&) override;
  48. void drawResizableFrame (Graphics&, int w, int h, const BorderSize<int>&) override;
  49. void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
  50. int buttonX, int buttonY, int buttonW, int buttonH,
  51. ComboBox&) override;
  52. void drawTreeviewPlusMinusBox (Graphics&, const Rectangle<float>& area,
  53. Colour backgroundColour, bool isItemOpen, bool isMouseOver) override;
  54. //==============================================================================
  55. static Path getArrowPath (Rectangle<float> arrowZone, const int direction,
  56. const bool filled, const Justification justification);
  57. static Path getChoiceComponentArrowPath (Rectangle<float> arrowZone);
  58. static Font getPropertyComponentFont() { return { 14.0f, Font::FontStyleFlags::bold }; }
  59. static int getTextWidthForPropertyComponent (PropertyComponent* pp) { return jmin (200, pp->getWidth() / 2); }
  60. //==============================================================================
  61. void setupColours();
  62. private:
  63. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ProjucerLookAndFeel)
  64. };