Fix positioning of picker.

Give initial focus to search line.

svn path=/trunk/kdepim/; revision=376466
wilder-work
Cornelius Schumacher 22 years ago
parent 62f93c22a9
commit 0ad4dd1f53
  1. 11
      kwindowpositioner.cpp
  2. 2
      kwindowpositioner.h
  3. 5
      recipientseditor.cpp
  4. 6
      recipientseditor.h
  5. 4
      recipientspicker.cpp

@ -34,12 +34,17 @@ KWindowPositioner::KWindowPositioner( QWidget *master, QWidget *slave )
bool KWindowPositioner::eventFilter( QObject *, QEvent *e )
{
if ( e->type() == QEvent::Move ) {
QPoint pos = mMaster->mapToGlobal( QPoint( mMaster->width(), -100 ) );
mSlave->move( pos );
mSlave->raise();
reposition();
}
return false;
}
void KWindowPositioner::reposition()
{
QPoint pos = mMaster->mapToGlobal( QPoint( mMaster->width(), -100 ) );
mSlave->move( pos );
mSlave->raise();
}
#include "kwindowpositioner.moc"

@ -32,6 +32,8 @@ class KWindowPositioner : public QObject
KWindowPositioner( QWidget *master, QWidget *slave );
bool eventFilter( QObject *watched, QEvent *e );
void reposition();
private:
QWidget *mMaster;

@ -423,7 +423,7 @@ SideWidget::SideWidget( RecipientsView *view, QWidget *parent )
topLayout->addWidget( mTotalLabel, 1 );
mTotalLabel->hide();
QPushButton *button = new QPushButton( "Select...", this );
QPushButton *button = new QPushButton( "&Select...", this );
topLayout->addWidget( button );
connect( button, SIGNAL( clicked() ), SLOT( pickRecipient() ) );
@ -438,7 +438,7 @@ void SideWidget::initRecipientPicker()
connect( mRecipientPicker, SIGNAL( pickedRecipient( const QString & ) ),
SIGNAL( pickedRecipient( const QString & ) ) );
new KWindowPositioner( this, mRecipientPicker );
mPickerPositioner = new KWindowPositioner( this, mRecipientPicker );
}
void SideWidget::setTotal( int recipients, int lines )
@ -463,6 +463,7 @@ void SideWidget::pickRecipient()
mRecipientPicker->setRecipients( mView->recipients() );
mRecipientPicker->show();
mRecipientPicker->raise();
mPickerPositioner->reposition();
#endif
}

@ -32,6 +32,8 @@
class RecipientsPicker;
class KWindowPositioner;
class QComboBox;
class QLabel;
@ -55,8 +57,7 @@ class Recipient
static int typeToId( Type );
static Type idToType( int );
QString typeLabel() const;
static QString typeLabel( Type );
QString typeLabel() const; static QString typeLabel( Type );
static QStringList allTypeLabels();
private:
@ -188,6 +189,7 @@ class SideWidget : public QWidget
RecipientsView *mView;
QLabel *mTotalLabel;
RecipientsPicker *mRecipientPicker;
KWindowPositioner *mPickerPositioner;
};
class RecipientsEditor : public QWidget

@ -137,13 +137,13 @@ RecipientsPicker::RecipientsPicker( QWidget *parent )
mSearchLine->setListView( mRecipientList );
resize( 460 , 460 );
initCollections();
mCollectionCombo->setCurrentItem( 0 );
updateList();
mSearchLine->setFocus();
}
void RecipientsPicker::initCollections()

Loading…
Cancel
Save