summaryrefslogtreecommitdiff
path: root/libqtaux/ocolorbutton.cpp
Side-by-side diff
Diffstat (limited to 'libqtaux/ocolorbutton.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libqtaux/ocolorbutton.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libqtaux/ocolorbutton.cpp b/libqtaux/ocolorbutton.cpp
index 9e41d93..925df7f 100644
--- a/libqtaux/ocolorbutton.cpp
+++ b/libqtaux/ocolorbutton.cpp
@@ -62,9 +62,9 @@ OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *n
connect ( d-> m_menu, SIGNAL( colorSelected(const QColor&)), this, SLOT( updateColor(const QColor&)));
- updateColor ( color );
QSize s = sizeHint ( ) + QSize ( 12, 0 );
setMinimumSize ( s );
setMaximumSize ( s. width ( ) * 2, s. height ( ));
+ d->m_color = color;
}
@@ -101,5 +101,5 @@ void OColorButton::updateColor ( const QColor &c )
d-> m_color = c;
- QImage img ( 16, 16, 32 );
+ QImage img ( width()-14, height()-6, 32 );
img. fill ( 0 );
@@ -146,2 +146,10 @@ void OColorButton::updateColor ( const QColor &c )
}
+
+/**
+ * @internal
+ */
+void OColorButton::resizeEvent( QResizeEvent *ev ) {
+ QPushButton::resizeEvent( ev );
+ updateColor(d->m_color);
+}