view colourset.h @ 55:261bfb9481fe

* Make changeset item boxes wider if they have no neighbours. Changeset item code is horrible -- items generally need refactoring to take out hardcoded dimensions.
author Chris Cannam
date Fri, 12 Nov 2010 17:30:53 +0000
parents 3c46b2ac45d3
children f583e44d9d31
line wrap: on
line source
#ifndef _COLOURSET_H_
#define _COLOURSET_H_

#include <QSet>
#include <QMap>
#include <QColor>
#include <QString>

class ColourSet
{
public:
    void clearDefaultNames() { m_defaultNames.clear(); }
    void addDefaultName(QString n) { m_defaultNames.insert(n); }

    QColor getColourFor(QString n);

    static ColourSet *instance();

private:
    ColourSet();
    QSet<QString> m_defaultNames;
    QMap<QString, QColor> m_colours;
    QColor m_lastColour;

    static ColourSet m_instance;
};

#endif