author | zautrix <zautrix> | 2005-03-23 13:55:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-23 13:55:05 (UTC) |
commit | 53ba86911c8d22d2ca14ac19da85a728de710642 (patch) (side-by-side diff) | |
tree | 429910d6955c629fc921e9a3bd537ec90d2378b7 | |
parent | 913291ec9784520cc6ff9769081c03bd74a5ab07 (diff) | |
download | kdepimpi-53ba86911c8d22d2ca14ac19da85a728de710642.zip kdepimpi-53ba86911c8d22d2ca14ac19da85a728de710642.tar.gz kdepimpi-53ba86911c8d22d2ca14ac19da85a728de710642.tar.bz2 |
layout fixes
-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 6 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 8 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 26 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 1 |
6 files changed, 36 insertions, 9 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 548c364..d1caff3 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp @@ -49,8 +49,10 @@ DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, mLastDisplayedDN = 0; mUpdateTimer; mUpdateTimer = new QTimer( this ); connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); + mFirstSelectedDate = QDate::currentDate(); + mSelectedDateCount = 1; } DateNavigatorContainer::~DateNavigatorContainer() { @@ -139,17 +141,17 @@ void DateNavigatorContainer::setCalendar( Calendar *cal ) } } void DateNavigatorContainer::checkUpdateDayMatrixDates() { - qDebug("wid %d hei %d ", width(), height()); + //qDebug("KODNC: wid %d hei %d ", width(), height()); mUpdateTimer->stop(); //return; if ( width() < 3 || height() < 3 ) return; static int lastWid = 0; static int lastHei = 0; if ( lastWid == width() && height() == lastHei ) { - qDebug("no layout computing needed. "); + qDebug("KODNC: No layout computing needed. "); } else { lastWid = width(); lastHei = height(); diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 7e6fa48..82d1eab 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -503,17 +503,17 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) if ( xx < 0 ) { rw = rw + xx; rx -= xx; xx = 0; - if ( rw < 0 ) { - qDebug("KOAgendaItem::Width1 < 0. Returning "); + if ( rw <= 1 ) { + qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); return; } } if ( paintFrom->width() < xx+rw ) { rw = paintFrom->width() - xx; - if ( rw < 0 ) { - qDebug("KOAgendaItem::Width2 < 0. Returning "); + if ( rw <= 1 ) { + qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); return; } } //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index eb3a6cd..5508210 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp @@ -266,8 +266,9 @@ EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) mXOffset = 0; if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); else mPixmap = SmallIcon("1downarrow"); mEnabled.resize(mColumns); + mEnabled.fill( false ); setMinimumHeight(mPixmap.height()); } EventIndicator::~EventIndicator() diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 9fd1f68..8ee5bc3 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -993,8 +993,13 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mWidStack->raiseWidget( mMonthView ); #endif emit incidenceSelected( 0 ); + + mComputeLayoutTimer = new QTimer( this ); + connect (mComputeLayoutTimer ,SIGNAL(timeout()), this, SLOT ( slotComputeLayout())); + + #ifndef DESKTOP_VERSION resize( QApplication::desktop()->size() ); #else resize(640, 480 ); @@ -1350,15 +1355,27 @@ 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() { static int lastWid = 0; @@ -1377,10 +1394,12 @@ 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(); @@ -1504,14 +1523,15 @@ void KOMonthView::computeLayout() if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) { 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; diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index a92421b..89912e0 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h @@ -26,8 +26,9 @@ #include <qlistbox.h> #include <qpoint.h> #include <qwidgetstack.h> #include <qlayout.h> +#include <qtimer.h> #include <qintdict.h> #include <qpushbutton.h> #include <qvaluelist.h> #include <qptrvector.h> @@ -250,8 +251,9 @@ class KOMonthView: public KOEventView void setSelectedCell( MonthViewCell * ); void switchView(); protected slots: + void slotComputeLayout(); void selectInternalWeekNum ( int ); void processSelectionChange(); signals: void nextMonth(); @@ -264,8 +266,9 @@ class KOMonthView: public KOEventView void viewChanged(); void updateDayLabels(); private: + QTimer* mComputeLayoutTimer; NavigatorBar* mNavigatorBar; int currentWeek(); bool clPending; QWidgetStack * mWidStack; diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index cc0ce9b..94d74f1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -240,8 +240,9 @@ void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) mMainView->leftFrame()->hide(); } else { mMainView->leftFrame()->show(); } + //if ( mCurrentView == mMonthView ) qApp->processEvents(); emit signalFullScreen( !fullScreen ); if ( callUpdateView ) mMainView->updateView(); |