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.

96 lines
4.7KB

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