1 /*
2   ==============================================================================
3 
4    This file is part of the JUCE library.
5    Copyright (c) 2020 - Raw Material Software Limited
6 
7    JUCE is an open source library subject to commercial or open-source
8    licensing.
9 
10    By using JUCE, you agree to the terms of both the JUCE 6 End-User License
11    Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020).
12 
13    End User License Agreement: www.juce.com/juce-6-licence
14    Privacy Policy: www.juce.com/juce-privacy-policy
15 
16    Or: You may also use this code under the terms of the GPL v3 (see
17    www.gnu.org/licenses).
18 
19    JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20    EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21    DISCLAIMED.
22 
23   ==============================================================================
24 */
25 
26 namespace juce
27 {
28 
29 //==============================================================================
30 /**
31     The latest JUCE look-and-feel style, as introduced in 2013.
32     @see LookAndFeel, LookAndFeel_V1, LookAndFeel_V2
33 
34     @tags{GUI}
35 */
36 class JUCE_API  LookAndFeel_V3   : public LookAndFeel_V2
37 {
38 public:
39     LookAndFeel_V3();
40     ~LookAndFeel_V3() override;
41 
42     //==============================================================================
43     void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
44                                bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
45 
46     void drawTableHeaderBackground (Graphics&, TableHeaderComponent&) override;
47 
48     void drawTreeviewPlusMinusBox (Graphics&, const Rectangle<float>& area,
49                                    Colour backgroundColour, bool isOpen, bool isMouseOver) override;
50     bool areLinesDrawnForTreeView (TreeView&) override;
51     int getTreeViewIndentSize (TreeView&) override;
52 
53     Button* createDocumentWindowButton (int buttonType) override;
54 
55     void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
56                        int buttonX, int buttonY, int buttonW, int buttonH, ComboBox& box) override;
57 
58     void drawKeymapChangeButton (Graphics&, int width, int height, Button& button, const String& keyDescription) override;
59 
60     void drawPopupMenuBackground (Graphics&, int width, int height) override;
61     void drawMenuBarBackground (Graphics&, int width, int height, bool, MenuBarComponent&) override;
62 
63     int getTabButtonOverlap (int tabDepth) override;
64     int getTabButtonSpaceAroundImage() override;
65     void drawTabButton (TabBarButton&, Graphics&, bool isMouseOver, bool isMouseDown) override;
66     void drawTabAreaBehindFrontButton (TabbedButtonBar& bar, Graphics& g, int w, int h) override;
67 
68     void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
69 
70     void drawStretchableLayoutResizerBar (Graphics&, int w, int h, bool isVerticalBar, bool isMouseOver, bool isMouseDragging) override;
71 
72     bool areScrollbarButtonsVisible() override;
73 
74     void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height, bool isScrollbarVertical,
75                         int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override;
76 
77     void drawLinearSlider (Graphics&, int x, int y, int width, int height,
78                            float sliderPos, float minSliderPos, float maxSliderPos,
79                            const Slider::SliderStyle, Slider&) override;
80 
81     void drawLinearSliderBackground (Graphics&, int x, int y, int width, int height,
82                                      float sliderPos, float minSliderPos, float maxSliderPos,
83                                      const Slider::SliderStyle, Slider&) override;
84 
85     void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area, bool isMouseOver, bool isMouseDown,
86                                     ConcertinaPanel&, Component&) override;
87 
88     Path getTickShape (float height) override;
89     Path getCrossShape (float height) override;
90 
91     static void createTabTextLayout (const TabBarButton& button, float length, float depth, Colour colour, TextLayout&);
92 
93 private:
94     Image backgroundTexture;
95     Colour backgroundTextureBaseColour;
96 };
97 
98 } // namespace juce
99