Diffstat (limited to 'noncore/net/opieirc/ircmisc.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opieirc/ircmisc.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/noncore/net/opieirc/ircmisc.cpp b/noncore/net/opieirc/ircmisc.cpp new file mode 100644 index 0000000..f41a89a --- a/dev/null +++ b/noncore/net/opieirc/ircmisc.cpp | |||
@@ -0,0 +1,31 @@ | |||
1 | #include <opie/colordialog.h> | ||
2 | #include <qlayout.h> | ||
3 | #include "ircmisc.h" | ||
4 | |||
5 | IRCColorLabel::IRCColorLabel(QColor color, QWidget *parent, const char *name, WFlags f) : QLabel(parent, name, f) { | ||
6 | m_color = color; | ||
7 | setAlignment(AlignVCenter | AlignCenter); | ||
8 | setFrameStyle(QFrame::StyledPanel); | ||
9 | setFrameShadow(QFrame::Sunken); | ||
10 | setBackgroundColor(m_color); | ||
11 | } | ||
12 | |||
13 | void IRCColorLabel::mousePressEvent(QMouseEvent *) { | ||
14 | m_color = OColorDialog::getColor(m_color); | ||
15 | setBackgroundColor(m_color); | ||
16 | } | ||
17 | |||
18 | QColor IRCColorLabel::color() { | ||
19 | return m_color; | ||
20 | } | ||
21 | |||
22 | IRCFramedColorLabel::IRCFramedColorLabel(QColor color, QWidget *parent, const char *name, WFlags f) : QWidget(parent, name, f) { | ||
23 | QVBoxLayout *layout = new QVBoxLayout(this, 10, 0); | ||
24 | m_label = new IRCColorLabel(color, this); | ||
25 | layout->addWidget(m_label); | ||
26 | } | ||
27 | |||
28 | QColor IRCFramedColorLabel::color() { | ||
29 | return m_label->color(); | ||
30 | } | ||
31 | |||