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.

579 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 (20);
  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 String& filename, Image* icon,
  191. const String& fileSizeDescription,
  192. const String& fileTimeDescription,
  193. const bool isDirectory, const bool isItemSelected,
  194. const 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));
  202. }
  203. LookAndFeel_V2::drawFileBrowserRow (g, width, height, 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));
  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. if (! border.isEmpty())
  250. {
  251. const Rectangle<int> fullSize (0, 0, w, h);
  252. const Rectangle<int> centreArea (border.subtractedFrom (fullSize));
  253. g.excludeClipRegion (centreArea);
  254. g.fillAll (getCurrentColourScheme().getUIColour (LookAndFeel_V4::ColourScheme::UIColour::windowBackground));
  255. }
  256. }
  257. void ProjucerLookAndFeel::drawComboBox (Graphics& g, int width, int height, bool,
  258. int, int, int, int, ComboBox& box)
  259. {
  260. const auto cornerSize = box.findParentComponentOfClass<ChoicePropertyComponent>() != nullptr ? 0.0f : 1.5f;
  261. Rectangle<int> boxBounds (0, 0, width, height);
  262. auto isChoiceCompChild = (box.findParentComponentOfClass<ChoicePropertyComponent>() != nullptr);
  263. if (isChoiceCompChild)
  264. {
  265. box.setColour (ComboBox::textColourId, findColour (widgetTextColourId));
  266. g.setColour (findColour (widgetBackgroundColourId));
  267. g.fillRect (boxBounds);
  268. auto arrowZone = boxBounds.removeFromRight (boxBounds.getHeight()).reduced (0, 2).toFloat();
  269. g.setColour (Colours::black);
  270. g.fillPath (getChoiceComponentArrowPath (arrowZone));
  271. }
  272. else
  273. {
  274. g.setColour (box.findColour (ComboBox::outlineColourId));
  275. g.drawRoundedRectangle (boxBounds.toFloat().reduced (0.5f, 0.5f), cornerSize, 1.0f);
  276. auto arrowZone = boxBounds.removeFromRight (boxBounds.getHeight()).toFloat();
  277. g.setColour (box.findColour (ComboBox::arrowColourId).withAlpha ((box.isEnabled() ? 0.9f : 0.2f)));
  278. g.fillPath (getArrowPath (arrowZone, 2, true, Justification::centred));
  279. }
  280. }
  281. void ProjucerLookAndFeel::drawTreeviewPlusMinusBox (Graphics& g, const Rectangle<float>& area,
  282. Colour, bool isOpen, bool /**isMouseOver*/)
  283. {
  284. g.strokePath (getArrowPath (area, isOpen ? 2 : 1, false, Justification::centredRight), PathStrokeType (2.0f));
  285. }
  286. void ProjucerLookAndFeel::drawProgressBar (Graphics& g, ProgressBar& progressBar,
  287. int width, int height, double progress, const String& textToShow)
  288. {
  289. ignoreUnused (width, height, progress);
  290. const auto background = progressBar.findColour (ProgressBar::backgroundColourId);
  291. const auto foreground = progressBar.findColour (defaultButtonBackgroundColourId);
  292. const auto sideLength = jmin (width, height);
  293. auto barBounds = progressBar.getLocalBounds().withSizeKeepingCentre (sideLength, sideLength).reduced (1).toFloat();
  294. auto rotationInDegrees = static_cast<float> ((Time::getMillisecondCounter() / 10) % 360);
  295. auto normalisedRotation = rotationInDegrees / 360.0f;
  296. const auto rotationOffset = 22.5f;
  297. const auto maxRotation = 315.0f;
  298. auto startInDegrees = rotationInDegrees;
  299. auto endInDegrees = startInDegrees + rotationOffset;
  300. if (normalisedRotation >= 0.25f && normalisedRotation < 0.5f)
  301. {
  302. const auto rescaledRotation = (normalisedRotation * 4.0f) - 1.0f;
  303. endInDegrees = startInDegrees + rotationOffset + (maxRotation * rescaledRotation);
  304. }
  305. else if (normalisedRotation >= 0.5f && normalisedRotation <= 1.0f)
  306. {
  307. endInDegrees = startInDegrees + rotationOffset + maxRotation;
  308. const auto rescaledRotation = 1.0f - ((normalisedRotation * 2.0f) - 1.0f);
  309. startInDegrees = endInDegrees - rotationOffset - (maxRotation * rescaledRotation);
  310. }
  311. g.setColour (background);
  312. Path arcPath2;
  313. arcPath2.addCentredArc (barBounds.getCentreX(),
  314. barBounds.getCentreY(),
  315. barBounds.getWidth() * 0.5f,
  316. barBounds.getHeight() * 0.5f, 0.0f,
  317. 0.0f,
  318. 2.0f * float_Pi,
  319. true);
  320. g.strokePath (arcPath2, PathStrokeType (2.0f));
  321. g.setColour (foreground);
  322. Path arcPath;
  323. arcPath.addCentredArc (barBounds.getCentreX(),
  324. barBounds.getCentreY(),
  325. barBounds.getWidth() * 0.5f,
  326. barBounds.getHeight() * 0.5f,
  327. 0.0f,
  328. degreesToRadians (startInDegrees),
  329. degreesToRadians (endInDegrees),
  330. true);
  331. arcPath.applyTransform (AffineTransform::rotation (normalisedRotation * float_Pi * 2.25f, barBounds.getCentreX(), barBounds.getCentreY()));
  332. g.strokePath (arcPath, PathStrokeType (2.0f));
  333. if (textToShow.isNotEmpty())
  334. {
  335. g.setColour (progressBar.findColour (TextButton::textColourOffId));
  336. g.setFont (Font (12.0f, 2));
  337. g.drawText (textToShow, barBounds, Justification::centred, false);
  338. }
  339. }
  340. //==============================================================================
  341. Path ProjucerLookAndFeel::getArrowPath (Rectangle<float> arrowZone, const int direction,
  342. bool filled, const Justification justification)
  343. {
  344. auto w = jmin (arrowZone.getWidth(), (direction == 0 || direction == 2) ? 8.0f : filled ? 5.0f : 8.0f);
  345. auto h = jmin (arrowZone.getHeight(), (direction == 0 || direction == 2) ? 5.0f : filled ? 8.0f : 5.0f);
  346. if (justification == Justification::centred)
  347. {
  348. arrowZone.reduce ((arrowZone.getWidth() - w) / 2, (arrowZone.getHeight() - h) / 2);
  349. }
  350. else if (justification == Justification::centredRight)
  351. {
  352. arrowZone.removeFromLeft (arrowZone.getWidth() - w);
  353. arrowZone.reduce (0, (arrowZone.getHeight() - h) / 2);
  354. }
  355. else if (justification == Justification::centredLeft)
  356. {
  357. arrowZone.removeFromRight (arrowZone.getWidth() - w);
  358. arrowZone.reduce (0, (arrowZone.getHeight() - h) / 2);
  359. }
  360. else
  361. {
  362. jassertfalse; // currently only supports centred justifications
  363. }
  364. Path path;
  365. path.startNewSubPath (arrowZone.getX(), arrowZone.getBottom());
  366. path.lineTo (arrowZone.getCentreX(), arrowZone.getY());
  367. path.lineTo (arrowZone.getRight(), arrowZone.getBottom());
  368. if (filled)
  369. path.closeSubPath();
  370. path.applyTransform (AffineTransform::rotation (direction * (float_Pi / 2.0f), arrowZone.getCentreX(), arrowZone.getCentreY()));
  371. return path;
  372. }
  373. Path ProjucerLookAndFeel::getChoiceComponentArrowPath (Rectangle<float> arrowZone)
  374. {
  375. auto topBounds = arrowZone.removeFromTop (arrowZone.getHeight() * 0.5f);
  376. auto bottomBounds = arrowZone;
  377. auto topArrow = getArrowPath (topBounds, 0, true, Justification::centred);
  378. auto bottomArrow = getArrowPath (bottomBounds, 2, true, Justification::centred);
  379. topArrow.addPath (bottomArrow);
  380. return topArrow;
  381. }
  382. //==============================================================================
  383. void ProjucerLookAndFeel::setupColours()
  384. {
  385. auto& colourScheme = getCurrentColourScheme();
  386. if (colourScheme == getDarkColourScheme())
  387. {
  388. setColour (backgroundColourId, Colour (0xff323e44));
  389. setColour (secondaryBackgroundColourId, Colour (0xff263238));
  390. setColour (defaultTextColourId, Colours::white);
  391. setColour (widgetTextColourId, Colours::white);
  392. setColour (defaultButtonBackgroundColourId, Colour (0xffa45c94));
  393. setColour (secondaryButtonBackgroundColourId, Colours::black);
  394. setColour (userButtonBackgroundColourId, Colour (0xffa45c94));
  395. setColour (defaultIconColourId, Colours::white);
  396. setColour (treeIconColourId, Colour (0xffa9a9a9));
  397. setColour (defaultHighlightColourId, Colour (0xffe0ec65));
  398. setColour (defaultHighlightedTextColourId, Colours::black);
  399. setColour (codeEditorLineNumberColourId, Colour (0xffaaaaaa));
  400. setColour (activeTabIconColourId, Colours::white);
  401. setColour (inactiveTabBackgroundColourId, Colour (0xff181f22));
  402. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  403. setColour (contentHeaderBackgroundColourId, Colours::black);
  404. setColour (widgetBackgroundColourId, Colour (0xff495358));
  405. setColour (secondaryWidgetBackgroundColourId, Colour (0xff303b41));
  406. colourScheme.setUIColour (LookAndFeel_V4::ColourScheme::UIColour::defaultFill, Colour (0xffa45c94));
  407. }
  408. else if (colourScheme == getGreyColourScheme())
  409. {
  410. setColour (backgroundColourId, Colour (0xff505050));
  411. setColour (secondaryBackgroundColourId, Colour (0xff424241));
  412. setColour (defaultTextColourId, Colours::white);
  413. setColour (widgetTextColourId, Colours::black);
  414. setColour (defaultButtonBackgroundColourId, Colour (0xff26ba90));
  415. setColour (secondaryButtonBackgroundColourId, Colours::black);
  416. setColour (userButtonBackgroundColourId, Colour (0xff26ba90));
  417. setColour (defaultIconColourId, Colours::white);
  418. setColour (treeIconColourId, Colour (0xffa9a9a9));
  419. setColour (defaultHighlightColourId, Colour (0xffe0ec65));
  420. setColour (defaultHighlightedTextColourId, Colours::black);
  421. setColour (codeEditorLineNumberColourId, Colour (0xffaaaaaa));
  422. setColour (activeTabIconColourId, Colours::white);
  423. setColour (inactiveTabBackgroundColourId, Colour (0xff373737));
  424. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  425. setColour (contentHeaderBackgroundColourId, Colours::black);
  426. setColour (widgetBackgroundColourId, Colours::white);
  427. setColour (secondaryWidgetBackgroundColourId, Colour (0xffdddddd));
  428. }
  429. else if (colourScheme == getLightColourScheme())
  430. {
  431. setColour (backgroundColourId, Colour (0xffefefef));
  432. setColour (secondaryBackgroundColourId, Colour (0xfff9f9f9));
  433. setColour (defaultTextColourId, Colours::black);
  434. setColour (widgetTextColourId, Colours::black);
  435. setColour (defaultButtonBackgroundColourId, Colour (0xff42a2c8));
  436. setColour (secondaryButtonBackgroundColourId, Colour (0xffa1c677));
  437. setColour (userButtonBackgroundColourId, Colour (0xffff5b5b));
  438. setColour (defaultIconColourId, Colours::white);
  439. setColour (treeIconColourId, Colour (0xffa9a9a9));
  440. setColour (defaultHighlightColourId, Colour (0xffffd05b));
  441. setColour (defaultHighlightedTextColourId, Colour (0xff585656));
  442. setColour (codeEditorLineNumberColourId, Colour (0xff888888));
  443. setColour (activeTabIconColourId, Colour (0xff42a2c8));
  444. setColour (inactiveTabBackgroundColourId, Colour (0xffd5d5d5));
  445. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  446. setColour (contentHeaderBackgroundColourId, Colour (0xff42a2c8));
  447. setColour (widgetBackgroundColourId, Colours::white);
  448. setColour (secondaryWidgetBackgroundColourId, Colour (0xfff4f4f4));
  449. }
  450. setColour (Label::textColourId, findColour (defaultTextColourId));
  451. setColour (Label::textWhenEditingColourId, findColour (widgetTextColourId));
  452. setColour (TextEditor::highlightColourId, findColour (defaultHighlightColourId));
  453. setColour (TextEditor::highlightedTextColourId, findColour (defaultHighlightedTextColourId));
  454. setColour (TextEditor::outlineColourId, Colours::transparentBlack);
  455. setColour (TextEditor::focusedOutlineColourId, Colours::transparentBlack);
  456. setColour (TextEditor::backgroundColourId, findColour (widgetBackgroundColourId));
  457. setColour (TextEditor::textColourId, findColour (widgetTextColourId));
  458. setColour (TextButton::buttonColourId, findColour (defaultButtonBackgroundColourId));
  459. setColour (ScrollBar::ColourIds::thumbColourId, Colour (0xffd0d8e0));
  460. setColour (TextPropertyComponent::outlineColourId, Colours::transparentBlack);
  461. setColour (TextPropertyComponent::backgroundColourId, findColour (widgetBackgroundColourId));
  462. setColour (TextPropertyComponent::textColourId, findColour (widgetTextColourId));
  463. setColour (BooleanPropertyComponent::outlineColourId, Colours::transparentBlack);
  464. setColour (BooleanPropertyComponent::backgroundColourId, findColour (widgetBackgroundColourId));
  465. setColour (ToggleButton::tickDisabledColourId, Colour (0xffa9a9a9));
  466. setColour (ToggleButton::tickColourId, findColour (defaultButtonBackgroundColourId).withMultipliedBrightness(1.3f));
  467. setColour (CodeEditorComponent::backgroundColourId, findColour (secondaryBackgroundColourId));
  468. setColour (CodeEditorComponent::lineNumberTextId, findColour (codeEditorLineNumberColourId));
  469. setColour (CodeEditorComponent::lineNumberBackgroundId, findColour (backgroundColourId));
  470. setColour (CaretComponent::caretColourId, findColour (defaultButtonBackgroundColourId));
  471. setColour (TreeView::selectedItemBackgroundColourId, findColour (defaultHighlightColourId));
  472. }