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.

577 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 "../../Application/jucer_Headers.h"
  20. #include "jucer_ProjucerLookAndFeel.h"
  21. #include "../../Application/jucer_Application.h"
  22. //==============================================================================
  23. ProjucerLookAndFeel::ProjucerLookAndFeel()
  24. {
  25. setupColours();
  26. }
  27. ProjucerLookAndFeel::~ProjucerLookAndFeel() {}
  28. void ProjucerLookAndFeel::drawTabButton (TabBarButton& button, Graphics& g, bool isMouseOver, bool isMouseDown)
  29. {
  30. const auto area = button.getActiveArea();
  31. auto backgroundColour = findColour (button.isFrontTab() ? secondaryBackgroundColourId
  32. : inactiveTabBackgroundColourId);
  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. auto iconColour = findColour (button.isFrontTab() ? activeTabIconColourId
  38. : inactiveTabIconColourId);
  39. if (button.getName() == "Project")
  40. {
  41. auto icon = Icon (getIcons().closedFolder, iconColour.withMultipliedAlpha (alpha));
  42. icon.draw (g, button.getTextArea().reduced (8, 8).toFloat(), false);
  43. }
  44. else if (button.getName() == "Build")
  45. {
  46. auto icon = Icon (getIcons().buildTab, iconColour.withMultipliedAlpha (alpha));
  47. icon.draw (g, button.getTextArea().reduced (8, 8).toFloat(), false);
  48. }
  49. else
  50. #endif
  51. {
  52. auto textColour = findColour (defaultTextColourId).withMultipliedAlpha (alpha);
  53. TextLayout textLayout;
  54. LookAndFeel_V3::createTabTextLayout (button, (float) area.getWidth(), (float) area.getHeight(), textColour, textLayout);
  55. textLayout.draw (g, button.getTextArea().toFloat());
  56. }
  57. }
  58. int ProjucerLookAndFeel::getTabButtonBestWidth (TabBarButton& button, int)
  59. {
  60. if (TabbedButtonBar* bar = button.findParentComponentOfClass<TabbedButtonBar>())
  61. return bar->getWidth() / bar->getNumTabs();
  62. return 120;
  63. }
  64. void ProjucerLookAndFeel::drawPropertyComponentLabel (Graphics& g, int width, int height, PropertyComponent& component)
  65. {
  66. ignoreUnused (width);
  67. g.setColour (component.findColour (defaultTextColourId)
  68. .withMultipliedAlpha (component.isEnabled() ? 1.0f : 0.6f));
  69. auto textWidth = getTextWidthForPropertyComponent (&component);
  70. g.setFont (getPropertyComponentFont());
  71. g.drawFittedText (component.getName(), 0, 0, textWidth - 5, height, Justification::centredLeft, 5, 1.0f);
  72. }
  73. Rectangle<int> ProjucerLookAndFeel::getPropertyComponentContentPosition (PropertyComponent& component)
  74. {
  75. const auto textW = getTextWidthForPropertyComponent (&component);
  76. return { textW, 0, component.getWidth() - textW, component.getHeight() - 1 };
  77. }
  78. void ProjucerLookAndFeel::drawButtonBackground (Graphics& g,
  79. Button& button,
  80. const Colour& backgroundColour,
  81. bool isMouseOverButton,
  82. bool isButtonDown)
  83. {
  84. const auto cornerSize = button.findParentComponentOfClass<PropertyComponent>() != nullptr ? 0.0f : 3.0f;
  85. const auto bounds = button.getLocalBounds().toFloat();
  86. auto baseColour = backgroundColour.withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.5f);
  87. if (isButtonDown || isMouseOverButton)
  88. baseColour = baseColour.contrasting (isButtonDown ? 0.2f : 0.05f);
  89. g.setColour (baseColour);
  90. if (button.isConnectedOnLeft() || button.isConnectedOnRight())
  91. {
  92. Path path;
  93. path.addRoundedRectangle (bounds.getX(), bounds.getY(),
  94. bounds.getWidth(), bounds.getHeight(),
  95. cornerSize, cornerSize,
  96. ! button.isConnectedOnLeft(),
  97. ! button.isConnectedOnRight(),
  98. ! button.isConnectedOnLeft(),
  99. ! button.isConnectedOnRight());
  100. g.fillPath (path);
  101. }
  102. else
  103. {
  104. g.fillRoundedRectangle (bounds, cornerSize);
  105. }
  106. }
  107. void ProjucerLookAndFeel::drawButtonText (Graphics& g, TextButton& button, bool isMouseOverButton, bool isButtonDown)
  108. {
  109. ignoreUnused (isMouseOverButton, isButtonDown);
  110. g.setFont (getTextButtonFont (button, button.getHeight()));
  111. g.setColour (button.findColour (button.getToggleState() ? TextButton::textColourOnId
  112. : TextButton::textColourOffId)
  113. .withMultipliedAlpha (button.isEnabled() ? 1.0f
  114. : 0.5f));
  115. auto xIndent = jmin (8, button.getWidth() / 10);
  116. auto yIndent = jmin (3, button.getHeight() / 6);
  117. auto textBounds = button.getLocalBounds().reduced (xIndent, yIndent);
  118. g.drawFittedText (button.getButtonText(), textBounds, Justification::centred, 3, 1.0f);
  119. }
  120. void ProjucerLookAndFeel::drawToggleButton (Graphics& g, ToggleButton& button, bool isMouseOverButton, bool isButtonDown)
  121. {
  122. ignoreUnused (isMouseOverButton, isButtonDown);
  123. if (! button.isEnabled())
  124. g.setOpacity (0.5f);
  125. bool isTextEmpty = button.getButtonText().isEmpty();
  126. bool isPropertyComponentChild = (dynamic_cast<BooleanPropertyComponent*> (button.getParentComponent()) != nullptr
  127. || dynamic_cast<MultiChoicePropertyComponent*> (button.getParentComponent()) != nullptr);
  128. auto bounds = button.getLocalBounds();
  129. auto sideLength = isPropertyComponentChild ? 25 : bounds.getHeight();
  130. auto rectBounds = isTextEmpty ? bounds
  131. : bounds.removeFromLeft (jmin (sideLength, bounds.getWidth() / 3));
  132. rectBounds = rectBounds.withSizeKeepingCentre (sideLength, sideLength).reduced (4);
  133. g.setColour (button.findColour (ToggleButton::tickDisabledColourId));
  134. g.drawRoundedRectangle (rectBounds.toFloat(), 2.0f, 1.0f);
  135. if (button.getToggleState())
  136. {
  137. g.setColour (button.findColour (ToggleButton::tickColourId));
  138. const auto tick = getTickShape (0.75f);
  139. g.fillPath (tick, tick.getTransformToScaleToFit (rectBounds.reduced (2).toFloat(), false));
  140. }
  141. if (! isTextEmpty)
  142. {
  143. bounds.removeFromLeft (5);
  144. const auto fontSize = jmin (15.0f, button.getHeight() * 0.75f);
  145. g.setFont (fontSize);
  146. g.setColour (isPropertyComponentChild ? findColour (widgetTextColourId)
  147. : button.findColour (ToggleButton::textColourId));
  148. g.drawFittedText (button.getButtonText(), bounds, Justification::centredLeft, 2);
  149. }
  150. }
  151. void ProjucerLookAndFeel::fillTextEditorBackground (Graphics& g, int width, int height, TextEditor& textEditor)
  152. {
  153. g.setColour (textEditor.findColour (TextEditor::backgroundColourId));
  154. g.fillRect (0, 0, width, height);
  155. g.setColour (textEditor.findColour (TextEditor::outlineColourId));
  156. g.drawHorizontalLine (height - 1, 0.0f, static_cast<float> (width));
  157. }
  158. void ProjucerLookAndFeel::layoutFileBrowserComponent (FileBrowserComponent& browserComp,
  159. DirectoryContentsDisplayComponent* fileListComponent,
  160. FilePreviewComponent* previewComp,
  161. ComboBox* currentPathBox,
  162. TextEditor* filenameBox,
  163. Button* goUpButton)
  164. {
  165. const auto sectionHeight = 22;
  166. const auto buttonWidth = 50;
  167. auto b = browserComp.getLocalBounds().reduced (20, 5);
  168. auto topSlice = b.removeFromTop (sectionHeight);
  169. auto bottomSlice = b.removeFromBottom (sectionHeight);
  170. currentPathBox->setBounds (topSlice.removeFromLeft (topSlice.getWidth() - buttonWidth));
  171. currentPathBox->setColour (ComboBox::backgroundColourId, findColour (backgroundColourId));
  172. currentPathBox->setColour (ComboBox::textColourId, findColour (defaultTextColourId));
  173. currentPathBox->setColour (ComboBox::arrowColourId, findColour (defaultTextColourId));
  174. topSlice.removeFromLeft (6);
  175. goUpButton->setBounds (topSlice);
  176. bottomSlice.removeFromLeft (50);
  177. filenameBox->setBounds (bottomSlice);
  178. filenameBox->setColour (TextEditor::backgroundColourId, findColour (backgroundColourId));
  179. filenameBox->setColour (TextEditor::textColourId, findColour (defaultTextColourId));
  180. filenameBox->setColour (TextEditor::outlineColourId, findColour (defaultTextColourId));
  181. filenameBox->applyFontToAllText (filenameBox->getFont());
  182. if (previewComp != nullptr)
  183. previewComp->setBounds (b.removeFromRight (b.getWidth() / 3));
  184. if (auto listAsComp = dynamic_cast<Component*> (fileListComponent))
  185. listAsComp->setBounds (b.reduced (0, 10));
  186. }
  187. void ProjucerLookAndFeel::drawFileBrowserRow (Graphics& g, int width, int height,
  188. const File& file, const String& filename, Image* icon,
  189. const String& fileSizeDescription,
  190. const String& fileTimeDescription,
  191. bool isDirectory, bool isItemSelected,
  192. int itemIndex, DirectoryContentsDisplayComponent& dcc)
  193. {
  194. if (auto fileListComp = dynamic_cast<Component*> (&dcc))
  195. {
  196. fileListComp->setColour (DirectoryContentsDisplayComponent::textColourId,
  197. findColour (isItemSelected ? defaultHighlightedTextColourId : defaultTextColourId));
  198. fileListComp->setColour (DirectoryContentsDisplayComponent::highlightColourId,
  199. findColour (defaultHighlightColourId).withAlpha (0.75f));
  200. }
  201. LookAndFeel_V2::drawFileBrowserRow (g, width, height, file, filename, icon,
  202. fileSizeDescription, fileTimeDescription,
  203. isDirectory, isItemSelected, itemIndex, dcc);
  204. }
  205. void ProjucerLookAndFeel::drawCallOutBoxBackground (CallOutBox&, Graphics& g, const Path& path, Image&)
  206. {
  207. g.setColour (findColour (secondaryBackgroundColourId));
  208. g.fillPath (path);
  209. g.setColour (findColour (userButtonBackgroundColourId));
  210. g.strokePath (path, PathStrokeType (2.0f));
  211. }
  212. void ProjucerLookAndFeel::drawMenuBarBackground (Graphics& g, int width, int height,
  213. bool, MenuBarComponent& menuBar)
  214. {
  215. const auto colour = menuBar.findColour (backgroundColourId).withAlpha (0.75f);
  216. Rectangle<int> r (width, height);
  217. g.setColour (colour.contrasting (0.15f));
  218. g.fillRect (r.removeFromTop (1));
  219. g.fillRect (r.removeFromBottom (1));
  220. g.setGradientFill (ColourGradient (colour, 0, 0, colour.darker (0.2f), 0, (float)height, false));
  221. g.fillRect (r);
  222. }
  223. void ProjucerLookAndFeel::drawMenuBarItem (Graphics& g, int width, int height,
  224. int itemIndex, const String& itemText,
  225. bool isMouseOverItem, bool isMenuOpen,
  226. bool /*isMouseOverBar*/, MenuBarComponent& menuBar)
  227. {
  228. if (! menuBar.isEnabled())
  229. {
  230. g.setColour (menuBar.findColour (defaultTextColourId)
  231. .withMultipliedAlpha (0.5f));
  232. }
  233. else if (isMenuOpen || isMouseOverItem)
  234. {
  235. g.fillAll (menuBar.findColour (defaultHighlightColourId).withAlpha (0.75f));
  236. g.setColour (menuBar.findColour (defaultHighlightedTextColourId));
  237. }
  238. else
  239. {
  240. g.setColour (menuBar.findColour (defaultTextColourId));
  241. }
  242. g.setFont (getMenuBarFont (menuBar, itemIndex, itemText));
  243. g.drawFittedText (itemText, 0, 0, width, height, Justification::centred, 1);
  244. }
  245. void ProjucerLookAndFeel::drawResizableFrame (Graphics& g, int w, int h, const BorderSize<int>& border)
  246. {
  247. ignoreUnused (g, w, h, border);
  248. }
  249. void ProjucerLookAndFeel::drawComboBox (Graphics& g, int width, int height, bool,
  250. int, int, int, int, ComboBox& box)
  251. {
  252. const auto cornerSize = box.findParentComponentOfClass<ChoicePropertyComponent>() != nullptr ? 0.0f : 1.5f;
  253. Rectangle<int> boxBounds (0, 0, width, height);
  254. auto isChoiceCompChild = (box.findParentComponentOfClass<ChoicePropertyComponent>() != nullptr);
  255. if (isChoiceCompChild)
  256. {
  257. box.setColour (ComboBox::textColourId, findColour (widgetTextColourId));
  258. g.setColour (findColour (widgetBackgroundColourId));
  259. g.fillRect (boxBounds);
  260. auto arrowZone = boxBounds.removeFromRight (boxBounds.getHeight()).reduced (0, 2).toFloat();
  261. g.setColour (Colours::black);
  262. g.fillPath (getChoiceComponentArrowPath (arrowZone));
  263. }
  264. else
  265. {
  266. g.setColour (box.findColour (ComboBox::outlineColourId));
  267. g.drawRoundedRectangle (boxBounds.toFloat().reduced (0.5f, 0.5f), cornerSize, 1.0f);
  268. auto arrowZone = boxBounds.removeFromRight (boxBounds.getHeight()).toFloat();
  269. g.setColour (box.findColour (ComboBox::arrowColourId).withAlpha ((box.isEnabled() ? 0.9f : 0.2f)));
  270. g.fillPath (getArrowPath (arrowZone, 2, true, Justification::centred));
  271. }
  272. }
  273. void ProjucerLookAndFeel::drawTreeviewPlusMinusBox (Graphics& g, const Rectangle<float>& area,
  274. Colour, bool isOpen, bool /**isMouseOver*/)
  275. {
  276. g.strokePath (getArrowPath (area, isOpen ? 2 : 1, false, Justification::centredRight), PathStrokeType (2.0f));
  277. }
  278. void ProjucerLookAndFeel::drawProgressBar (Graphics& g, ProgressBar& progressBar,
  279. int width, int height, double progress, const String& textToShow)
  280. {
  281. ignoreUnused (width, height, progress);
  282. const auto background = progressBar.findColour (ProgressBar::backgroundColourId);
  283. const auto foreground = progressBar.findColour (defaultButtonBackgroundColourId);
  284. const auto sideLength = jmin (width, height);
  285. auto barBounds = progressBar.getLocalBounds().withSizeKeepingCentre (sideLength, sideLength).reduced (1).toFloat();
  286. auto rotationInDegrees = static_cast<float> ((Time::getMillisecondCounter() / 10) % 360);
  287. auto normalisedRotation = rotationInDegrees / 360.0f;
  288. const auto rotationOffset = 22.5f;
  289. const auto maxRotation = 315.0f;
  290. auto startInDegrees = rotationInDegrees;
  291. auto endInDegrees = startInDegrees + rotationOffset;
  292. if (normalisedRotation >= 0.25f && normalisedRotation < 0.5f)
  293. {
  294. const auto rescaledRotation = (normalisedRotation * 4.0f) - 1.0f;
  295. endInDegrees = startInDegrees + rotationOffset + (maxRotation * rescaledRotation);
  296. }
  297. else if (normalisedRotation >= 0.5f && normalisedRotation <= 1.0f)
  298. {
  299. endInDegrees = startInDegrees + rotationOffset + maxRotation;
  300. const auto rescaledRotation = 1.0f - ((normalisedRotation * 2.0f) - 1.0f);
  301. startInDegrees = endInDegrees - rotationOffset - (maxRotation * rescaledRotation);
  302. }
  303. g.setColour (background);
  304. Path arcPath2;
  305. arcPath2.addCentredArc (barBounds.getCentreX(),
  306. barBounds.getCentreY(),
  307. barBounds.getWidth() * 0.5f,
  308. barBounds.getHeight() * 0.5f, 0.0f,
  309. 0.0f,
  310. MathConstants<float>::twoPi,
  311. true);
  312. g.strokePath (arcPath2, PathStrokeType (2.0f));
  313. g.setColour (foreground);
  314. Path arcPath;
  315. arcPath.addCentredArc (barBounds.getCentreX(),
  316. barBounds.getCentreY(),
  317. barBounds.getWidth() * 0.5f,
  318. barBounds.getHeight() * 0.5f,
  319. 0.0f,
  320. degreesToRadians (startInDegrees),
  321. degreesToRadians (endInDegrees),
  322. true);
  323. arcPath.applyTransform (AffineTransform::rotation (normalisedRotation * MathConstants<float>::pi * 2.25f,
  324. barBounds.getCentreX(), barBounds.getCentreY()));
  325. g.strokePath (arcPath, PathStrokeType (2.0f));
  326. if (textToShow.isNotEmpty())
  327. {
  328. g.setColour (progressBar.findColour (TextButton::textColourOffId));
  329. g.setFont (Font (12.0f, 2));
  330. g.drawText (textToShow, barBounds, Justification::centred, false);
  331. }
  332. }
  333. //==============================================================================
  334. Path ProjucerLookAndFeel::getArrowPath (Rectangle<float> arrowZone, const int direction,
  335. bool filled, const Justification justification)
  336. {
  337. auto w = jmin (arrowZone.getWidth(), (direction == 0 || direction == 2) ? 8.0f : filled ? 5.0f : 8.0f);
  338. auto h = jmin (arrowZone.getHeight(), (direction == 0 || direction == 2) ? 5.0f : filled ? 8.0f : 5.0f);
  339. if (justification == Justification::centred)
  340. {
  341. arrowZone.reduce ((arrowZone.getWidth() - w) / 2, (arrowZone.getHeight() - h) / 2);
  342. }
  343. else if (justification == Justification::centredRight)
  344. {
  345. arrowZone.removeFromLeft (arrowZone.getWidth() - w);
  346. arrowZone.reduce (0, (arrowZone.getHeight() - h) / 2);
  347. }
  348. else if (justification == Justification::centredLeft)
  349. {
  350. arrowZone.removeFromRight (arrowZone.getWidth() - w);
  351. arrowZone.reduce (0, (arrowZone.getHeight() - h) / 2);
  352. }
  353. else
  354. {
  355. jassertfalse; // currently only supports centred justifications
  356. }
  357. Path path;
  358. path.startNewSubPath (arrowZone.getX(), arrowZone.getBottom());
  359. path.lineTo (arrowZone.getCentreX(), arrowZone.getY());
  360. path.lineTo (arrowZone.getRight(), arrowZone.getBottom());
  361. if (filled)
  362. path.closeSubPath();
  363. path.applyTransform (AffineTransform::rotation (direction * MathConstants<float>::halfPi,
  364. 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() || colourScheme == getProjucerDarkColourScheme())
  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 = getProjucerDarkColourScheme();
  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, Colours::orange);
  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. setColour (0x1000440, /*LassoComponent::lassoFillColourId*/ findColour (defaultHighlightColourId).withAlpha (0.3f));
  470. }