--Boundary-00=_UsGT9NFDr5aOgFD Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Nope, I couldn't come up with a worse subject (believe me I tried).=20 Yesterday I talked a little bit on irc with Martijn about Mac OS X gui.=20 He said that they have this very cool feature where all dialogs of a=20 window fallow the parent once the parent is moved. Well, I don't have=20 access to Mac OSX and wanted to check this feature out so I of course=20 implemented it just to see how it feels and I must say I like it. For=20 now I put it in the KDialogBase, I'm attaching a patch for those of you=20 who also don't have access to Mac OS X, the code is trivial. The=20 question is - do we want this? Do we want our dialogs to follow the=20 parent? Zack =2D-=20 Stress is when you wake up screaming and you realize you haven't fallen asleep yet.=20 --Boundary-00=_UsGT9NFDr5aOgFD Content-Type: text/x-diff; charset="us-ascii"; name="dial.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="dial.patch" ? semantic.cache Index: kdialogbase.cpp =================================================================== RCS file: /home/kde/kdelibs/kdeui/kdialogbase.cpp,v retrieving revision 1.71 diff -u -3 -p -r1.71 kdialogbase.cpp --- kdialogbase.cpp 2002/03/18 22:38:58 1.71 +++ kdialogbase.cpp 2002/08/03 23:37:27 @@ -101,6 +101,8 @@ KDialogBase::KDialogBase( QWidget *paren mIsActivated(false), mShowTile(false), mMessageBoxMode(false), mButtonOrientation(Horizontal) { + if ( parent ) + parent->installEventFilter( this ); d = new KDialogBasePrivate; setCaption( caption ); @@ -124,6 +126,8 @@ KDialogBase::KDialogBase( int dialogFace mIsActivated(false), mShowTile(false), mMessageBoxMode(false), mButtonOrientation(Horizontal) { + if ( parent ) + parent->installEventFilter( this ); d = new KDialogBasePrivate; setCaption( caption ); @@ -153,6 +157,8 @@ KDialogBase::KDialogBase( const QString mIsActivated(false), mShowTile(false), mMessageBoxMode(true), mButtonOrientation(Horizontal),mEscapeButton(escapeButton) { + if ( parent ) + parent->installEventFilter( this ); d = new KDialogBasePrivate; setCaption( caption ); @@ -164,11 +170,11 @@ KDialogBase::KDialogBase( const QString buttonMask &= Details|Yes|No|Cancel; - makeButtonBox( buttonMask, defaultButton, + makeButtonBox( buttonMask, defaultButton, no.text().isEmpty() ? KStdGuiItem::no() : no, yes.text().isEmpty() ? KStdGuiItem::yes() : yes ); - setButtonCancelText( cancel.text().isEmpty() ? + setButtonCancelText( cancel.text().isEmpty() ? KStdGuiItem::cancel().text() : cancel.text() ); mIsActivated = true; @@ -1518,7 +1524,23 @@ void KDialogBase::closeEvent( QCloseEven } } +bool KDialogBase::eventFilter( QObject *o, QEvent *e ) +{ + if ( e->type() == QEvent::Move ) { + QMoveEvent *m = static_cast(e); + QPoint diff = m->pos() - m->oldPos(); + QPoint npos = QWidget::pos(); + /*kdDebug()<<"#### Event filer pos.x = " + << QWidget::pos().x() << ", pos.y = "<writeEntry( QString::fromLatin1("Height %1").arg( desk.height()), Index: kdialogbase.h =================================================================== RCS file: /home/kde/kdelibs/kdeui/kdialogbase.h,v retrieving revision 1.72 diff -u -3 -p -r1.72 kdialogbase.h --- kdialogbase.h 2002/08/01 14:19:52 1.72 +++ kdialogbase.h 2002/08/03 23:37:27 @@ -1283,6 +1283,7 @@ class KDialogBase : public KDialog * will take place. */ virtual void closeEvent( QCloseEvent *e ); + bool eventFilter( QObject *, QEvent * ); protected slots: /** --Boundary-00=_UsGT9NFDr5aOgFD--