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.

569 lines
27KB

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