summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
authorzautrix <zautrix>2005-03-23 13:55:05 (UTC)
committer zautrix <zautrix>2005-03-23 13:55:05 (UTC)
commit53ba86911c8d22d2ca14ac19da85a728de710642 (patch) (side-by-side diff)
tree429910d6955c629fc921e9a3bd537ec90d2378b7 /korganizer/komonthview.cpp
parent913291ec9784520cc6ff9769081c03bd74a5ab07 (diff)
downloadkdepimpi-53ba86911c8d22d2ca14ac19da85a728de710642.zip
kdepimpi-53ba86911c8d22d2ca14ac19da85a728de710642.tar.gz
kdepimpi-53ba86911c8d22d2ca14ac19da85a728de710642.tar.bz2
layout fixes
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore 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)
#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;