LMMS
Loading...
Searching...
No Matches
juce_LookAndFeel_V4.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - 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 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-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
26namespace juce
27{
28
29//==============================================================================
37{
38public:
43 {
44 public:
60
61 template <typename... ItemColours>
62 ColourScheme (ItemColours... coloursToUse)
63 {
64 static_assert (sizeof... (coloursToUse) == numColours, "Must supply one colour for each UIColour item");
65 const Colour c[] = { Colour (coloursToUse)... };
66
67 for (int i = 0; i < numColours; ++i)
68 palette[i] = c[i];
69 }
70
71 ColourScheme (const ColourScheme&) = default;
72 ColourScheme& operator= (const ColourScheme&) = default;
73
75 Colour getUIColour (UIColour colourToGet) const noexcept;
76
78 void setUIColour (UIColour colourToSet, Colour newColour) noexcept;
79
81 bool operator== (const ColourScheme&) const noexcept;
83 bool operator!= (const ColourScheme&) const noexcept;
84
85 private:
87 };
88
89 //==============================================================================
92
95
97 ~LookAndFeel_V4() override;
98
99 //==============================================================================
102
103 static ColourScheme getDarkColourScheme();
104 static ColourScheme getMidnightColourScheme();
105 static ColourScheme getGreyColourScheme();
106 static ColourScheme getLightColourScheme();
107
108 //==============================================================================
109 Button* createDocumentWindowButton (int) override;
110 void positionDocumentWindowButtons (DocumentWindow&, int, int, int, int, Button*, Button*, Button*, bool) override;
111 void drawDocumentWindowTitleBar (DocumentWindow&, Graphics&, int, int, int, int, const Image*, bool) override;
112
113 //==============================================================================
114 Font getTextButtonFont (TextButton&, int buttonHeight) override;
115
116 void drawButtonBackground (Graphics&, Button&, const Colour& backgroundColour,
117 bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
118
119 void drawToggleButton (Graphics&, ToggleButton&,
120 bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
121 void drawTickBox (Graphics&, Component&,
122 float x, float y, float w, float h,
123 bool ticked, bool isEnabled,
124 bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override;
125
126 void changeToggleButtonWidthToFitText (ToggleButton&) override;
127
128 //==============================================================================
129 AlertWindow* createAlertWindow (const String& title, const String& message,
130 const String& button1,
131 const String& button2,
132 const String& button3,
133 MessageBoxIconType iconType,
134 int numButtons, Component* associatedComponent) override;
135 void drawAlertBox (Graphics&, AlertWindow&, const Rectangle<int>& textArea, TextLayout&) override;
136
137 int getAlertWindowButtonHeight() override;
138 Font getAlertWindowTitleFont() override;
139 Font getAlertWindowMessageFont() override;
140 Font getAlertWindowFont() override;
141
142 //==============================================================================
143 void drawProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String& textToShow) override;
144 bool isProgressBarOpaque (ProgressBar&) override { return false; }
145
146 //==============================================================================
147 int getDefaultScrollbarWidth() override;
148 void drawScrollbar (Graphics&, ScrollBar&, int x, int y, int width, int height, bool isScrollbarVertical,
149 int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override;
150
151 //==============================================================================
152 Path getTickShape (float height) override;
153 Path getCrossShape (float height) override;
154
155 //==============================================================================
156 void fillTextEditorBackground (Graphics&, int width, int height, TextEditor&) override;
157 void drawTextEditorOutline (Graphics&, int width, int height, TextEditor&) override;
158
159 //==============================================================================
160 Button* createFileBrowserGoUpButton() override;
161
162 void layoutFileBrowserComponent (FileBrowserComponent&,
165 ComboBox* currentPathBox,
166 TextEditor* filenameBox,
167 Button* goUpButton) override;
168
169 void drawFileBrowserRow (Graphics&, int width, int height,
170 const File& file, const String& filename, Image* icon,
171 const String& fileSizeDescription, const String& fileTimeDescription,
172 bool isDirectory, bool isItemSelected, int itemIndex,
174
175 //==============================================================================
176 void drawPopupMenuItem (Graphics&, const Rectangle<int>& area,
177 bool isSeparator, bool isActive, bool isHighlighted, bool isTicked, bool hasSubMenu,
178 const String& text, const String& shortcutKeyText,
179 const Drawable* icon, const Colour* textColour) override;
180
181 void getIdealPopupMenuItemSize (const String& text, bool isSeparator, int standardMenuItemHeight,
182 int& idealWidth, int& idealHeight) override;
183
184 void drawMenuBarBackground (Graphics&, int width, int height, bool isMouseOverBar, MenuBarComponent&) override;
185
186 void drawMenuBarItem (Graphics&, int width, int height,
187 int itemIndex, const String& itemText,
188 bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar,
189 MenuBarComponent&) override;
190
191 //==============================================================================
192 void drawComboBox (Graphics&, int width, int height, bool isButtonDown,
193 int buttonX, int buttonY, int buttonW, int buttonH,
194 ComboBox&) override;
195 Font getComboBoxFont (ComboBox&) override;
196 void positionComboBoxText (ComboBox&, Label&) override;
197
198 //==============================================================================
199 int getSliderThumbRadius (Slider&) override;
200
201 void drawLinearSlider (Graphics&, int x, int y, int width, int height,
202 float sliderPos, float minSliderPos, float maxSliderPos,
203 const Slider::SliderStyle, Slider&) override;
204
205 void drawRotarySlider (Graphics&, int x, int y, int width, int height,
206 float sliderPosProportional, float rotaryStartAngle,
207 float rotaryEndAngle, Slider&) override;
208
209 void drawPointer (Graphics&, float x, float y, float diameter,
210 const Colour&, int direction) noexcept;
211
212 Label* createSliderTextBox (Slider&) override;
213
214 //==============================================================================
215 void drawTooltip (Graphics&, const String& text, int width, int height) override;
216
217 //==============================================================================
218 void drawConcertinaPanelHeader (Graphics&, const Rectangle<int>& area,
219 bool isMouseOver, bool isMouseDown,
220 ConcertinaPanel&, Component& panel) override;
221
222 //==============================================================================
223 void drawLevelMeter (Graphics&, int, int, float) override;
224
225 //==============================================================================
226 void paintToolbarBackground (Graphics&, int width, int height, Toolbar&) override;
227
228 void paintToolbarButtonLabel (Graphics&, int x, int y, int width, int height,
229 const String& text, ToolbarItemComponent&) override;
230
231 //==============================================================================
232 void drawPropertyPanelSectionHeader (Graphics&, const String& name, bool isOpen, int width, int height) override;
233 void drawPropertyComponentBackground (Graphics&, int width, int height, PropertyComponent&) override;
234 void drawPropertyComponentLabel (Graphics&, int width, int height, PropertyComponent&) override;
235 Rectangle<int> getPropertyComponentContentPosition (PropertyComponent&) override;
236
237 //==============================================================================
238 void drawCallOutBoxBackground (CallOutBox&, Graphics&, const Path&, Image&) override;
239
240 //==============================================================================
241 void drawStretchableLayoutResizerBar (Graphics&, int, int, bool, bool, bool) override;
242
243private:
244 //==============================================================================
245 void drawLinearProgressBar (Graphics&, ProgressBar&, int width, int height, double progress, const String&);
246 void drawCircularProgressBar (Graphics&, ProgressBar&, const String&);
247
248 int getPropertyComponentIndent (PropertyComponent&);
249
250 //==============================================================================
251 void initialiseColours();
253
254 //==============================================================================
256};
257
258} // namespace juce
#define noexcept
Definition DistrhoDefines.h:72
static void message(int level, const char *fmt,...)
Definition adplugdb.cpp:120
Definition juce_AlertWindow.h:45
Definition juce_Button.h:43
Definition juce_CallOutBox.h:61
Definition juce_Colour.h:38
Definition juce_ComboBox.h:49
Definition juce_Component.h:36
Definition juce_ConcertinaPanel.h:40
Definition juce_DirectoryContentsDisplayComponent.h:38
Definition juce_DocumentWindow.h:55
Definition juce_Drawable.h:38
Definition juce_FileBrowserComponent.h:45
Definition juce_File.h:45
Definition juce_FilePreviewComponent.h:44
Definition juce_Font.h:42
Definition juce_GraphicsContext.h:45
Definition juce_Image.h:58
Definition juce_Label.h:41
LookAndFeel_V3()
Definition juce_LookAndFeel_V3.cpp:29
Definition juce_LookAndFeel_V4.h:43
ColourScheme(ItemColours... coloursToUse)
Definition juce_LookAndFeel_V4.h:62
Colour getUIColour(UIColour colourToGet) const noexcept
Definition juce_LookAndFeel_V4.cpp:29
UIColour
Definition juce_LookAndFeel_V4.h:47
@ defaultText
Definition juce_LookAndFeel_V4.h:52
@ highlightedText
Definition juce_LookAndFeel_V4.h:54
@ numColours
Definition juce_LookAndFeel_V4.h:58
@ outline
Definition juce_LookAndFeel_V4.h:51
@ widgetBackground
Definition juce_LookAndFeel_V4.h:49
@ highlightedFill
Definition juce_LookAndFeel_V4.h:55
@ windowBackground
Definition juce_LookAndFeel_V4.h:48
@ defaultFill
Definition juce_LookAndFeel_V4.h:53
@ menuBackground
Definition juce_LookAndFeel_V4.h:50
@ menuText
Definition juce_LookAndFeel_V4.h:56
ColourScheme(const ColourScheme &)=default
Colour palette[numColours]
Definition juce_LookAndFeel_V4.h:86
void setUIColour(UIColour colourToSet, Colour newColour) noexcept
Definition juce_LookAndFeel_V4.cpp:38
ColourScheme currentColourScheme
Definition juce_LookAndFeel_V4.h:252
bool isProgressBarOpaque(ProgressBar &) override
Definition juce_LookAndFeel_V4.h:144
void setColourScheme(ColourScheme)
Definition juce_LookAndFeel_V4.cpp:74
ColourScheme & getCurrentColourScheme() noexcept
Definition juce_LookAndFeel_V4.h:101
LookAndFeel_V4()
Definition juce_LookAndFeel_V4.cpp:61
Definition juce_MenuBarComponent.h:40
Definition juce_Path.h:65
Definition juce_ProgressBar.h:51
Definition juce_PropertyComponent.h:49
Definition juce_Rectangle.h:67
Definition juce_ScrollBar.h:54
Definition juce_Slider.h:54
SliderStyle
Definition juce_Slider.h:62
Definition juce_String.h:53
Definition juce_TextButton.h:39
Definition juce_TextEditor.h:43
Definition juce_TextLayout.h:41
Definition juce_ToggleButton.h:41
Definition juce_Toolbar.h:55
Definition juce_ToolbarItemComponent.h:50
UINT_D64 w
Definition inflate.c:942
int y
Definition inflate.c:1588
register unsigned i
Definition inflate.c:1575
unsigned x[BMAX+1]
Definition inflate.c:1586
static char filename[]
Definition features.c:5
static const char * title
Definition pugl.h:1747
static const char * name
Definition pugl.h:1582
static int int height
Definition pugl.h:1594
static int width
Definition pugl.h:1593
#define JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(className)
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31
MessageBoxIconType
Definition juce_MessageBoxOptions.h:31
const char * text
Definition swell-functions.h:167
return c
Definition crypt.c:175
uch h[RAND_HEAD_LEN]
Definition crypt.c:459
struct zdirent * file
Definition win32.c:1500