-rw-r--r-- | kaddressbook/kabcore.cpp | 6 | ||||
-rw-r--r-- | microkde/kapplication.cpp | 4 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 12 | ||||
-rw-r--r-- | microkde/kdeui/ktoolbar.h | 2 |
4 files changed, 21 insertions, 3 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 4e2523e..033e537 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -839,26 +839,29 @@ void KABCore::beamMySelf() KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); } } void KABCore::updateMainWindow() { mMainWindow->showMaximized(); //mMainWindow->repaint(); } void KABCore::resizeEvent(QResizeEvent* e ) { - if ( !mMiniSplitter ) + if ( !mMiniSplitter ) { + QWidget::resizeEvent( e ); return; + } +#ifndef DESKTOP_VERSION static int desktop_width = 0; //qDebug("KABCore::resizeEvent %d %d ",desktop_width,QApplication::desktop()->width() ); if ( desktop_width != QApplication::desktop()->width() ) if ( QApplication::desktop()->width() >= 480 ) { if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 //qDebug("640 "); if ( mMiniSplitter->orientation() == Qt::Vertical ) { //qDebug("switch V->H "); mMiniSplitter->setOrientation( Qt::Horizontal); mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); } if ( QApplication::desktop()->width() <= 640 ) { @@ -887,24 +890,25 @@ void KABCore::resizeEvent(QResizeEvent* e ) if ( mIncSearchWidget ) { mIncSearchWidget->setSize(); } } else { mViewManager->getFilterAction()->setComboWidth( 0 ); } if ( shot ) QTimer::singleShot( 1, this , SLOT ( updateMainWindow())); } } } desktop_width = QApplication::desktop()->width(); +#endif QWidget::resizeEvent( e ); } void KABCore::export2phone() { QStringList uids; XXPortSelectDialog dlg( this, false, this ); if ( dlg.exec() ) uids = dlg.uids(); else return; diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp index f36c5ae..d7c12bb 100644 --- a/microkde/kapplication.cpp +++ b/microkde/kapplication.cpp @@ -42,31 +42,33 @@ int KApplication::execDialog( QDialog* d ) ;//d->resize( 800, 600 ); return d->exec(); } void KApplication::showLicence() { KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" ); } void KApplication::testCoords( int* x, int* y, int* wid, int * hei ) { int dWid = QApplication::desktop()->width() ; int dHei = QApplication::desktop()->height(); + if ( *x < 0 ) *x = 0; + if ( *y < 20 ) *y = 20 ; if ( *x + *wid > dWid ) { *x = 0; if ( *wid > dWid ) *wid = dWid; } if ( *y + *hei > dHei ) { - *y = 0; + *y = 20; if ( *hei > dHei ) *hei = dHei; } } void KApplication::showFile(QString caption, QString fn) { QString text; QString fileName; #ifndef DESKTOP_VERSION fileName = getenv("QPEDIR"); fileName += "/pics/" + fn ; #else diff --git a/microkde/kdeui/ktoolbar.cpp b/microkde/kdeui/ktoolbar.cpp index df2aad8..027e5e9 100644 --- a/microkde/kdeui/ktoolbar.cpp +++ b/microkde/kdeui/ktoolbar.cpp @@ -246,24 +246,26 @@ KToolBar::KToolBar( QMainWindow *parentWindow, QWidget *dock, bool newLine, cons init( readConfig, honorStyle ); } KToolBar::~KToolBar() { inshutdownprocess = true; emit toolbarDestroyed(); delete d; } void KToolBar::init( bool readConfig, bool honorStyle ) { + sizeHintW = 240; + sizeHintH = 22; inshutdownprocess = false; d = new KToolBarPrivate; setFullSize( TRUE ); d->m_honorStyle = honorStyle; context = 0; layoutTimer = new QTimer( this ); connect( layoutTimer, SIGNAL( timeout() ), this, SLOT( rebuildLayout() ) ); connect( &(d->repaintTimer), SIGNAL( timeout() ), this, SLOT( slotRepaint() ) ); /*US if ( kapp ) { // may be null when started inside designer @@ -1431,25 +1433,33 @@ void KToolBar::setStretchableWidget( QWidget *w ) } QSizePolicy KToolBar::sizePolicy() const { if ( orientation() == Horizontal ) return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ); else return QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Expanding ); } QSize KToolBar::sizeHint() const { - return QToolBar::sizeHint(); + QSize sh = QToolBar::sizeHint(); + //qDebug("%x KToolBar::sizeHint() %d %d ",this, QToolBar::sizeHint().width(),QToolBar::sizeHint().height() ); + if ( sh.height() <= 20 || sh.width() < 60 ) + return QSize( sizeHintW, sizeHintH ); + KToolBar* ttt = (KToolBar*) this; + ttt->sizeHintW = sh.width(); + ttt->sizeHintH = sh.height(); + return sh; + //return QToolBar::sizeHint(); #if 0 QWidget::polish(); static int iii = 0; ++iii; qDebug("++++++++ KToolBar::sizeHint() %d ", iii ); int margin = static_cast<QWidget*>(ncThis)->layout()->margin(); switch( barPos() ) { case KToolBar::Top: case KToolBar::Bottom: for ( QWidget *w = widgets.first(); w; w =widgets.next() ) { diff --git a/microkde/kdeui/ktoolbar.h b/microkde/kdeui/ktoolbar.h index 7a5c114..3319fa8 100644 --- a/microkde/kdeui/ktoolbar.h +++ b/microkde/kdeui/ktoolbar.h @@ -1073,24 +1073,26 @@ protected: QString settingsGroup(); private slots: void rebuildLayout(); void slotReadConfig (); void slotAppearanceChanged(); void slotIconChanged(int); void toolBarPosChanged( QToolBar *tb ); void slotContextAboutToShow(); void widgetDestroyed(); private: + int sizeHintW; + int sizeHintH; void init( bool readConfig = true, bool honorStyle = false ); void doConnections( KToolBarButton *button ); void insertWidgetInternal( QWidget *w, int &index, int id ); void removeWidgetInternal( QWidget *w ); void getAttributes( QString &position, QString &icontext, int &index ); //US KPopupMenu *contextMenu(); QPopupMenu *contextMenu(); QMap<QWidget*, int > widget2id; typedef QMap<int, QWidget* > Id2WidgetMap; Id2WidgetMap id2widget; //US KPopupMenu *context; |