summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Side-by-side diff
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
@@ -995,4 +995,9 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
emit incidenceSelected( 0 );
+
+ mComputeLayoutTimer = new QTimer( this );
+ connect (mComputeLayoutTimer ,SIGNAL(timeout()), this, SLOT ( slotComputeLayout()));
+
+
#ifndef DESKTOP_VERSION
resize( QApplication::desktop()->size() );
@@ -1352,5 +1357,16 @@ 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;
@@ -1359,4 +1375,5 @@ void KOMonthView::resizeEvent(QResizeEvent * e)
else
mCells[0]->setFocus();
+
}
void KOMonthView::computeLayoutWeek()
@@ -1379,6 +1396,8 @@ void KOMonthView::computeLayoutWeek()
return;
- if ( lastWid == width() && lastHei == height() )
+ if ( lastWid == width() && lastHei == height() ) {
+ qDebug("KOListWeekView::No compute layout needed ");
return;
+ }
lastWid = width();
lastHei = height();
@@ -1506,4 +1525,5 @@ void KOMonthView::computeLayout()
}
if ( lastWid == width() && lastHei == height() ){
+ qDebug("KOMonthview::No compute layout needed ");
return;
}
@@ -1511,5 +1531,5 @@ void KOMonthView::computeLayout()
lastWid = width();
lastHei = height();
- //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ ");
+ qDebug("KOMonthView::computeLayout() MMM ------------------- ");
QFontMetrics fm ( mWeekLabels[0]->font() );
int weeklabelwid = fm.width( "888" );