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.

107 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. namespace juce
  20. {
  21. //==============================================================================
  22. /**
  23. The original JUCE look-and-feel, as used back from 2002 to about 2007ish.
  24. @see LookAndFeel, LookAndFeel_V2, LookAndFeel_V3
  25. @tags{GUI}
  26. */
  27. class JUCE_API LookAndFeel_V1 : public LookAndFeel_V2
  28. {
  29. public:
  30. LookAndFeel_V1();
  31. ~LookAndFeel_V1();
  32. //==============================================================================
  33. void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
  34. bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
  35. void drawToggleButton (Graphics&, ToggleButton&,
  36. bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
  37. void drawTickBox (Graphics&, Component&, float x, float y, float w, float h,
  38. bool ticked, bool isEnabled,
  39. bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
  40. void drawProgressBar (Graphics&, ProgressBar&, int width, int height,
  41. double progress, const String& textToShow) override;
  42. //==============================================================================
  43. void drawScrollbarButton (Graphics&, ScrollBar&, int width, int height,
  44. int buttonDirection, bool isScrollbarVertical,
  45. bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
  46. void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height,
  47. bool isScrollbarVertical, int thumbStartPosition, int thumbSize,
  48. bool isMouseOver, bool isMouseDown) override;
  49. ImageEffectFilter* getScrollbarEffect() override;
  50. //==============================================================================
  51. void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
  52. //==============================================================================
  53. void drawPopupMenuBackground (Graphics&, int width, int height) override;
  54. void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
  55. //==============================================================================
  56. void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
  57. int buttonX, int buttonY, int buttonW, int buttonH, ComboBox&) override;
  58. Font getComboBoxFont (ComboBox&) override;
  59. //==============================================================================
  60. void drawLinearSlider (Graphics&, int x, int y, int width, int height,
  61. float sliderPos, float minSliderPos, float maxSliderPos,
  62. const Slider::SliderStyle, Slider&) override;
  63. int getSliderThumbRadius (Slider&) override;
  64. Button* createSliderButton (Slider&, bool isIncrement) override;
  65. ImageEffectFilter* getSliderEffect (Slider&) override;
  66. //==============================================================================
  67. void drawCornerResizer (Graphics&, int w, int h, bool isMouseOver, bool isMouseDragging) override;
  68. Button* createDocumentWindowButton (int buttonType) override;
  69. void positionDocumentWindowButtons (DocumentWindow&,
  70. int titleBarX, int titleBarY, int titleBarW, int titleBarH,
  71. Button* minimiseButton, Button* maximiseButton, Button* closeButton,
  72. bool positionTitleBarButtonsOnLeft) override;
  73. private:
  74. DropShadowEffect scrollbarShadow;
  75. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LookAndFeel_V1)
  76. };
  77. } // namespace juce