summaryrefslogtreecommitdiff
path: root/noncore/graphics/drawpad/colorpanel.h
authorleseb <leseb>2002-03-19 12:58:43 (UTC)
committer leseb <leseb>2002-03-19 12:58:43 (UTC)
commitf298cb9f5557d88b9ff38feb4b5e090e5c164ec2 (patch) (side-by-side diff)
treea27f4d18cf3a0b62987cc37238e78d7269b2504e /noncore/graphics/drawpad/colorpanel.h
parent58a456b92ba8986d4ea2375ddcfd6dd1d84c8fe5 (diff)
downloadopie-f298cb9f5557d88b9ff38feb4b5e090e5c164ec2.zip
opie-f298cb9f5557d88b9ff38feb4b5e090e5c164ec2.tar.gz
opie-f298cb9f5557d88b9ff38feb4b5e090e5c164ec2.tar.bz2
Better color selection
Diffstat (limited to 'noncore/graphics/drawpad/colorpanel.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/graphics/drawpad/colorpanel.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/noncore/graphics/drawpad/colorpanel.h b/noncore/graphics/drawpad/colorpanel.h
new file mode 100644
index 0000000..05364c1
--- a/dev/null
+++ b/noncore/graphics/drawpad/colorpanel.h
@@ -0,0 +1,65 @@
+/***************************************************************************
+ * *
+ * DrawPad - a drawing program for Opie Environment *
+ * *
+ * (C) 2002 by S. Prud'homme <prudhomme@laposte.net> *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ ***************************************************************************/
+
+#ifndef COLORPANEL_H
+#define COLORPANEL_H
+
+#include <qframe.h>
+#include <qwidget.h>
+
+class QGridLayout;
+
+class ColorPanelButton : public QFrame
+{
+ Q_OBJECT
+
+public:
+ ColorPanelButton(const QColor& color, QWidget* parent = 0, const char* name = 0);
+ ~ColorPanelButton();
+
+ void setActive(bool active);
+
+ void enterEvent(QEvent* e);
+ void leaveEvent(QEvent* e);
+ void paintEvent(QPaintEvent* e);
+ void mouseReleaseEvent(QMouseEvent* e);
+
+signals:
+ void selected(const QColor&);
+
+private:
+ QColor m_color;
+ bool m_active;
+};
+
+class ColorPanel : public QWidget
+{
+ Q_OBJECT
+
+public:
+ ColorPanel(QWidget* parent = 0, const char* name = 0);
+ ~ColorPanel();
+
+ void addColor(const QColor& color, int row, int col);
+
+public slots:
+ void buttonSelected(const QColor& color);
+
+signals:
+ void colorSelected(const QColor&);
+
+private:
+ QGridLayout* m_pGridLayout;
+};
+
+#endif // COLORPANEL_H