summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp26
1 files changed, 23 insertions, 3 deletions
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)
994#endif 994#endif
995 995
996 emit incidenceSelected( 0 ); 996 emit incidenceSelected( 0 );
997
998 mComputeLayoutTimer = new QTimer( this );
999 connect (mComputeLayoutTimer ,SIGNAL(timeout()), this, SLOT ( slotComputeLayout()));
1000
1001
997#ifndef DESKTOP_VERSION 1002#ifndef DESKTOP_VERSION
998 resize( QApplication::desktop()->size() ); 1003 resize( QApplication::desktop()->size() );
999#else 1004#else
@@ -1351,13 +1356,25 @@ void KOMonthView::updateView()
1351 1356
1352void KOMonthView::resizeEvent(QResizeEvent * e) 1357void KOMonthView::resizeEvent(QResizeEvent * e)
1353{ 1358{
1354 //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); 1359 qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height());
1360 if ( isVisible() ) {
1361 qDebug("KOMonthView::isVisible ");
1362 slotComputeLayout();
1363 } else
1364 mComputeLayoutTimer->start( 100 );
1365}
1366
1367void KOMonthView::slotComputeLayout()
1368{
1369 mComputeLayoutTimer->stop();
1370 qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() );
1355 computeLayout(); 1371 computeLayout();
1356 clPending = true; 1372 clPending = true;
1357 if ( mShowWeekView ) 1373 if ( mShowWeekView )
1358 mCellsW[0]->setFocus(); 1374 mCellsW[0]->setFocus();
1359 else 1375 else
1360 mCells[0]->setFocus(); 1376 mCells[0]->setFocus();
1377
1361} 1378}
1362void KOMonthView::computeLayoutWeek() 1379void KOMonthView::computeLayoutWeek()
1363{ 1380{
@@ -1378,8 +1395,10 @@ void KOMonthView::computeLayoutWeek()
1378 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) 1395 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
1379 return; 1396 return;
1380 1397
1381 if ( lastWid == width() && lastHei == height() ) 1398 if ( lastWid == width() && lastHei == height() ) {
1399 qDebug("KOListWeekView::No compute layout needed ");
1382 return; 1400 return;
1401 }
1383 lastWid = width(); 1402 lastWid = width();
1384 lastHei = height(); 1403 lastHei = height();
1385 1404
@@ -1505,12 +1524,13 @@ void KOMonthView::computeLayout()
1505 return; 1524 return;
1506 } 1525 }
1507 if ( lastWid == width() && lastHei == height() ){ 1526 if ( lastWid == width() && lastHei == height() ){
1527 qDebug("KOMonthview::No compute layout needed ");
1508 return; 1528 return;
1509 } 1529 }
1510 1530
1511 lastWid = width(); 1531 lastWid = width();
1512 lastHei = height(); 1532 lastHei = height();
1513 //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); 1533 qDebug("KOMonthView::computeLayout() MMM ------------------- ");
1514 QFontMetrics fm ( mWeekLabels[0]->font() ); 1534 QFontMetrics fm ( mWeekLabels[0]->font() );
1515 int weeklabelwid = fm.width( "888" ); 1535 int weeklabelwid = fm.width( "888" );
1516 wid -= weeklabelwid; 1536 wid -= weeklabelwid;