mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Removed incorrect constness from ColourSelector::setSwatchColour
This commit is contained in:
parent
171aa94215
commit
57a3cb58ec
5 changed files with 11 additions and 14 deletions
|
|
@ -163,7 +163,7 @@ public:
|
|||
return getAppSettings().swatchColours [index];
|
||||
}
|
||||
|
||||
void setSwatchColour (int index, const Colour& newColour) const override
|
||||
void setSwatchColour (int index, const Colour& newColour) override
|
||||
{
|
||||
getAppSettings().swatchColours.set (index, newColour);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ Colour StoredSettings::ColourSelectorWithSwatches::getSwatchColour (int index) c
|
|||
return getAppSettings().swatchColours [index];
|
||||
}
|
||||
|
||||
void StoredSettings::ColourSelectorWithSwatches::setSwatchColour (int index, const Colour& newColour) const
|
||||
void StoredSettings::ColourSelectorWithSwatches::setSwatchColour (int index, const Colour& newColour)
|
||||
{
|
||||
getAppSettings().swatchColours.set (index, newColour);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public:
|
|||
|
||||
int getNumSwatches() const override;
|
||||
Colour getSwatchColour (int index) const override;
|
||||
void setSwatchColour (int index, const Colour& newColour) const override;
|
||||
void setSwatchColour (int index, const Colour& newColour) override;
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ void ColourSelector::paint (Graphics& g)
|
|||
|
||||
if ((flags & showColourAtTop) != 0)
|
||||
{
|
||||
const Colour currentColour (getCurrentColour());
|
||||
auto currentColour = getCurrentColour();
|
||||
|
||||
g.fillCheckerBoard (previewArea, 10, 10,
|
||||
Colour (0xffdddddd).overlaidWith (currentColour),
|
||||
|
|
@ -446,14 +446,11 @@ void ColourSelector::paint (Graphics& g)
|
|||
g.setColour (findColour (labelTextColourId));
|
||||
g.setFont (11.0f);
|
||||
|
||||
for (int i = 4; --i >= 0;)
|
||||
{
|
||||
if (sliders[i]->isVisible())
|
||||
g.drawText (sliders[i]->getName() + ":",
|
||||
0, sliders[i]->getY(),
|
||||
sliders[i]->getX() - 8, sliders[i]->getHeight(),
|
||||
for (auto* s : sliders)
|
||||
if (s->isVisible())
|
||||
g.drawText (s->getName() + ":",
|
||||
0, s->getY(), s->getX() - 8, s->getHeight(),
|
||||
Justification::centredRight, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -515,7 +512,7 @@ void ColourSelector::resized()
|
|||
|
||||
for (int i = 0; i < numSwatches; ++i)
|
||||
{
|
||||
SwatchComponent* const sc = new SwatchComponent (*this, i);
|
||||
auto* sc = new SwatchComponent (*this, i);
|
||||
swatchComponents.add (sc);
|
||||
addAndMakeVisible (sc);
|
||||
}
|
||||
|
|
@ -566,7 +563,7 @@ Colour ColourSelector::getSwatchColour (const int) const
|
|||
return Colours::black;
|
||||
}
|
||||
|
||||
void ColourSelector::setSwatchColour (const int, const Colour&) const
|
||||
void ColourSelector::setSwatchColour (int, const Colour&)
|
||||
{
|
||||
jassertfalse; // if you've overridden getNumSwatches(), you also need to implement this method
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public:
|
|||
setSwatchColour(), to return the number of colours you want, and to set and retrieve
|
||||
their values.
|
||||
*/
|
||||
virtual void setSwatchColour (int index, const Colour& newColour) const;
|
||||
virtual void setSwatchColour (int index, const Colour& newColour);
|
||||
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue