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.

82 lines
3.1KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCER_APPEARANCESETTINGS_H_34D762C7__
  19. #define __JUCER_APPEARANCESETTINGS_H_34D762C7__
  20. class AppearanceSettings : private ValueTree::Listener
  21. {
  22. public:
  23. AppearanceSettings (const CodeEditorComponent& editorToCopyFrom);
  24. bool readFromFile (const File& file);
  25. bool readFromXML (const XmlElement&);
  26. bool writeToFile (const File& file) const;
  27. void applyToLookAndFeel (LookAndFeel&) const;
  28. void applyToCodeEditor (CodeEditorComponent& editor) const;
  29. StringArray getColourNames() const;
  30. Value getColourValue (const String& colourName);
  31. bool getColour (const String& name, Colour& resultIfFound) const;
  32. Font getCodeFont() const;
  33. Value getCodeFontValue();
  34. ValueTree settings;
  35. static Component* createEditorWindow();
  36. static void intialiseLookAndFeel (LookAndFeel&);
  37. private:
  38. void updateColourScheme();
  39. void valueTreePropertyChanged (ValueTree&, const Identifier&) { updateColourScheme(); }
  40. void valueTreeChildAdded (ValueTree&, ValueTree&) { updateColourScheme(); }
  41. void valueTreeChildRemoved (ValueTree&, ValueTree&) { updateColourScheme(); }
  42. void valueTreeChildOrderChanged (ValueTree&) { updateColourScheme(); }
  43. void valueTreeParentChanged (ValueTree&) { updateColourScheme(); }
  44. void valueTreeRedirected (ValueTree&) { updateColourScheme(); }
  45. };
  46. //==============================================================================
  47. class IntrojucerLookAndFeel : public LookAndFeel
  48. {
  49. public:
  50. IntrojucerLookAndFeel();
  51. void drawStretchableLayoutResizerBar (Graphics& g, int /*w*/, int /*h*/, bool /*isVerticalBar*/, bool isMouseOver, bool isMouseDragging)
  52. {
  53. if (isMouseOver || isMouseDragging)
  54. g.fillAll (Colours::grey.withAlpha (0.4f));
  55. }
  56. Rectangle<int> getPropertyComponentContentPosition (PropertyComponent& component);
  57. };
  58. #endif