22 #include "twindowpositioner.h"
28 KWindowPositioner::KWindowPositioner( TQWidget *master, TQWidget *slave,
30 : TQObject( master ), mMaster( master ), mSlave( slave ), mMode( mode )
32 master->topLevelWidget()->installEventFilter( this );
35 bool KWindowPositioner::eventFilter( TQObject *, TQEvent *e )
37 if ( e->type() == TQEvent::Move ) {
44 void KWindowPositioner::reposition()
47 if ( mMode == Right ) {
48 relativePos = TQPoint( mMaster->width(), -100 );
49 } else if ( mMode == Bottom ) {
50 relativePos = TQPoint( 100 - mSlave->width() + mMaster->width(),
53 kdError() << "KWindowPositioner: Illegal mode" << endl;
55 TQPoint pos = mMaster->mapToGlobal( relativePos );
60 #include "twindowpositioner.moc"
|