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