-rw-r--r-- | microkde/kdeui/ktoolbar.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
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 @@ -1430,26 +1432,34 @@ void KToolBar::setStretchableWidget( QWidget *w ) stretchableWidget = 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() ) { |