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.

595 lines
28KB

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