summaryrefslogtreecommitdiff
authorzecke <zecke>2003-08-30 08:07:32 (UTC)
committer zecke <zecke>2003-08-30 08:07:32 (UTC)
commitd9b5fcc45b1fef5ac11ef549a47561c7382ff451 (patch) (unidiff)
tree8f9e82d455e22be0285a5a8fc47e893b52c05871
parent18cae99f1deb15213074a8fb96f79eae4b0c5a43 (diff)
downloadopie-d9b5fcc45b1fef5ac11ef549a47561c7382ff451.zip
opie-d9b5fcc45b1fef5ac11ef549a47561c7382ff451.tar.gz
opie-d9b5fcc45b1fef5ac11ef549a47561c7382ff451.tar.bz2
do not rely on scrollbars beeing right
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebookweek.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/pim/datebook/datebookweek.cpp b/core/pim/datebook/datebookweek.cpp
index ab7e963..dad1c3f 100644
--- a/core/pim/datebook/datebookweek.cpp
+++ b/core/pim/datebook/datebookweek.cpp
@@ -304,27 +304,28 @@ 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 int avail = width()-qApp->style().scrollBarExtent().width()-1; 316 int avail = visibleWidth();
317 header->setGeometry( 0, 0, avail, header->sizeHint().height() ); 317 header->setGeometry( leftMargin()+frameWidth()+frameRect().left() , frameWidth(),
318 setMargins( 0, header->height(), 0, 0 ); 318 visibleWidth(), header->sizeHint().height() );
319 setMargins( 0, header->sizeHint().height(), 0, 0 );
319 header->resizeSection( 0, hourWidth ); 320 header->resizeSection( 0, hourWidth );
320 int sw = (avail - hourWidth) / 7; 321 int sw = (avail - hourWidth) / 7;
321 for ( int i = 1; i < 7; i++ ) 322 for ( int i = 1; i < 7; i++ )
322 header->resizeSection( i, sw ); 323 header->resizeSection( i, sw );
323 header->resizeSection( 7, avail - hourWidth - sw*6 ); 324 header->resizeSection( 7, avail - hourWidth - sw*6 );
324} 325}
325 326
326void DateBookWeekView::setStartOfWeek( bool bStartOnMonday ) 327void DateBookWeekView::setStartOfWeek( bool bStartOnMonday )
327{ 328{
328 bOnMonday = bStartOnMonday; 329 bOnMonday = bStartOnMonday;
329 initNames(); 330 initNames();
330} 331}