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.

586 lines
27KB

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