summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
authorzautrix <zautrix>2005-04-01 18:10:09 (UTC)
committer zautrix <zautrix>2005-04-01 18:10:09 (UTC)
commitedc032c21ae3788d02a632ea8066e4ac5a4feedb (patch) (unidiff)
tree8e59c8dcf1cc3021694025627d36e152f7adc389 /korganizer/koagendaview.cpp
parent5d88f92b76a760f100384ea5fa6ed143088d19bb (diff)
downloadkdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.zip
kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.gz
kdepimpi-edc032c21ae3788d02a632ea8066e4ac5a4feedb.tar.bz2
fixes
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 218396d..072d464 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -118,9 +118,10 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
118 118
119 // now, for a workaround... 119 // now, for a workaround...
120 // these two assignments fix the weird redraw bug 120 // these two assignments fix the weird redraw bug
121 mRedrawNeeded = true;
121 if ( mRedrawNeeded ) { 122 if ( mRedrawNeeded ) {
122 cx = contentsX() + 2; 123 cx = contentsX() + frameWidth()*2;
123 cw = contentsWidth() - 2; 124 cw = contentsWidth() ;
124 // end of workaround 125 // end of workaround
125 126
126 int cell = ((int)(cy/mCellHeight)); 127 int cell = ((int)(cy/mCellHeight));
@@ -152,13 +153,13 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
152 borderWidth = 4; 153 borderWidth = 4;
153 timeHeight = fm.height(); 154 timeHeight = fm.height();
154 } 155 }
155 timeHeight -= (timeHeight/4-2); 156 //timeHeight -= (timeHeight/4-2);
156 QFont sFont = nFont; 157 QFont sFont = nFont;
157 sFont.setPointSize( sFont.pointSize()/2+2 ); 158 sFont.setPointSize( sFont.pointSize()/2+2 );
158 QFontMetrics fmS( sFont ); 159 QFontMetrics fmS( sFont );
159 int sHei = fmS.height(); 160 int sHei = fmS.height();
160 sHei -= (sHei/4-2); 161 //sHei -= (sHei/4-2);
161 int startW = this->width() - frameWidth(); 162 int startW = this->width() - frameWidth()-1;
162 while (y < cy + ch) { 163 while (y < cy + ch) {
163 p->drawLine(cx,y,cx+tW,y); 164 p->drawLine(cx,y,cx+tW,y);
164 hour.setNum(cell); 165 hour.setNum(cell);
@@ -173,14 +174,14 @@ void TimeLabels::drawContents(QPainter *p,int cx, int cy, int cw, int ch)
173 } 174 }
174 175
175 // center and draw the time label 176 // center and draw the time label
176 int timeWidth = fm.width(hour+"i"); 177 int timeWidth = fm.width(hour);
177 int tw2 = fm.width(suffix); 178 int tw2 = fm.width(suffix);
178 int offset = startW - timeWidth - tw2 ; 179 int offset = startW - timeWidth - tw2 ;
179 p->setFont( nFont ); 180 p->setFont( nFont );
180 p->drawText(cx - borderWidth + offset, y+ timeHeight, hour); 181 p->drawText( offset, y+ timeHeight, hour);
181 p->setFont( sFont ); 182 p->setFont( sFont );
182 offset = startW - tw2-1; 183 offset = startW - tw2+1;
183 p->drawText(cx - borderWidth + offset, y+ sHei, suffix); 184 p->drawText( offset, y+ sHei, suffix);
184 185
185 // increment indices 186 // increment indices
186 y += mCellHeight; 187 y += mCellHeight;
@@ -418,8 +419,7 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
418 int heibut = mExpandButton->sizeHint().height()+4; 419 int heibut = mExpandButton->sizeHint().height()+4;
419 if ( heibut > widebut ) 420 if ( heibut > widebut )
420 widebut = heibut ; 421 widebut = heibut ;
421 if ( QApplication::desktop()->width() < 480 ) 422
422 widebut = widebut*3/2;
423 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, 423 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
424 // QSizePolicy::Fixed ) ); 424 // QSizePolicy::Fixed ) );
425 mExpandButton->setFixedSize( widebut, widebut); 425 mExpandButton->setFixedSize( widebut, widebut);
@@ -717,7 +717,7 @@ void KOAgendaView::createDayLabels()
717 appendLabels = true; 717 appendLabels = true;
718 dayLabel = getNewDaylabel(); 718 dayLabel = getNewDaylabel();
719 } 719 }
720 dayLabel->setFixedWidth( mTimeLabels->width()+2 ); 720 dayLabel->setFixedWidth( mTimeLabels->width()+mAgenda->frameWidth() );
721 dayLabel->setFont( dlf ); 721 dayLabel->setFont( dlf );
722 dayLabel->setNum( -1 ); 722 dayLabel->setNum( -1 );
723 //dayLabel->setAlignment(QLabel::AlignHCenter); 723 //dayLabel->setAlignment(QLabel::AlignHCenter);
@@ -828,8 +828,8 @@ void KOAgendaView::createDayLabels()
828 dayLabel = getNewDaylabel(); 828 dayLabel = getNewDaylabel();
829 } 829 }
830 //dayLabel->hide();//test only 830 //dayLabel->hide();//test only
831 831 qDebug("fremwidd %d ", mAgenda->frameWidth());
832 int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()-3 ) % mSelectedDates.count() ; 832 int offset = (mAgenda->width() - mAgenda->verticalScrollBar()->width()- (mAgenda->frameWidth()*2) ) % mSelectedDates.count() ;
833 if ( offset < 0 ) offset = 0; 833 if ( offset < 0 ) offset = 0;
834 //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); 834 //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 );
835 dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); 835 dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) );