diff --git a/apps/opencs/view/widget/coloreditbutton.cpp b/apps/opencs/view/widget/coloreditbutton.cpp deleted file mode 100644 index 4960d1ef1..000000000 --- a/apps/opencs/view/widget/coloreditbutton.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "coloreditbutton.hpp" - -#include -#include -#include - -CSVWidget::ColorEditButton::ColorEditButton(const QColor &color, - const QSize &coloredRectSize, - QWidget *parent) - : QPushButton(parent), - mColor(color), - mColoredRectSize(coloredRectSize) - -{} - -void CSVWidget::ColorEditButton::paintEvent(QPaintEvent *event) -{ - QPushButton::paintEvent(event); - - QRect buttonRect = rect(); - QRect coloredRect(buttonRect.x() + (buttonRect.width() - mColoredRectSize.width()) / 2, - buttonRect.y() + (buttonRect.height() - mColoredRectSize.height()) / 2, - mColoredRectSize.width(), - mColoredRectSize.height()); - QPainter painter(this); - painter.fillRect(coloredRect, mColor); -} - -QColor CSVWidget::ColorEditButton::color() const -{ - return mColor; -} - -void CSVWidget::ColorEditButton::setColor(const QColor &color) -{ - mColor = color; -} - -void CSVWidget::ColorEditButton::setColoredRectSize(const QSize &size) -{ - mColoredRectSize = size; -} \ No newline at end of file diff --git a/apps/opencs/view/widget/coloreditbutton.hpp b/apps/opencs/view/widget/coloreditbutton.hpp deleted file mode 100644 index e1a8cce9d..000000000 --- a/apps/opencs/view/widget/coloreditbutton.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef CSV_WIDGET_COLOREDITBUTTON_HPP -#define CSV_WIDGET_COLOREDITBUTTON_HPP - -#include - -class QColor; -class QSize; - -namespace CSVWidget -{ - class ColorEditButton : public QPushButton - { - QColor mColor; - QSize mColoredRectSize; - - public: - ColorEditButton(const QColor &color, - const QSize &coloredRectSize, - QWidget *parent = 0); - - QColor color() const; - void setColor(const QColor &color); - void setColoredRectSize(const QSize &size); - - protected: - void paintEvent(QPaintEvent *event); - }; -} - -#endif