#include "kledbutton.h"
#include <tqsizepolicy.h>

KLedButton::KLedButton( const TQColor &col, TQWidget *parent, const char *name )
    : KLed( col, parent, name )
{
}

KLedButton::KLedButton( const TQColor &col, KLed::State st, KLed::Look look,
                        KLed::Shape shape, TQWidget *parent, const char *name )
    : KLed( col, st, look, shape, parent, name )
{
}

void KLedButton::mousePressEvent( TQMouseEvent *e )
{
    if ( e->button() == TQt::LeftButton ) {
        toggle();
        emit stateChanged( state() == KLed::On );
    }
}

TQSize KLedButton::sizeHint() const       { return TQSize( 22, 22 ); }
TQSizePolicy KLedButton::sizePolicy() const
{
    return TQSizePolicy( TQSizePolicy::Fixed, TQSizePolicy::Fixed );
}

#include "kledbutton.moc"
