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.

581 lines
27KB

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