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.

94 lines
4.6KB

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