QTfrontend/ui/widget/colorwidget.h
author dag10
Wed, 23 Jan 2013 16:35:26 -0500
changeset 8430 5a5c34a75e1a
parent 7750 31e4f6c1834b
child 8434 4821897a0f10
permissions -rw-r--r--
Aesthetic improvements to chat widget. Also fixed the ghosting issue in a few areas by using repaint(). Restored "random" button next to "seed" button in mapcontainer widget when in hand-drawn mode.

#ifndef COLORWIDGET_H
#define COLORWIDGET_H

#include <QFrame>
#include <QModelIndex>

namespace Ui {
class ColorWidget;
}

class QStandardItemModel;

class ColorWidget : public QFrame
{
    Q_OBJECT
    
public:
    explicit ColorWidget(QStandardItemModel *colorsModel, QWidget *parent = 0);
    ~ColorWidget();

    void setColors(QStandardItemModel * colorsModel);
    void setColor(int color);
    int getColor();

signals:
    void colorChanged(int color);
    
private:
    int m_color;
    QStandardItemModel * m_colorsModel;

private slots:
    void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);

protected:
    void mousePressEvent(QMouseEvent * event);
    void wheelEvent(QWheelEvent * event);
    void nextColor();
    void previousColor();
};

#endif // COLORWIDGET_H