-rw-r--r-- | korganizer/komonthview.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 9888566..6294b98 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp @@ -681,29 +681,25 @@ void MonthViewCell::deselect() enableScrollBars( false ); // updateCell(); } void MonthViewCell::select() { ;// updateCell(); } void MonthViewCell::resizeEvent ( QResizeEvent * ) { if ( !mMonthView->isUpdatePossible() ) return; -#ifndef DESKTOP_VERSION - if ( !isVisible() ){ - return; - } -#endif + int size = height() - mLabel->height() - 2; if ( size > 0 ) mItemList->verticalScrollBar()->setMaximumHeight( size ); size = width() - mLabel->width() -2; if ( size > 0 ) mItemList->horizontalScrollBar()->setMaximumWidth( size ); mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); } void MonthViewCell::defaultAction( QListBoxItem *item ) { @@ -832,24 +828,26 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) mContextMenu = eventPopup(); // updateConfig(); //useless here emit incidenceSelected( 0 ); } KOMonthView::~KOMonthView() { delete mContextMenu; } void KOMonthView::switchView() { + if ( selectedCell( ) ) + selectedCell()->deselect(); mShowWeekView = !mShowWeekView; KOPrefs::instance()->mMonthViewWeek = mShowWeekView; emit showNavigator( !mShowWeekView ); computeLayout(); updateConfig(); } int KOMonthView::maxDatesHint() { return mNumCells; } @@ -1150,29 +1148,30 @@ void KOMonthView::computeLayoutWeek() int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; //qDebug("rowmod %d ", rowModulo); int i; int x,y,w,h; x= 0; y= 0; w = colWid; h = dayLabelHei ; for ( i = 0; i < 7; i++) { if ( i && !( i % daysToShow) && i < 6) { y += hei/(5-daysToShow); x = 0; + w = colWid; } if ( i == daysToShow-colModulo ) ++w; if ( i >= 5 ) { - mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2,h); + mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2+1,h); x -= w/2 ; } else mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); x += w; } x= 0; y= dayLabelHei; w = colWid; h = cellHei; for ( i = 0; i < mCells.count(); ++i) { if ( i > 6 ) { |