summaryrefslogtreecommitdiffabout
path: root/kaddressbook/views/colorlistbox.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/views/colorlistbox.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/colorlistbox.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp
index c243fa0..7386207 100644
--- a/kaddressbook/views/colorlistbox.cpp
+++ b/kaddressbook/views/colorlistbox.cpp
@@ -29,12 +29,13 @@
#include "colorlistbox.h"
ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f )
:KListBox( parent, name, f ), mCurrentOnDragEnter(-1)
{
connect( this, SIGNAL(selected(int)), this, SLOT(newColor(int)) );
+ connect( this, SIGNAL(clicked(QListBoxItem *)), this, SLOT(slotNewColor(QListBoxItem *)) );
setAcceptDrops( true);
}
void ColorListBox::setEnabled( bool state )
{
@@ -71,13 +72,17 @@ QColor ColorListBox::color( uint index ) const
}
else
{
return( black );
}
}
-
+void ColorListBox::slotNewColor(QListBoxItem * i)
+{
+ if ( i )
+ newColor( index( i ) );
+}
void ColorListBox::newColor( int index )
{
if( isEnabled() == false )
{
return;