The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

579 lines
27KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. JUCE is an open source library subject to commercial or open-source
  6. licensing.
  7. By using JUCE, you agree to the terms of both the JUCE 5 End-User License
  8. Agreement and JUCE 5 Privacy Policy (both updated and effective as of the
  9. 27th April 2017).
  10. End User License Agreement: www.juce.com/juce-5-licence
  11. Privacy Policy: www.juce.com/juce-5-privacy-policy
  12. Or: You may also use this code under the terms of the GPL v3 (see
  13. www.gnu.org/licenses).
  14. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  15. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  16. DISCLAIMED.
  17. ==============================================================================
  18. */
  19. #include "../../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.withMultipliedSaturation (button.hasKeyboardFocus (true) ? 1.3f : 0.9f)
  87. .withMultipliedAlpha (button.isEnabled() ? 1.0f : 0.5f);
  88. if (isButtonDown || isMouseOverButton)
  89. baseColour = baseColour.contrasting (isButtonDown ? 0.2f : 0.05f);
  90. g.setColour (baseColour);
  91. if (button.isConnectedOnLeft() || button.isConnectedOnRight())
  92. {
  93. Path path;
  94. path.addRoundedRectangle (bounds.getX(), bounds.getY(),
  95. bounds.getWidth(), bounds.getHeight(),
  96. cornerSize, cornerSize,
  97. ! button.isConnectedOnLeft(),
  98. ! button.isConnectedOnRight(),
  99. ! button.isConnectedOnLeft(),
  100. ! button.isConnectedOnRight());
  101. g.fillPath (path);
  102. }
  103. else
  104. {
  105. g.fillRoundedRectangle (bounds, cornerSize);
  106. }
  107. }
  108. void ProjucerLookAndFeel::drawButtonText (Graphics& g, TextButton& button, bool isMouseOverButton, bool isButtonDown)
  109. {
  110. ignoreUnused (isMouseOverButton, isButtonDown);
  111. g.setFont (getTextButtonFont (button, button.getHeight()));
  112. g.setColour (button.findColour (button.getToggleState() ? TextButton::textColourOnId
  113. : TextButton::textColourOffId)
  114. .withMultipliedAlpha (button.isEnabled() ? 1.0f
  115. : 0.5f));
  116. auto xIndent = jmin (8, button.getWidth() / 10);
  117. auto yIndent = jmin (3, button.getHeight() / 6);
  118. auto textBounds = button.getLocalBounds().reduced (xIndent, yIndent);
  119. g.drawFittedText (button.getButtonText(), textBounds, Justification::centred, 3, 1.0f);
  120. }
  121. void ProjucerLookAndFeel::drawToggleButton (Graphics& g, ToggleButton& button, bool isMouseOverButton, bool isButtonDown)
  122. {
  123. ignoreUnused (isMouseOverButton, isButtonDown);
  124. if (! button.isEnabled())
  125. g.setOpacity (0.5f);
  126. bool isTextEmpty = button.getButtonText().isEmpty();
  127. bool isPropertyComponentChild = (dynamic_cast<BooleanPropertyComponent*> (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. Font ProjucerLookAndFeel::getTextButtonFont (TextButton&, int buttonHeight)
  152. {
  153. return Font (jmin (12.0f, buttonHeight * 0.6f));
  154. }
  155. void ProjucerLookAndFeel::fillTextEditorBackground (Graphics& g, int width, int height, TextEditor& textEditor)
  156. {
  157. g.setColour (textEditor.findColour (TextEditor::backgroundColourId));
  158. g.fillRect (0, 0, width, height);
  159. g.setColour (textEditor.findColour (TextEditor::outlineColourId));
  160. g.drawHorizontalLine (height - 1, 0.0f, static_cast<float> (width));
  161. }
  162. void ProjucerLookAndFeel::layoutFileBrowserComponent (FileBrowserComponent& browserComp,
  163. DirectoryContentsDisplayComponent* fileListComponent,
  164. FilePreviewComponent* previewComp,
  165. ComboBox* currentPathBox,
  166. TextEditor* filenameBox,
  167. Button* goUpButton)
  168. {
  169. const auto sectionHeight = 22;
  170. const auto buttonWidth = 50;
  171. auto b = browserComp.getLocalBounds().reduced (20, 5);
  172. auto topSlice = b.removeFromTop (sectionHeight);
  173. auto bottomSlice = b.removeFromBottom (sectionHeight);
  174. currentPathBox->setBounds (topSlice.removeFromLeft (topSlice.getWidth() - buttonWidth));
  175. currentPathBox->setColour (ComboBox::backgroundColourId, findColour (backgroundColourId));
  176. currentPathBox->setColour (ComboBox::textColourId, findColour (defaultTextColourId));
  177. currentPathBox->setColour (ComboBox::arrowColourId, findColour (defaultTextColourId));
  178. topSlice.removeFromLeft (6);
  179. goUpButton->setBounds (topSlice);
  180. bottomSlice.removeFromLeft (50);
  181. filenameBox->setBounds (bottomSlice);
  182. filenameBox->setColour (TextEditor::backgroundColourId, findColour (backgroundColourId));
  183. filenameBox->setColour (TextEditor::textColourId, findColour (defaultTextColourId));
  184. filenameBox->setColour (TextEditor::outlineColourId, findColour (defaultTextColourId));
  185. filenameBox->applyFontToAllText (filenameBox->getFont());
  186. if (previewComp != nullptr)
  187. previewComp->setBounds (b.removeFromRight (b.getWidth() / 3));
  188. if (auto listAsComp = dynamic_cast<Component*> (fileListComponent))
  189. listAsComp->setBounds (b.reduced (0, 10));
  190. }
  191. void ProjucerLookAndFeel::drawFileBrowserRow (Graphics& g, int width, int height,
  192. const File& file, const String& filename, Image* icon,
  193. const String& fileSizeDescription,
  194. const String& fileTimeDescription,
  195. bool isDirectory, bool isItemSelected,
  196. int itemIndex, DirectoryContentsDisplayComponent& dcc)
  197. {
  198. if (auto fileListComp = dynamic_cast<Component*> (&dcc))
  199. {
  200. fileListComp->setColour (DirectoryContentsDisplayComponent::textColourId,
  201. findColour (isItemSelected ? defaultHighlightedTextColourId : defaultTextColourId));
  202. fileListComp->setColour (DirectoryContentsDisplayComponent::highlightColourId,
  203. findColour (defaultHighlightColourId).withAlpha (0.75f));
  204. }
  205. LookAndFeel_V2::drawFileBrowserRow (g, width, height, file, filename, icon,
  206. fileSizeDescription, fileTimeDescription,
  207. isDirectory, isItemSelected, itemIndex, dcc);
  208. }
  209. void ProjucerLookAndFeel::drawCallOutBoxBackground (CallOutBox&, Graphics& g, const Path& path, Image&)
  210. {
  211. g.setColour (findColour (secondaryBackgroundColourId));
  212. g.fillPath (path);
  213. g.setColour (findColour (userButtonBackgroundColourId));
  214. g.strokePath (path, PathStrokeType (2.0f));
  215. }
  216. void ProjucerLookAndFeel::drawMenuBarBackground (Graphics& g, int width, int height,
  217. bool, MenuBarComponent& menuBar)
  218. {
  219. const auto colour = menuBar.findColour (backgroundColourId).withAlpha (0.75f);
  220. Rectangle<int> r (width, height);
  221. g.setColour (colour.contrasting (0.15f));
  222. g.fillRect (r.removeFromTop (1));
  223. g.fillRect (r.removeFromBottom (1));
  224. g.setGradientFill (ColourGradient (colour, 0, 0, colour.darker (0.2f), 0, (float)height, false));
  225. g.fillRect (r);
  226. }
  227. void ProjucerLookAndFeel::drawMenuBarItem (Graphics& g, int width, int height,
  228. int itemIndex, const String& itemText,
  229. bool isMouseOverItem, bool isMenuOpen,
  230. bool /*isMouseOverBar*/, MenuBarComponent& menuBar)
  231. {
  232. if (! menuBar.isEnabled())
  233. {
  234. g.setColour (menuBar.findColour (defaultTextColourId)
  235. .withMultipliedAlpha (0.5f));
  236. }
  237. else if (isMenuOpen || isMouseOverItem)
  238. {
  239. g.fillAll (menuBar.findColour (defaultHighlightColourId).withAlpha (0.75f));
  240. g.setColour (menuBar.findColour (defaultHighlightedTextColourId));
  241. }
  242. else
  243. {
  244. g.setColour (menuBar.findColour (defaultTextColourId));
  245. }
  246. g.setFont (getMenuBarFont (menuBar, itemIndex, itemText));
  247. g.drawFittedText (itemText, 0, 0, width, height, Justification::centred, 1);
  248. }
  249. void ProjucerLookAndFeel::drawResizableFrame (Graphics& g, int w, int h, const BorderSize<int>& border)
  250. {
  251. ignoreUnused (g, w, h, border);
  252. }
  253. void ProjucerLookAndFeel::drawComboBox (Graphics& g, int width, int height, bool,
  254. int, int, int, int, ComboBox& box)
  255. {
  256. const auto cornerSize = box.findParentComponentOfClass<ChoicePropertyComponent>() != nullptr ? 0.0f : 1.5f;
  257. Rectangle<int> boxBounds (0, 0, width, height);
  258. auto isChoiceCompChild = (box.findParentComponentOfClass<ChoicePropertyComponent>() != nullptr);
  259. if (isChoiceCompChild)
  260. {
  261. box.setColour (ComboBox::textColourId, findColour (widgetTextColourId));
  262. g.setColour (findColour (widgetBackgroundColourId));
  263. g.fillRect (boxBounds);
  264. auto arrowZone = boxBounds.removeFromRight (boxBounds.getHeight()).reduced (0, 2).toFloat();
  265. g.setColour (Colours::black);
  266. g.fillPath (getChoiceComponentArrowPath (arrowZone));
  267. }
  268. else
  269. {
  270. g.setColour (box.findColour (ComboBox::outlineColourId));
  271. g.drawRoundedRectangle (boxBounds.toFloat().reduced (0.5f, 0.5f), cornerSize, 1.0f);
  272. auto arrowZone = boxBounds.removeFromRight (boxBounds.getHeight()).toFloat();
  273. g.setColour (box.findColour (ComboBox::arrowColourId).withAlpha ((box.isEnabled() ? 0.9f : 0.2f)));
  274. g.fillPath (getArrowPath (arrowZone, 2, true, Justification::centred));
  275. }
  276. }
  277. void ProjucerLookAndFeel::drawTreeviewPlusMinusBox (Graphics& g, const Rectangle<float>& area,
  278. Colour, bool isOpen, bool /**isMouseOver*/)
  279. {
  280. g.strokePath (getArrowPath (area, isOpen ? 2 : 1, false, Justification::centredRight), PathStrokeType (2.0f));
  281. }
  282. void ProjucerLookAndFeel::drawProgressBar (Graphics& g, ProgressBar& progressBar,
  283. int width, int height, double progress, const String& textToShow)
  284. {
  285. ignoreUnused (width, height, progress);
  286. const auto background = progressBar.findColour (ProgressBar::backgroundColourId);
  287. const auto foreground = progressBar.findColour (defaultButtonBackgroundColourId);
  288. const auto sideLength = jmin (width, height);
  289. auto barBounds = progressBar.getLocalBounds().withSizeKeepingCentre (sideLength, sideLength).reduced (1).toFloat();
  290. auto rotationInDegrees = static_cast<float> ((Time::getMillisecondCounter() / 10) % 360);
  291. auto normalisedRotation = rotationInDegrees / 360.0f;
  292. const auto rotationOffset = 22.5f;
  293. const auto maxRotation = 315.0f;
  294. auto startInDegrees = rotationInDegrees;
  295. auto endInDegrees = startInDegrees + rotationOffset;
  296. if (normalisedRotation >= 0.25f && normalisedRotation < 0.5f)
  297. {
  298. const auto rescaledRotation = (normalisedRotation * 4.0f) - 1.0f;
  299. endInDegrees = startInDegrees + rotationOffset + (maxRotation * rescaledRotation);
  300. }
  301. else if (normalisedRotation >= 0.5f && normalisedRotation <= 1.0f)
  302. {
  303. endInDegrees = startInDegrees + rotationOffset + maxRotation;
  304. const auto rescaledRotation = 1.0f - ((normalisedRotation * 2.0f) - 1.0f);
  305. startInDegrees = endInDegrees - rotationOffset - (maxRotation * rescaledRotation);
  306. }
  307. g.setColour (background);
  308. Path arcPath2;
  309. arcPath2.addCentredArc (barBounds.getCentreX(),
  310. barBounds.getCentreY(),
  311. barBounds.getWidth() * 0.5f,
  312. barBounds.getHeight() * 0.5f, 0.0f,
  313. 0.0f,
  314. 2.0f * float_Pi,
  315. true);
  316. g.strokePath (arcPath2, PathStrokeType (2.0f));
  317. g.setColour (foreground);
  318. Path arcPath;
  319. arcPath.addCentredArc (barBounds.getCentreX(),
  320. barBounds.getCentreY(),
  321. barBounds.getWidth() * 0.5f,
  322. barBounds.getHeight() * 0.5f,
  323. 0.0f,
  324. degreesToRadians (startInDegrees),
  325. degreesToRadians (endInDegrees),
  326. true);
  327. arcPath.applyTransform (AffineTransform::rotation (normalisedRotation * float_Pi * 2.25f, barBounds.getCentreX(), barBounds.getCentreY()));
  328. g.strokePath (arcPath, PathStrokeType (2.0f));
  329. if (textToShow.isNotEmpty())
  330. {
  331. g.setColour (progressBar.findColour (TextButton::textColourOffId));
  332. g.setFont (Font (12.0f, 2));
  333. g.drawText (textToShow, barBounds, Justification::centred, false);
  334. }
  335. }
  336. //==============================================================================
  337. Path ProjucerLookAndFeel::getArrowPath (Rectangle<float> arrowZone, const int direction,
  338. bool filled, const Justification justification)
  339. {
  340. auto w = jmin (arrowZone.getWidth(), (direction == 0 || direction == 2) ? 8.0f : filled ? 5.0f : 8.0f);
  341. auto h = jmin (arrowZone.getHeight(), (direction == 0 || direction == 2) ? 5.0f : filled ? 8.0f : 5.0f);
  342. if (justification == Justification::centred)
  343. {
  344. arrowZone.reduce ((arrowZone.getWidth() - w) / 2, (arrowZone.getHeight() - h) / 2);
  345. }
  346. else if (justification == Justification::centredRight)
  347. {
  348. arrowZone.removeFromLeft (arrowZone.getWidth() - w);
  349. arrowZone.reduce (0, (arrowZone.getHeight() - h) / 2);
  350. }
  351. else if (justification == Justification::centredLeft)
  352. {
  353. arrowZone.removeFromRight (arrowZone.getWidth() - w);
  354. arrowZone.reduce (0, (arrowZone.getHeight() - h) / 2);
  355. }
  356. else
  357. {
  358. jassertfalse; // currently only supports centred justifications
  359. }
  360. Path path;
  361. path.startNewSubPath (arrowZone.getX(), arrowZone.getBottom());
  362. path.lineTo (arrowZone.getCentreX(), arrowZone.getY());
  363. path.lineTo (arrowZone.getRight(), arrowZone.getBottom());
  364. if (filled)
  365. path.closeSubPath();
  366. path.applyTransform (AffineTransform::rotation (direction * (float_Pi / 2.0f), arrowZone.getCentreX(), arrowZone.getCentreY()));
  367. return path;
  368. }
  369. Path ProjucerLookAndFeel::getChoiceComponentArrowPath (Rectangle<float> arrowZone)
  370. {
  371. auto topBounds = arrowZone.removeFromTop (arrowZone.getHeight() * 0.5f);
  372. auto bottomBounds = arrowZone;
  373. auto topArrow = getArrowPath (topBounds, 0, true, Justification::centred);
  374. auto bottomArrow = getArrowPath (bottomBounds, 2, true, Justification::centred);
  375. topArrow.addPath (bottomArrow);
  376. return topArrow;
  377. }
  378. //==============================================================================
  379. void ProjucerLookAndFeel::setupColours()
  380. {
  381. auto& colourScheme = getCurrentColourScheme();
  382. if (colourScheme == getDarkColourScheme())
  383. {
  384. setColour (backgroundColourId, Colour (0xff323e44));
  385. setColour (secondaryBackgroundColourId, Colour (0xff263238));
  386. setColour (defaultTextColourId, Colours::white);
  387. setColour (widgetTextColourId, Colours::white);
  388. setColour (defaultButtonBackgroundColourId, Colour (0xffa45c94));
  389. setColour (secondaryButtonBackgroundColourId, Colours::black);
  390. setColour (userButtonBackgroundColourId, Colour (0xffa45c94));
  391. setColour (defaultIconColourId, Colours::white);
  392. setColour (treeIconColourId, Colour (0xffa9a9a9));
  393. setColour (defaultHighlightColourId, Colour (0xffe0ec65));
  394. setColour (defaultHighlightedTextColourId, Colours::black);
  395. setColour (codeEditorLineNumberColourId, Colour (0xffaaaaaa));
  396. setColour (activeTabIconColourId, Colours::white);
  397. setColour (inactiveTabBackgroundColourId, Colour (0xff181f22));
  398. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  399. setColour (contentHeaderBackgroundColourId, Colours::black);
  400. setColour (widgetBackgroundColourId, Colour (0xff495358));
  401. setColour (secondaryWidgetBackgroundColourId, Colour (0xff303b41));
  402. colourScheme.setUIColour (LookAndFeel_V4::ColourScheme::UIColour::defaultFill, Colour (0xffa45c94));
  403. }
  404. else if (colourScheme == getGreyColourScheme())
  405. {
  406. setColour (backgroundColourId, Colour (0xff505050));
  407. setColour (secondaryBackgroundColourId, Colour (0xff424241));
  408. setColour (defaultTextColourId, Colours::white);
  409. setColour (widgetTextColourId, Colours::black);
  410. setColour (defaultButtonBackgroundColourId, Colour (0xff26ba90));
  411. setColour (secondaryButtonBackgroundColourId, Colours::black);
  412. setColour (userButtonBackgroundColourId, Colour (0xff26ba90));
  413. setColour (defaultIconColourId, Colours::white);
  414. setColour (treeIconColourId, Colour (0xffa9a9a9));
  415. setColour (defaultHighlightColourId, Colour (0xffe0ec65));
  416. setColour (defaultHighlightedTextColourId, Colours::black);
  417. setColour (codeEditorLineNumberColourId, Colour (0xffaaaaaa));
  418. setColour (activeTabIconColourId, Colours::white);
  419. setColour (inactiveTabBackgroundColourId, Colour (0xff373737));
  420. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  421. setColour (contentHeaderBackgroundColourId, Colours::black);
  422. setColour (widgetBackgroundColourId, Colours::white);
  423. setColour (secondaryWidgetBackgroundColourId, Colour (0xffdddddd));
  424. }
  425. else if (colourScheme == getLightColourScheme())
  426. {
  427. setColour (backgroundColourId, Colour (0xffefefef));
  428. setColour (secondaryBackgroundColourId, Colour (0xfff9f9f9));
  429. setColour (defaultTextColourId, Colours::black);
  430. setColour (widgetTextColourId, Colours::black);
  431. setColour (defaultButtonBackgroundColourId, Colour (0xff42a2c8));
  432. setColour (secondaryButtonBackgroundColourId, Colour (0xffa1c677));
  433. setColour (userButtonBackgroundColourId, Colour (0xff42a2c8));
  434. setColour (defaultIconColourId, Colours::white);
  435. setColour (treeIconColourId, Colour (0xffa9a9a9));
  436. setColour (defaultHighlightColourId, Colour (0xffffd05b));
  437. setColour (defaultHighlightedTextColourId, Colour (0xff585656));
  438. setColour (codeEditorLineNumberColourId, Colour (0xff888888));
  439. setColour (activeTabIconColourId, Colour (0xff42a2c8));
  440. setColour (inactiveTabBackgroundColourId, Colour (0xffd5d5d5));
  441. setColour (inactiveTabIconColourId, Colour (0xffa9a9a9));
  442. setColour (contentHeaderBackgroundColourId, Colour (0xff42a2c8));
  443. setColour (widgetBackgroundColourId, Colours::white);
  444. setColour (secondaryWidgetBackgroundColourId, Colour (0xfff4f4f4));
  445. }
  446. setColour (Label::textColourId, findColour (defaultTextColourId));
  447. setColour (Label::textWhenEditingColourId, findColour (widgetTextColourId));
  448. setColour (TextEditor::highlightColourId, findColour (defaultHighlightColourId).withAlpha (0.75f));
  449. setColour (TextEditor::highlightedTextColourId, findColour (defaultHighlightedTextColourId));
  450. setColour (TextEditor::outlineColourId, Colours::transparentBlack);
  451. setColour (TextEditor::focusedOutlineColourId, Colours::transparentBlack);
  452. setColour (TextEditor::backgroundColourId, findColour (widgetBackgroundColourId));
  453. setColour (TextEditor::textColourId, findColour (widgetTextColourId));
  454. setColour (TextButton::buttonColourId, findColour (defaultButtonBackgroundColourId));
  455. setColour (ScrollBar::ColourIds::thumbColourId, Colour (0xffd0d8e0));
  456. setColour (TextPropertyComponent::outlineColourId, Colours::transparentBlack);
  457. setColour (TextPropertyComponent::backgroundColourId, findColour (widgetBackgroundColourId));
  458. setColour (TextPropertyComponent::textColourId, findColour (widgetTextColourId));
  459. setColour (BooleanPropertyComponent::outlineColourId, Colours::transparentBlack);
  460. setColour (BooleanPropertyComponent::backgroundColourId, findColour (widgetBackgroundColourId));
  461. setColour (ToggleButton::tickDisabledColourId, Colour (0xffa9a9a9));
  462. setColour (ToggleButton::tickColourId, findColour (defaultButtonBackgroundColourId).withMultipliedBrightness(1.3f));
  463. setColour (CodeEditorComponent::backgroundColourId, findColour (secondaryBackgroundColourId));
  464. setColour (CodeEditorComponent::lineNumberTextId, findColour (codeEditorLineNumberColourId));
  465. setColour (CodeEditorComponent::lineNumberBackgroundId, findColour (backgroundColourId));
  466. setColour (CodeEditorComponent::highlightColourId, findColour (defaultHighlightColourId).withAlpha (0.5f));
  467. setColour (CaretComponent::caretColourId, findColour (defaultButtonBackgroundColourId));
  468. setColour (TreeView::selectedItemBackgroundColourId, findColour (defaultHighlightColourId));
  469. setColour (PopupMenu::highlightedBackgroundColourId, findColour (defaultHighlightColourId).withAlpha (0.75f));
  470. setColour (PopupMenu::highlightedTextColourId, findColour (defaultHighlightedTextColourId));
  471. setColour (0x1000440, /*LassoComponent::lassoFillColourId*/ findColour (defaultHighlightColourId).withAlpha (0.3f));
  472. }