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.

575 lines
27KB

  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. #include "../jucer_Headers.h"
  20. #include "jucer_ProjucerLookAndFeel.h"
  21. #include "../Application/jucer_Application.h"
  22. ProjucerLookAndFeel::ProjucerLookAndFeel()
  23. {
  24. setupColours();
  25. }
  26. void ProjucerLookAndFeel::drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
  27. {
  28. const auto area = button.getActiveArea();
  29. auto backgroundColour = findColour (button.isFrontTab() ? secondaryBackgroundColourId
  30. : inactiveTabBackgroundColourId);
  31. auto iconColour = findColour (button.isFrontTab() ? activeTabIconColourId
  32. : inactiveTabIconColourId);
  33. g.setColour (backgroundColour);
  34. g.fillRect (area);
  35. const auto alpha = button.isEnabled() ? ((isMouseOver || isMouseDown) ? 1.0f : 0.8f) : 0.3f;
  36. #ifndef BUILDING_JUCE_COMPILEENGINE
  37. if (button.getName() == "Project")
  38. {
  39. auto icon = Icon (getIcons().closedFolder, iconColour.withMultipliedAlpha (alpha));
  40. icon.draw (g, button.getTextArea().reduced (8, 8).toFloat(), false);
  41. }
  42. else if (button.getName() == "Build")
  43. {
  44. auto icon = Icon (getIcons().buildTab, iconColour.withMultipliedAlpha (alpha));
  45. icon.draw (g, button.getTextArea().reduced (8, 8).toFloat(), false);
  46. }
  47. else
  48. #endif
  49. {
  50. auto textColour = findColour (defaultTextColourId).withMultipliedAlpha (alpha);
  51. TextLayout textLayout;
  52. LookAndFeel_V3::createTabTextLayout (button, (float) area.getWidth(), (float) area.getHeight(), textColour, textLayout);
  53. textLayout.draw (g, button.getTextArea().toFloat());
  54. }
  55. }
  56. int ProjucerLookAndFeel::getTabButtonBestWidth (TabBarButton& button, int)
  57. {
  58. if (TabbedButtonBar* bar = button.findParentComponentOfClass<TabbedButtonBar>())
  59. return bar->getWidth() / bar->getNumTabs();
  60. return 120;
  61. }
  62. void ProjucerLookAndFeel::drawPropertyComponentLabel (Graphics& g, int width, int height, PropertyComponent& component)
  63. {
  64. ignoreUnused (width);
  65. g.setColour (component.findColour (defaultTextColourId)
  66. .withMultipliedAlpha (component.isEnabled() ? 1.0f : 0.6f));
  67. auto textWidth = getTextWidthForPropertyComponent (&component);
  68. g.setFont (getPropertyComponentFont());
  69. g.drawFittedText (component.getName(), 0, 0, textWidth - 5, height, Justification::centredLeft, 5, 1.0f);
  70. }
  71. Rectangle<int> ProjucerLookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component)
  72. {
  73. const auto textW = getTextWidthForPropertyComponent (&component);
  74. return { textW, 0, component.getWidth() - textW, component.getHeight() - 1 };
  75. }
  76. void ProjucerLookAndFeel::drawButtonBackground (Graphics& g,
  77. Button& button,
  78. const Colour& backgroundColour,
  79. bool isMouseOverButton,
  80. bool isButtonDown)
  81. {
  82. const auto cornerSize = button.findParentComponentOfClass<PropertyComponent>() != nullptr ? 0.0f : 3.0f;
  83. const auto bounds = button.getLocalBounds().toFloat();
  84. auto baseColour = backgroundColour.withMultipliedSaturation (button.hasKeyboardFocus (true) ? 1.3f : 0.9f)
  85. .withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.5f);
  86. if (isButtonDown || isMouseOverButton)
  87. baseColour = baseColour.contrasting (isButtonDown ? 0.2f : 0.05f);
  88. g.setColour (baseColour);
  89. if (button.isConnectedOnLeft() || button.isConnectedOnRight())
  90. {
  91. Path path;
  92. path.addRoundedRectangle (bounds.getX(), bounds.getY(),
  93. bounds.getWidth(), bounds.getHeight(),
  94. cornerSize, cornerSize,
  95. ! button.isConnectedOnLeft(),
  96. ! button.isConnectedOnRight(),
  97. ! button.isConnectedOnLeft(),
  98. ! button.isConnectedOnRight());
  99. g.fillPath (path);
  100. }
  101. else
  102. {
  103. g.fillRoundedRectangle (bounds, cornerSize);
  104. }
  105. }
  106. void ProjucerLookAndFeel::drawButtonText (Graphics& g, TextButton& button, bool isMouseOverButton, bool isButtonDown)
  107. {
  108. ignoreUnused (isMouseOverButton, isButtonDown);
  109. g.setFont (getTextButtonFont (button, button.getHeight()));
  110. g.setColour (button.findColour (button.getToggleState() ? TextButton::textColourOnId
  111. : TextButton::textColourOffId)
  112. .withMultipliedAlpha (button.isEnabled() ? 1.0f
  113. : 0.5f));
  114. auto xIndent = jmin (8, button.getWidth() / 10);
  115. auto yIndent = jmin (3, button.getHeight() / 6);
  116. auto textBounds = button.getLocalBounds().reduced (xIndent, yIndent);
  117. g.drawFittedText (button.getButtonText(), textBounds, Justification::centred, 3, 1.0f);
  118. }
  119. void ProjucerLookAndFeel::drawToggleButton (Graphics& g, ToggleButton& button, bool isMouseOverButton, bool isButtonDown)
  120. {
  121. ignoreUnused (isMouseOverButton, isButtonDown);
  122. if (! button.isEnabled())
  123. g.setOpacity (0.5f);
  124. bool isTextEmpty = button.getButtonText().isEmpty();
  125. bool isPropertyComponentChild = (dynamic_cast<BooleanPropertyComponent*> (button.getParentComponent()) != nullptr);
  126. auto bounds = button.getLocalBounds();
  127. auto sideLength = isPropertyComponentChild ? 25 : bounds.getHeight();
  128. auto rectBounds = isTextEmpty ? bounds
  129. : bounds.removeFromLeft (jmin (sideLength, bounds.getWidth() / 3));
  130. rectBounds = rectBounds.withSizeKeepingCentre (sideLength, sideLength).reduced (4);
  131. g.setColour (button.findColour (ToggleButton::tickDisabledColourId));
  132. g.drawRoundedRectangle (rectBounds.toFloat(), 2.0f, 1.0f);
  133. if (button.getToggleState())
  134. {
  135. g.setColour (button.findColour (ToggleButton::tickColourId));
  136. const auto tick = getTickShape (0.75f);
  137. g.fillPath (tick, tick.getTransformToScaleToFit (rectBounds.reduced (2).toFloat(), false));
  138. }
  139. if (! isTextEmpty)
  140. {
  141. bounds.removeFromLeft (5);
  142. const auto fontSize = jmin (15.0f, button.getHeight() * 0.75f);
  143. g.setFont (fontSize);
  144. g.setColour (isPropertyComponentChild ? findColour (widgetTextColourId)
  145. : button.findColour (ToggleButton::textColourId));
  146. g.drawFittedText (button.getButtonText(), bounds, Justification::centredLeft, 2);
  147. }
  148. }
  149. Font ProjucerLookAndFeel::getTextButtonFont (TextButton&, int buttonHeight)
  150. {
  151. return Font (jmin (12.0f, buttonHeight * 0.6f));
  152. }
  153. void ProjucerLookAndFeel::fillTextEditorBackground (Graphics& g, int width, int height, TextEditor& textEditor)
  154. {
  155. g.setColour (textEditor.findColour (TextEditor::backgroundColourId));
  156. g.fillRect (0, 0, width, height);
  157. g.setColour (textEditor.findColour (TextEditor::outlineColourId));
  158. g.drawHorizontalLine (height - 1, 0.0f, static_cast<float> (width));
  159. }
  160. void ProjucerLookAndFeel::layoutFileBrowserComponent (FileBrowserComponent& browserComp,
  161. DirectoryContentsDisplayComponent* fileListComponent,
  162. FilePreviewComponent* previewComp,
  163. ComboBox* currentPathBox,
  164. TextEditor* filenameBox,
  165. Button* goUpButton)
  166. {
  167. const auto sectionHeight = 22;
  168. const auto buttonWidth = 50;
  169. auto b = browserComp.getLocalBounds().reduced (20, 5);
  170. auto topSlice = b.removeFromTop (sectionHeight);
  171. auto bottomSlice = b.removeFromBottom (sectionHeight);
  172. currentPathBox->setBounds (topSlice.removeFromLeft (topSlice.getWidth() - buttonWidth));
  173. currentPathBox->setColour (ComboBox::backgroundColourId, findColour (backgroundColourId));
  174. currentPathBox->setColour (ComboBox::textColourId, findColour (defaultTextColourId));
  175. currentPathBox->setColour (ComboBox::arrowColourId, findColour (defaultTextColourId));
  176. topSlice.removeFromLeft (6);
  177. goUpButton->setBounds (topSlice);
  178. bottomSlice.removeFromLeft (50);
  179. filenameBox->setBounds (bottomSlice);
  180. filenameBox->setColour (TextEditor::backgroundColourId, findColour (backgroundColourId));
  181. filenameBox->setColour (TextEditor::textColourId, findColour (defaultTextColourId));
  182. filenameBox->setColour (TextEditor::outlineColourId, findColour (defaultTextColourId));
  183. filenameBox->applyFontToAllText (filenameBox->getFont());
  184. if (previewComp != nullptr)
  185. previewComp->setBounds (b.removeFromRight (b.getWidth() / 3));
  186. if (auto listAsComp = dynamic_cast<Component*> (fileListComponent))
  187. listAsComp->setBounds (b.reduced (0, 10));
  188. }
  189. void ProjucerLookAndFeel::drawFileBrowserRow (Graphics& g, int width, int height,
  190. const File& file, const String& filename, Image* icon,
  191. const String& fileSizeDescription,
  192. const String& fileTimeDescription,
  193. bool isDirectory, bool isItemSelected,
  194. int itemIndex, DirectoryContentsDisplayComponent& dcc)
  195. {
  196. if (auto fileListComp = dynamic_cast<Component*> (&dcc))
  197. {
  198. fileListComp->setColour (DirectoryContentsDisplayComponent::textColourId,
  199. findColour (isItemSelected ? defaultHighlightedTextColourId : defaultTextColourId));
  200. fileListComp->setColour (DirectoryContentsDisplayComponent::highlightColourId,
  201. findColour (defaultHighlightColourId).withAlpha (0.75f));
  202. }
  203. LookAndFeel_V2::drawFileBrowserRow (g, width, height, file, filename, icon,
  204. fileSizeDescription, fileTimeDescription,
  205. isDirectory, isItemSelected, itemIndex, dcc);
  206. }
  207. void ProjucerLookAndFeel::drawCallOutBoxBackground (CallOutBox&, Graphics& g, const Path& path, Image&)
  208. {
  209. g.setColour (findColour (secondaryBackgroundColourId));
  210. g.fillPath (path);
  211. g.setColour (findColour (userButtonBackgroundColourId));
  212. g.strokePath (path, PathStrokeType (2.0f));
  213. }
  214. void ProjucerLookAndFeel::drawMenuBarBackground (Graphics& g, int width, int height,
  215. bool, MenuBarComponent& menuBar)
  216. {
  217. const auto colour = menuBar.findColour (backgroundColourId).withAlpha (0.75f);
  218. Rectangle<int> r (width, height);
  219. g.setColour (colour.contrasting (0.15f));
  220. g.fillRect (r.removeFromTop (1));
  221. g.fillRect (r.removeFromBottom (1));
  222. g.setGradientFill (ColourGradient (colour, 0, 0, colour.darker (0.2f), 0, (float)height, false));
  223. g.fillRect (r);
  224. }
  225. void ProjucerLookAndFeel::drawMenuBarItem (Graphics& g, int width, int height,
  226. int itemIndex, const String& itemText,
  227. bool isMouseOverItem, bool isMenuOpen,
  228. bool /*isMouseOverBar*/, MenuBarComponent& menuBar)
  229. {
  230. if (! menuBar.isEnabled())
  231. {
  232. g.setColour (menuBar.findColour (defaultTextColourId)
  233. .withMultipliedAlpha (0.5f));
  234. }
  235. else if (isMenuOpen || isMouseOverItem)
  236. {
  237. g.fillAll (menuBar.findColour (defaultHighlightColourId).withAlpha (0.75f));
  238. g.setColour (menuBar.findColour (defaultHighlightedTextColourId));
  239. }
  240. else
  241. {
  242. g.setColour (menuBar.findColour (defaultTextColourId));
  243. }
  244. g.setFont (getMenuBarFont (menuBar, itemIndex, itemText));
  245. g.drawFittedText (itemText, 0, 0, width, height, Justification::centred, 1);
  246. }
  247. void ProjucerLookAndFeel::drawResizableFrame (Graphics& g, int w, int h, const BorderSize<int>& border)
  248. {
  249. ignoreUnused (g, w, h, border);
  250. }
  251. void ProjucerLookAndFeel::drawComboBox (Graphics& g, int width, int height, bool,
  252. int, int, int, int, ComboBox& box)
  253. {
  254. const auto cornerSize = box.findParentComponentOfClass<ChoicePropertyComponent>() != nullptr ? 0.0f : 1.5f;
  255. Rectangle<int> boxBounds (0, 0, width, height);
  256. auto isChoiceCompChild = (box.findParentComponentOfClass<ChoicePropertyComponent>() != nullptr);
  257. if (isChoiceCompChild)
  258. {
  259. box.setColour (ComboBox::textColourId, findColour (widgetTextColourId));
  260. g.setColour (findColour (widgetBackgroundColourId));
  261. g.fillRect (boxBounds);
  262. auto arrowZone = boxBounds.removeFromRight (boxBounds.getHeight()).reduced (0, 2).toFloat();
  263. g.setColour (Colours::black);
  264. g.fillPath (getChoiceComponentArrowPath (arrowZone));
  265. }
  266. else
  267. {
  268. g.setColour (box.findColour (ComboBox::outlineColourId));
  269. g.drawRoundedRectangle (boxBounds.toFloat().reduced (0.5f, 0.5f), cornerSize, 1.0f);
  270. auto arrowZone = boxBounds.removeFromRight (boxBounds.getHeight()).toFloat();
  271. g.setColour (box.findColour (ComboBox::arrowColourId).withAlpha ((box.isEnabled() ? 0.9f : 0.2f)));
  272. g.fillPath (getArrowPath (arrowZone, 2, true, Justification::centred));
  273. }
  274. }
  275. void ProjucerLookAndFeel::drawTreeviewPlusMinusBox (Graphics& g, const Rectangle<float>& area,
  276. Colour, bool isOpen, bool /**isMouseOver*/)
  277. {
  278. g.strokePath (getArrowPath (area, isOpen ? 2 : 1, false, Justification::centredRight), PathStrokeType (2.0f));
  279. }
  280. void ProjucerLookAndFeel::drawProgressBar (Graphics& g, ProgressBar& progressBar,
  281. int width, int height, double progress, const String& textToShow)
  282. {
  283. ignoreUnused (width, height, progress);
  284. const auto background = progressBar.findColour (ProgressBar::backgroundColourId);
  285. const auto foreground = progressBar.findColour (defaultButtonBackgroundColourId);
  286. const auto sideLength = jmin (width, height);
  287. auto barBounds = progressBar.getLocalBounds().withSizeKeepingCentre (sideLength, sideLength).reduced (1).toFloat();
  288. auto rotationInDegrees = static_cast<float> ((Time::getMillisecondCounter() / 10) % 360);
  289. auto normalisedRotation = rotationInDegrees / 360.0f;
  290. const auto rotationOffset = 22.5f;
  291. const auto maxRotation = 315.0f;
  292. auto startInDegrees = rotationInDegrees;
  293. auto endInDegrees = startInDegrees + rotationOffset;
  294. if (normalisedRotation >= 0.25f && normalisedRotation < 0.5f)
  295. {
  296. const auto rescaledRotation = (normalisedRotation * 4.0f) - 1.0f;
  297. endInDegrees = startInDegrees + rotationOffset + (maxRotation * rescaledRotation);
  298. }
  299. else if (normalisedRotation >= 0.5f && normalisedRotation <= 1.0f)
  300. {
  301. endInDegrees = startInDegrees + rotationOffset + maxRotation;
  302. const auto rescaledRotation = 1.0f - ((normalisedRotation * 2.0f) - 1.0f);
  303. startInDegrees = endInDegrees - rotationOffset - (maxRotation * rescaledRotation);
  304. }
  305. g.setColour (background);
  306. Path arcPath2;
  307. arcPath2.addCentredArc (barBounds.getCentreX(),
  308. barBounds.getCentreY(),
  309. barBounds.getWidth() * 0.5f,
  310. barBounds.getHeight() * 0.5f, 0.0f,
  311. 0.0f,
  312. 2.0f * float_Pi,
  313. true);
  314. g.strokePath (arcPath2, PathStrokeType (2.0f));
  315. g.setColour (foreground);
  316. Path arcPath;
  317. arcPath.addCentredArc (barBounds.getCentreX(),
  318. barBounds.getCentreY(),
  319. barBounds.getWidth() * 0.5f,
  320. barBounds.getHeight() * 0.5f,
  321. 0.0f,
  322. degreesToRadians (startInDegrees),
  323. degreesToRadians (endInDegrees),
  324. true);
  325. arcPath.applyTransform (AffineTransform::rotation (normalisedRotation * float_Pi * 2.25f, barBounds.getCentreX(), barBounds.getCentreY()));
  326. g.strokePath (arcPath, PathStrokeType (2.0f));
  327. if (textToShow.isNotEmpty())
  328. {
  329. g.setColour (progressBar.findColour (TextButton::textColourOffId));
  330. g.setFont (Font (12.0f, 2));
  331. g.drawText (textToShow, barBounds, Justification::centred, false);
  332. }
  333. }
  334. //==============================================================================
  335. Path ProjucerLookAndFeel::getArrowPath (Rectangle<float> arrowZone, const int direction,
  336. bool filled, const Justification justification)
  337. {
  338. auto w = jmin (arrowZone.getWidth(), (direction == 0 || direction == 2) ? 8.0f : filled ? 5.0f : 8.0f);
  339. auto h = jmin (arrowZone.getHeight(), (direction == 0 || direction == 2) ? 5.0f : filled ? 8.0f : 5.0f);
  340. if (justification == Justification::centred)
  341. {
  342. arrowZone.reduce ((arrowZone.getWidth() - w) / 2, (arrowZone.getHeight() - h) / 2);
  343. }
  344. else if (justification == Justification::centredRight)
  345. {
  346. arrowZone.removeFromLeft (arrowZone.getWidth() - w);
  347. arrowZone.reduce (0, (arrowZone.getHeight() - h) / 2);
  348. }
  349. else if (justification == Justification::centredLeft)
  350. {
  351. arrowZone.removeFromRight (arrowZone.getWidth() - w);
  352. arrowZone.reduce (0, (arrowZone.getHeight() - h) / 2);
  353. }
  354. else
  355. {
  356. jassertfalse; // currently only supports centred justifications
  357. }
  358. Path path;
  359. path.startNewSubPath (arrowZone.getX(), arrowZone.getBottom());
  360. path.lineTo (arrowZone.getCentreX(), arrowZone.getY());
  361. path.lineTo (arrowZone.getRight(), arrowZone.getBottom());
  362. if (filled)
  363. path.closeSubPath();
  364. path.applyTransform (AffineTransform::rotation (direction * (float_Pi / 2.0f), arrowZone.getCentreX(), arrowZone.getCentreY()));
  365. return path;
  366. }
  367. Path ProjucerLookAndFeel::getChoiceComponentArrowPath (Rectangle<float> arrowZone)
  368. {
  369. auto topBounds = arrowZone.removeFromTop (arrowZone.getHeight() * 0.5f);
  370. auto bottomBounds = arrowZone;
  371. auto topArrow = getArrowPath (topBounds, 0, true, Justification::centred);
  372. auto bottomArrow = getArrowPath (bottomBounds, 2, true, Justification::centred);
  373. topArrow.addPath (bottomArrow);
  374. return topArrow;
  375. }
  376. //==============================================================================
  377. void ProjucerLookAndFeel::setupColours()
  378. {
  379. auto& colourScheme = getCurrentColourScheme();
  380. if (colourScheme == getDarkColourScheme())
  381. {
  382. setColour (backgroundColourId, Colour (0xff323e44));
  383. setColour (secondaryBackgroundColourId, Colour (0xff263238));
  384. setColour (defaultTextColourId, Colours::white);
  385. setColour (widgetTextColourId, Colours::white);
  386. setColour (defaultButtonBackgroundColourId, Colour (0xffa45c94));
  387. setColour (secondaryButtonBackgroundColourId, Colours::black);
  388. setColour (userButtonBackgroundColourId, Colour (0xffa45c94));
  389. setColour (defaultIconColourId, Colours::white);
  390. setColour (treeIconColourId, Colour (0xffa9a9a9));
  391. setColour (defaultHighlightColourId, Colour (0xffe0ec65));
  392. setColour (defaultHighlightedTextColourId, Colours::black);
  393. setColour (codeEditorLineNumberColourId, Colour (0xffaaaaaa));
  394. setColour (activeTabIconColourId, Colours::white);
  395. setColour (inactiveTabBackgroundColourId, Colour (0xff181f22));
  396. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  397. setColour (contentHeaderBackgroundColourId, Colours::black);
  398. setColour (widgetBackgroundColourId, Colour (0xff495358));
  399. setColour (secondaryWidgetBackgroundColourId, Colour (0xff303b41));
  400. colourScheme.setUIColour (LookAndFeel_V4::ColourScheme::UIColour::defaultFill, Colour (0xffa45c94));
  401. }
  402. else if (colourScheme == getGreyColourScheme())
  403. {
  404. setColour (backgroundColourId, Colour (0xff505050));
  405. setColour (secondaryBackgroundColourId, Colour (0xff424241));
  406. setColour (defaultTextColourId, Colours::white);
  407. setColour (widgetTextColourId, Colours::black);
  408. setColour (defaultButtonBackgroundColourId, Colour (0xff26ba90));
  409. setColour (secondaryButtonBackgroundColourId, Colours::black);
  410. setColour (userButtonBackgroundColourId, Colour (0xff26ba90));
  411. setColour (defaultIconColourId, Colours::white);
  412. setColour (treeIconColourId, Colour (0xffa9a9a9));
  413. setColour (defaultHighlightColourId, Colour (0xffe0ec65));
  414. setColour (defaultHighlightedTextColourId, Colours::black);
  415. setColour (codeEditorLineNumberColourId, Colour (0xffaaaaaa));
  416. setColour (activeTabIconColourId, Colours::white);
  417. setColour (inactiveTabBackgroundColourId, Colour (0xff373737));
  418. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  419. setColour (contentHeaderBackgroundColourId, Colours::black);
  420. setColour (widgetBackgroundColourId, Colours::white);
  421. setColour (secondaryWidgetBackgroundColourId, Colour (0xffdddddd));
  422. }
  423. else if (colourScheme == getLightColourScheme())
  424. {
  425. setColour (backgroundColourId, Colour (0xffefefef));
  426. setColour (secondaryBackgroundColourId, Colour (0xfff9f9f9));
  427. setColour (defaultTextColourId, Colours::black);
  428. setColour (widgetTextColourId, Colours::black);
  429. setColour (defaultButtonBackgroundColourId, Colour (0xff42a2c8));
  430. setColour (secondaryButtonBackgroundColourId, Colour (0xffa1c677));
  431. setColour (userButtonBackgroundColourId, Colour (0xff42a2c8));
  432. setColour (defaultIconColourId, Colours::white);
  433. setColour (treeIconColourId, Colour (0xffa9a9a9));
  434. setColour (defaultHighlightColourId, Colour (0xffffd05b));
  435. setColour (defaultHighlightedTextColourId, Colour (0xff585656));
  436. setColour (codeEditorLineNumberColourId, Colour (0xff888888));
  437. setColour (activeTabIconColourId, Colour (0xff42a2c8));
  438. setColour (inactiveTabBackgroundColourId, Colour (0xffd5d5d5));
  439. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  440. setColour (contentHeaderBackgroundColourId, Colour (0xff42a2c8));
  441. setColour (widgetBackgroundColourId, Colours::white);
  442. setColour (secondaryWidgetBackgroundColourId, Colour (0xfff4f4f4));
  443. }
  444. setColour (Label::textColourId, findColour (defaultTextColourId));
  445. setColour (Label::textWhenEditingColourId, findColour (widgetTextColourId));
  446. setColour (TextEditor::highlightColourId, findColour (defaultHighlightColourId).withAlpha (0.75f));
  447. setColour (TextEditor::highlightedTextColourId, findColour (defaultHighlightedTextColourId));
  448. setColour (TextEditor::outlineColourId, Colours::transparentBlack);
  449. setColour (TextEditor::focusedOutlineColourId, Colours::transparentBlack);
  450. setColour (TextEditor::backgroundColourId, findColour (widgetBackgroundColourId));
  451. setColour (TextEditor::textColourId, findColour (widgetTextColourId));
  452. setColour (TextButton::buttonColourId, findColour (defaultButtonBackgroundColourId));
  453. setColour (ScrollBar::ColourIds::thumbColourId, Colour (0xffd0d8e0));
  454. setColour (TextPropertyComponent::outlineColourId, Colours::transparentBlack);
  455. setColour (TextPropertyComponent::backgroundColourId, findColour (widgetBackgroundColourId));
  456. setColour (TextPropertyComponent::textColourId, findColour (widgetTextColourId));
  457. setColour (BooleanPropertyComponent::outlineColourId, Colours::transparentBlack);
  458. setColour (BooleanPropertyComponent::backgroundColourId, findColour (widgetBackgroundColourId));
  459. setColour (ToggleButton::tickDisabledColourId, Colour (0xffa9a9a9));
  460. setColour (ToggleButton::tickColourId, findColour (defaultButtonBackgroundColourId).withMultipliedBrightness(1.3f));
  461. setColour (CodeEditorComponent::backgroundColourId, findColour (secondaryBackgroundColourId));
  462. setColour (CodeEditorComponent::lineNumberTextId, findColour (codeEditorLineNumberColourId));
  463. setColour (CodeEditorComponent::lineNumberBackgroundId, findColour (backgroundColourId));
  464. setColour (CodeEditorComponent::highlightColourId, findColour (defaultHighlightColourId).withAlpha (0.5f));
  465. setColour (CaretComponent::caretColourId, findColour (defaultButtonBackgroundColourId));
  466. setColour (TreeView::selectedItemBackgroundColourId, findColour (defaultHighlightColourId));
  467. setColour (PopupMenu::highlightedBackgroundColourId, findColour (defaultHighlightColourId).withAlpha (0.75f));
  468. setColour (PopupMenu::highlightedTextColourId, findColour (defaultHighlightedTextColourId));
  469. }