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