/*
 * File         : QStatusCircle.cpp
 * Author       : Timothy Wiley
 * Version      :
 * Created      : 01/03/2010
 * Description  : Status Circle Widget
 * Copyright    :
 */

#include "victim_id/gui/QStatusCircle.hpp"

#include <QtGui/QPainter>

#define CIRCLE_DIMENSION 10

QStatusCircle::QStatusCircle(QColor colour) :
    colour(colour) {
}

QStatusCircle::~QStatusCircle() {
}

void QStatusCircle::setColour(QColor colour) {
    this->colour = colour;
}

QColor QStatusCircle::getColour() {
    return colour;
}

QSize QStatusCircle::maximumSize() const {
    return QSize(CIRCLE_DIMENSION, CIRCLE_DIMENSION);
}

QSize QStatusCircle::minimumSizeHint() const {
    return QSize(CIRCLE_DIMENSION, CIRCLE_DIMENSION);
}

QSize QStatusCircle::sizeHint() const {
    return QSize(CIRCLE_DIMENSION, CIRCLE_DIMENSION);
}

void QStatusCircle::paintEvent(QPaintEvent *event) {
    QPainter painter(this);
    painter.setBrush(QBrush(colour, Qt::SolidPattern));
    painter.drawEllipse(QRect(0, 0, CIRCLE_DIMENSION, CIRCLE_DIMENSION));
}
