QTfrontend/ui/widget/colorwidget.cpp
changeset 7749 edad8a7bcaea
parent 7130 fcab1fd02bc6
child 7750 31e4f6c1834b
--- a/QTfrontend/ui/widget/colorwidget.cpp	Sat Oct 13 00:07:46 2012 +0400
+++ b/QTfrontend/ui/widget/colorwidget.cpp	Sat Oct 13 00:35:20 2012 +0400
@@ -1,17 +1,17 @@
 #include <QStandardItemModel>
 #include <QMouseEvent>
 #include <QWheelEvent>
+#include <QColor>
 
 #include "colorwidget.h"
 #include "hwconsts.h"
 
 ColorWidget::ColorWidget(QStandardItemModel *colorsModel, QWidget *parent) :
-    QWidget(parent)
+    QFrame(parent)
 {
     m_colorsModel = colorsModel;
 
     setColor(0);
-    setStyleSheet("");
     setAutoFillBackground(true);
 
     connect(m_colorsModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(dataChanged(QModelIndex,QModelIndex)));
@@ -30,9 +30,12 @@
 
     QStandardItem * item = m_colorsModel->item(m_color);
 
+    setStyleSheet(QString("border: 2px solid orange; border-radius: 8px; background: %1").arg(item->data().value<QColor>().name()));
+    /*
     QPalette p = palette();
     p.setColor(QPalette::Window, item->data().value<QColor>());
     setPalette(p);
+    */
 
     emit colorChanged(m_color);
 }