From 53ba86911c8d22d2ca14ac19da85a728de710642 Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 23 Mar 2005 13:55:05 +0000 Subject: layout fixes --- (limited to 'korganizer/komonthview.cpp') diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 9fd1f68..8ee5bc3 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -994,6 +994,11 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) #endif emit incidenceSelected( 0 ); + + mComputeLayoutTimer = new QTimer( this ); + connect (mComputeLayoutTimer ,SIGNAL(timeout()), this, SLOT ( slotComputeLayout())); + + #ifndef DESKTOP_VERSION resize( QApplication::desktop()->size() ); #else @@ -1351,13 +1356,25 @@ void KOMonthView::updateView() void KOMonthView::resizeEvent(QResizeEvent * e) { - //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); + qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); + if ( isVisible() ) { + qDebug("KOMonthView::isVisible "); + slotComputeLayout(); + } else + mComputeLayoutTimer->start( 100 ); +} + +void KOMonthView::slotComputeLayout() +{ + mComputeLayoutTimer->stop(); + qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); computeLayout(); clPending = true; if ( mShowWeekView ) mCellsW[0]->setFocus(); else mCells[0]->setFocus(); + } void KOMonthView::computeLayoutWeek() { @@ -1378,8 +1395,10 @@ void KOMonthView::computeLayoutWeek() if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) return; - if ( lastWid == width() && lastHei == height() ) + if ( lastWid == width() && lastHei == height() ) { + qDebug("KOListWeekView::No compute layout needed "); return; + } lastWid = width(); lastHei = height(); @@ -1505,12 +1524,13 @@ void KOMonthView::computeLayout() return; } if ( lastWid == width() && lastHei == height() ){ + qDebug("KOMonthview::No compute layout needed "); return; } lastWid = width(); lastHei = height(); - //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); + qDebug("KOMonthView::computeLayout() MMM ------------------- "); QFontMetrics fm ( mWeekLabels[0]->font() ); int weeklabelwid = fm.width( "888" ); wid -= weeklabelwid; -- cgit v0.9.0.2