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.

590 lines
27KB

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