summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 76982b4..9fd1f68 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -260,97 +260,97 @@ void MonthViewItem::paint(QPainter *p)
260 if ( mMultiday == 2 || mMultiday == 1 ) { 260 if ( mMultiday == 2 || mMultiday == 1 ) {
261 QPointArray pa ( 3 ); 261 QPointArray pa ( 3 );
262 pa.setPoint (0, x+sizeM +sizeM/2, yyy ); 262 pa.setPoint (0, x+sizeM +sizeM/2, yyy );
263 pa.setPoint (1, x+sizeM, yyy+sizeM/2 ); 263 pa.setPoint (1, x+sizeM, yyy+sizeM/2 );
264 pa.setPoint (2, x+sizeM, yyy-sizeM/2 ); 264 pa.setPoint (2, x+sizeM, yyy-sizeM/2 );
265 p->drawPolygon( pa ); 265 p->drawPolygon( pa );
266 } 266 }
267 if ( mMultiday == 1 ) { 267 if ( mMultiday == 1 ) {
268 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 268 // p->fillRect ( x, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
269 269
270 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 ); 270 p->drawLine ( x+1, yyy-sizeM/2, x+1, yyy+sizeM/2 );
271 } 271 }
272 if ( mMultiday == 3 ) { 272 if ( mMultiday == 3 ) {
273 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) ); 273 // p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
274 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 ); 274 p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 );
275 275
276 } 276 }
277 x += sizeM/2 + 1; 277 x += sizeM/2 + 1;
278 x += sizeM + 1; 278 x += sizeM + 1;
279 } 279 }
280 280
281 if ( mIncidence->type() == "Todo" ){ 281 if ( mIncidence->type() == "Todo" ){
282 Todo* td = ( Todo* ) mIncidence; 282 Todo* td = ( Todo* ) mIncidence;
283 if ( td->isCompleted() ) { 283 if ( td->isCompleted() ) {
284 int half = size/2; 284 int half = size/2;
285 p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ; 285 p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ;
286 p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ; 286 p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ;
287 x += half+half + 4; 287 x += half+half + 4;
288 288
289 } else { 289 } else {
290 int val = td->percentComplete()/20; 290 int val = td->percentComplete()/20;
291 p->fillRect ( x+1, y-1, val ,size+2,Qt::black ); 291 p->fillRect ( x+1, y-1, val ,size+2,Qt::black );
292 p->drawRect ( x, y-1,7,size+2); 292 p->drawRect ( x, y-1,7,size+2);
293 x += size + 3; 293 x += size + 3;
294 } 294 }
295 } 295 }
296 QFontMetrics fm = p->fontMetrics(); 296 QFontMetrics fm = p->fontMetrics();
297 int yPos; 297 int yPos;
298 int pmheight = size; 298 int pmheight = size;
299 if( pmheight < fm.height() ) 299 if( pmheight < fm.height() )
300 yPos = fm.ascent() + fm.leading()/2; 300 yPos = fm.ascent() + fm.leading()/2;
301 else 301 else
302 yPos = pmheight/2 - fm.height()/2 + fm.ascent(); 302 yPos = pmheight/2 - fm.height()/2 + fm.ascent();
303 p->setPen( palette().color( QPalette::Normal, sel ? \ 303 p->setPen( palette().color( QPalette::Normal, sel ? \
304 QColorGroup::HighlightedText : QColorGroup::Foreground ) ); 304 QColorGroup::HighlightedText : QColorGroup::Foreground ) );
305 p->drawText( x, yPos, text() ); 305 p->drawText( x, yPos, text() );
306 if ( mIncidence->cancelled() ) { 306 if ( mIncidence->cancelled() ) {
307 int wid = fm.width( text() ); 307 int wid = fm.width( text() );
308 p->drawLine( x, heihei/2 ,x+wid, heihei/2 ); 308 p->drawLine( x, heihei/2-1 ,x+wid, heihei/2-1 );
309 } 309 }
310 310
311} 311}
312 312
313int MonthViewItem::height(const QListBox *lb) const 313int MonthViewItem::height(const QListBox *lb) const
314{ 314{
315 if ( lb ) 315 if ( lb )
316 return lb->fontMetrics().lineSpacing()+1; 316 return lb->fontMetrics().lineSpacing()+1;
317 return 10; 317 return 10;
318} 318}
319 319
320int MonthViewItem::width(const QListBox *lb) const 320int MonthViewItem::width(const QListBox *lb) const
321{ 321{
322 int size = PIXMAP_SIZE; 322 int size = PIXMAP_SIZE;
323 if ( QApplication::desktop()->width() < 300 ) 323 if ( QApplication::desktop()->width() < 300 )
324 size = 3; 324 size = 3;
325 int x = 1; 325 int x = 1;
326 if ( KOPrefs::instance()->mMonthShowIcons ) { 326 if ( KOPrefs::instance()->mMonthShowIcons ) {
327 if ( mInfo ) { 327 if ( mInfo ) {
328 x += size + 1; 328 x += size + 1;
329 } 329 }
330 if( mRecur ) { 330 if( mRecur ) {
331 x += size+1; 331 x += size+1;
332 } 332 }
333 if( mAlarm ) { 333 if( mAlarm ) {
334 x += size+1; 334 x += size+1;
335 } 335 }
336 if( mReply ) { 336 if( mReply ) {
337 x += size+1; 337 x += size+1;
338 } 338 }
339 } 339 }
340 if( mMultiday ) { 340 if( mMultiday ) {
341 x += size+1+2+size/2; 341 x += size+1+2+size/2;
342 } 342 }
343 343
344 return( x + lb->fontMetrics().width( text() ) + 1 ); 344 return( x + lb->fontMetrics().width( text() ) + 1 );
345} 345}
346 346
347 347
348MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par ) 348MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
349 : QWidget( par ), 349 : QWidget( par ),
350 mMonthView( parent ) 350 mMonthView( parent )
351{ 351{
352 352
353 QVBoxLayout *topLayout = new QVBoxLayout( this ); 353 QVBoxLayout *topLayout = new QVBoxLayout( this );
354 354
355 // mLabel = new QLabel( this );QPushButton 355 // mLabel = new QLabel( this );QPushButton
356 mLabel = new QPushButton( this ); 356 mLabel = new QPushButton( this );