summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebookweek.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/datebookweek.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebookweek.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp
index dad1c3f..8435132 100644
--- a/core/pim/datebook/datebookweek.cpp
+++ b/core/pim/datebook/datebookweek.cpp
@@ -304,28 +304,40 @@ void DateBookWeekView::drawContents( QPainter *p, int cx, int cy, int cw, int ch
304 DateBookWeekItem *i = it.current(); 304 DateBookWeekItem *i = it.current();
305 if ( i->geometry().intersects( ur ) ) { 305 if ( i->geometry().intersects( ur ) ) {
306 p->setBrush( i->color() ); 306 p->setBrush( i->color() );
307 p->drawRect( i->geometry() ); 307 p->drawRect( i->geometry() );
308 } 308 }
309 } 309 }
310} 310}
311 311
312void DateBookWeekView::resizeEvent( QResizeEvent *e ) 312void DateBookWeekView::resizeEvent( QResizeEvent *e )
313{ 313{
314 const int hourWidth = 20; 314 const int hourWidth = 20;
315 QScrollView::resizeEvent( e ); 315 QScrollView::resizeEvent( e );
316
317#warning check the geometry i have choosen BRANCH_1_0 (waspe)
318
319 //HEAD
320 /*
316 int avail = visibleWidth(); 321 int avail = visibleWidth();
317 header->setGeometry( leftMargin()+frameWidth()+frameRect().left() , frameWidth(), 322 header->setGeometry( leftMargin()+frameWidth()+frameRect().left() , frameWidth(),
318 visibleWidth(), header->sizeHint().height() ); 323 visibleWidth(), header->sizeHint().height() );
319 setMargins( 0, header->sizeHint().height(), 0, 0 ); 324 setMargins( 0, header->sizeHint().height(), 0, 0 );
325 */
326 //BRANCH_1_0
327 int avail = width()-qApp->style().scrollBarExtent().width()-1;
328 header->setGeometry( 0, 0, avail, header->sizeHint().height() );
329 setMargins( 0, header->height(), 0, 0 );
330
331
320 header->resizeSection( 0, hourWidth ); 332 header->resizeSection( 0, hourWidth );
321 int sw = (avail - hourWidth) / 7; 333 int sw = (avail - hourWidth) / 7;
322 for ( int i = 1; i < 7; i++ ) 334 for ( int i = 1; i < 7; i++ )
323 header->resizeSection( i, sw ); 335 header->resizeSection( i, sw );
324 header->resizeSection( 7, avail - hourWidth - sw*6 ); 336 header->resizeSection( 7, avail - hourWidth - sw*6 );
325} 337}
326 338
327void DateBookWeekView::setStartOfWeek( bool bStartOnMonday ) 339void DateBookWeekView::setStartOfWeek( bool bStartOnMonday )
328{ 340{
329 bOnMonday = bStartOnMonday; 341 bOnMonday = bStartOnMonday;
330 initNames(); 342 initNames();
331} 343}