| @@ -114,7 +114,7 @@ double ColourGradient::getColourPosition (const int index) const noexcept | |||||
| return 0; | return 0; | ||||
| } | } | ||||
| const Colour ColourGradient::getColour (const int index) const noexcept | |||||
| Colour ColourGradient::getColour (const int index) const noexcept | |||||
| { | { | ||||
| if (isPositiveAndBelow (index, colours.size())) | if (isPositiveAndBelow (index, colours.size())) | ||||
| return colours.getReference (index).colour; | return colours.getReference (index).colour; | ||||
| @@ -112,7 +112,7 @@ public: | |||||
| /** Returns the colour that was added with a given index. | /** Returns the colour that was added with a given index. | ||||
| The index is from 0 to getNumColours() - 1. | The index is from 0 to getNumColours() - 1. | ||||
| */ | */ | ||||
| const Colour getColour (int index) const noexcept; | |||||
| Colour getColour (int index) const noexcept; | |||||
| /** Changes the colour at a given index. | /** Changes the colour at a given index. | ||||
| The index is from 0 to getNumColours() - 1. | The index is from 0 to getNumColours() - 1. | ||||
| @@ -168,8 +168,8 @@ const Colour Colours::yellow (0xffffff00); | |||||
| const Colour Colours::yellowgreen (0xff9acd32); | const Colour Colours::yellowgreen (0xff9acd32); | ||||
| //============================================================================== | //============================================================================== | ||||
| const Colour Colours::findColourForName (const String& colourName, | |||||
| const Colour& defaultColour) | |||||
| Colour Colours::findColourForName (const String& colourName, | |||||
| const Colour& defaultColour) | |||||
| { | { | ||||
| static const int presets[] = | static const int presets[] = | ||||
| { | { | ||||
| @@ -95,8 +95,8 @@ public: | |||||
| if a match is found, that colour is returned. If no match is found, the | if a match is found, that colour is returned. If no match is found, the | ||||
| colour passed in as the defaultColour parameter is returned. | colour passed in as the defaultColour parameter is returned. | ||||
| */ | */ | ||||
| static JUCE_API const Colour findColourForName (const String& colourName, | |||||
| const Colour& defaultColour); | |||||
| static JUCE_API Colour findColourForName (const String& colourName, | |||||
| const Colour& defaultColour); | |||||
| private: | private: | ||||
| //============================================================================== | //============================================================================== | ||||
| @@ -373,7 +373,7 @@ Image::BitmapData::~BitmapData() | |||||
| { | { | ||||
| } | } | ||||
| const Colour Image::BitmapData::getPixelColour (const int x, const int y) const noexcept | |||||
| Colour Image::BitmapData::getPixelColour (const int x, const int y) const noexcept | |||||
| { | { | ||||
| jassert (isPositiveAndBelow (x, width) && isPositiveAndBelow (y, height)); | jassert (isPositiveAndBelow (x, width) && isPositiveAndBelow (y, height)); | ||||
| @@ -338,7 +338,7 @@ public: | |||||
| For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's | For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's | ||||
| repsonsibility to make sure they're within the image's size. | repsonsibility to make sure they're within the image's size. | ||||
| */ | */ | ||||
| const Colour getPixelColour (int x, int y) const noexcept; | |||||
| Colour getPixelColour (int x, int y) const noexcept; | |||||
| /** Sets the colour of a given pixel. | /** Sets the colour of a given pixel. | ||||
| For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's | For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's | ||||
| @@ -2071,7 +2071,7 @@ void Component::sendLookAndFeelChange() | |||||
| } | } | ||||
| } | } | ||||
| const Colour Component::findColour (const int colourId, const bool inheritFromParent) const | |||||
| Colour Component::findColour (const int colourId, const bool inheritFromParent) const | |||||
| { | { | ||||
| const var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId)); | const var* const v = properties.getVarPointer (ComponentHelpers::getColourPropertyId (colourId)); | ||||
| @@ -2061,7 +2061,7 @@ public: | |||||
| @see setColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour | @see setColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour | ||||
| */ | */ | ||||
| const Colour findColour (int colourId, bool inheritFromParent = false) const; | |||||
| Colour findColour (int colourId, bool inheritFromParent = false) const; | |||||
| /** Registers a colour to be used for a particular purpose. | /** Registers a colour to be used for a particular purpose. | ||||
| @@ -203,7 +203,7 @@ void DrawableImage::ValueTreeWrapper::setOpacity (float newOpacity, UndoManager* | |||||
| state.setProperty (opacity, newOpacity, undoManager); | state.setProperty (opacity, newOpacity, undoManager); | ||||
| } | } | ||||
| const Colour DrawableImage::ValueTreeWrapper::getOverlayColour() const | |||||
| Colour DrawableImage::ValueTreeWrapper::getOverlayColour() const | |||||
| { | { | ||||
| return Colour::fromString (state [overlay].toString()); | return Colour::fromString (state [overlay].toString()); | ||||
| } | } | ||||
| @@ -113,7 +113,7 @@ public: | |||||
| void setOpacity (float newOpacity, UndoManager* undoManager); | void setOpacity (float newOpacity, UndoManager* undoManager); | ||||
| Value getOpacityValue (UndoManager* undoManager); | Value getOpacityValue (UndoManager* undoManager); | ||||
| const Colour getOverlayColour() const; | |||||
| Colour getOverlayColour() const; | |||||
| void setOverlayColour (const Colour& newColour, UndoManager* undoManager); | void setOverlayColour (const Colour& newColour, UndoManager* undoManager); | ||||
| Value getOverlayColourValue (UndoManager* undoManager); | Value getOverlayColourValue (UndoManager* undoManager); | ||||
| @@ -1070,7 +1070,7 @@ private: | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| static const Colour parseColour (const String& s, int& index, const Colour& defaultColour) | |||||
| static Colour parseColour (const String& s, int& index, const Colour& defaultColour) | |||||
| { | { | ||||
| if (s [index] == '#') | if (s [index] == '#') | ||||
| { | { | ||||
| @@ -450,7 +450,7 @@ void TabbedButtonBar::resized() | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| const Colour TabbedButtonBar::getTabBackgroundColour (const int tabIndex) | |||||
| Colour TabbedButtonBar::getTabBackgroundColour (const int tabIndex) | |||||
| { | { | ||||
| TabInfo* const tab = tabs [tabIndex]; | TabInfo* const tab = tabs [tabIndex]; | ||||
| return tab == nullptr ? Colours::white : tab->colour; | return tab == nullptr ? Colours::white : tab->colour; | ||||
| @@ -234,7 +234,7 @@ public: | |||||
| This is the colour that was specified in addTab(). | This is the colour that was specified in addTab(). | ||||
| */ | */ | ||||
| const Colour getTabBackgroundColour (int tabIndex); | |||||
| Colour getTabBackgroundColour (int tabIndex); | |||||
| /** Changes the background colour of a tab. | /** Changes the background colour of a tab. | ||||
| @@ -72,7 +72,7 @@ public: | |||||
| owner.popupMenuClickOnTab (tabIndex, tabName); | owner.popupMenuClickOnTab (tabIndex, tabName); | ||||
| } | } | ||||
| const Colour getTabBackgroundColour (const int tabIndex) | |||||
| Colour getTabBackgroundColour (const int tabIndex) | |||||
| { | { | ||||
| return owner.tabs->getTabBackgroundColour (tabIndex); | return owner.tabs->getTabBackgroundColour (tabIndex); | ||||
| } | } | ||||
| @@ -192,7 +192,7 @@ Component* TabbedComponent::getTabContentComponent (const int tabIndex) const no | |||||
| return contentComponents [tabIndex]; | return contentComponents [tabIndex]; | ||||
| } | } | ||||
| const Colour TabbedComponent::getTabBackgroundColour (const int tabIndex) const noexcept | |||||
| Colour TabbedComponent::getTabBackgroundColour (const int tabIndex) const noexcept | |||||
| { | { | ||||
| return tabs->getTabBackgroundColour (tabIndex); | return tabs->getTabBackgroundColour (tabIndex); | ||||
| } | } | ||||
| @@ -138,7 +138,7 @@ public: | |||||
| Component* getTabContentComponent (int tabIndex) const noexcept; | Component* getTabContentComponent (int tabIndex) const noexcept; | ||||
| /** Returns the colour of one of the tabs. */ | /** Returns the colour of one of the tabs. */ | ||||
| const Colour getTabBackgroundColour (int tabIndex) const noexcept; | |||||
| Colour getTabBackgroundColour (int tabIndex) const noexcept; | |||||
| /** Changes the background colour of one of the tabs. */ | /** Changes the background colour of one of the tabs. */ | ||||
| void setTabBackgroundColour (int tabIndex, const Colour& newColour); | void setTabBackgroundColour (int tabIndex, const Colour& newColour); | ||||
| @@ -63,6 +63,9 @@ void Viewport::viewedComponentChanged (Component*) {} | |||||
| //============================================================================== | //============================================================================== | ||||
| void Viewport::deleteContentComp() | void Viewport::deleteContentComp() | ||||
| { | { | ||||
| if (contentComp != nullptr) | |||||
| contentComp->removeComponentListener (this); | |||||
| if (deleteContent) | if (deleteContent) | ||||
| { | { | ||||
| // This sets the content comp to a null pointer before deleting the old one, in case | // This sets the content comp to a null pointer before deleting the old one, in case | ||||
| @@ -268,7 +268,7 @@ LookAndFeel::~LookAndFeel() | |||||
| } | } | ||||
| //============================================================================== | //============================================================================== | ||||
| const Colour LookAndFeel::findColour (const int colourId) const noexcept | |||||
| Colour LookAndFeel::findColour (const int colourId) const noexcept | |||||
| { | { | ||||
| const int index = colourIds.indexOf (colourId); | const int index = colourIds.indexOf (colourId); | ||||
| @@ -111,7 +111,7 @@ public: | |||||
| @see setColour, Component::findColour, Component::setColour | @see setColour, Component::findColour, Component::setColour | ||||
| */ | */ | ||||
| const Colour findColour (int colourId) const noexcept; | |||||
| Colour findColour (int colourId) const noexcept; | |||||
| /** Registers a colour to be used for a particular purpose. | /** Registers a colour to be used for a particular purpose. | ||||
| @@ -402,7 +402,7 @@ void ResizableWindow::lookAndFeelChanged() | |||||
| } | } | ||||
| } | } | ||||
| const Colour ResizableWindow::getBackgroundColour() const noexcept | |||||
| Colour ResizableWindow::getBackgroundColour() const noexcept | |||||
| { | { | ||||
| return findColour (backgroundColourId, false); | return findColour (backgroundColourId, false); | ||||
| } | } | ||||
| @@ -94,7 +94,7 @@ public: | |||||
| @see setBackgroundColour | @see setBackgroundColour | ||||
| */ | */ | ||||
| const Colour getBackgroundColour() const noexcept; | |||||
| Colour getBackgroundColour() const noexcept; | |||||
| /** Changes the colour currently being used for the window's background. | /** Changes the colour currently being used for the window's background. | ||||
| @@ -1109,7 +1109,7 @@ void CodeEditorComponent::setColourForTokenType (const int tokenType, const Colo | |||||
| repaint(); | repaint(); | ||||
| } | } | ||||
| const Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const | |||||
| Colour CodeEditorComponent::getColourForTokenType (const int tokenType) const | |||||
| { | { | ||||
| if (! isPositiveAndBelow (tokenType, coloursForTokenCategories.size())) | if (! isPositiveAndBelow (tokenType, coloursForTokenCategories.size())) | ||||
| return findColour (CodeEditorComponent::defaultTextColourId); | return findColour (CodeEditorComponent::defaultTextColourId); | ||||
| @@ -191,7 +191,7 @@ public: | |||||
| CodeTokeniser::getTokenTypes() to get a list of the token types. | CodeTokeniser::getTokenTypes() to get a list of the token types. | ||||
| @see setColourForTokenType | @see setColourForTokenType | ||||
| */ | */ | ||||
| const Colour getColourForTokenType (int tokenType) const; | |||||
| Colour getColourForTokenType (int tokenType) const; | |||||
| //============================================================================== | //============================================================================== | ||||
| /** A set of colour IDs to use to change the colour of various aspects of the editor. | /** A set of colour IDs to use to change the colour of various aspects of the editor. | ||||