[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kdeui
From:       David Faure <faure () kde ! org>
Date:       2003-03-14 20:27:10
[Download RAW message or body]

CVS commit by faure: 

Fix in KListView::isExecuteArea by Pascal Letourneau, when there is a horizontal
scrollbar (and contentsX() > 0).
It also made me see a bug in KListView::slotOnItem, but since
KonqBaseListViewWidget::slotOnItem() does it right, it wasn't noticed before.


  M +3 -1      klistview.cpp   1.196


--- kdelibs/kdeui/klistview.cpp  #1.195:1.196
@@ -461,4 +461,5 @@ bool KListView::isExecuteArea( int x )
       offset += columnWidth( header()->mapToSection( index ) );
 
+    x += contentsX(); // in case of a horizontal scrollbar
     return ( x > offset && x < ( offset + width ) );
   }
@@ -467,5 +468,6 @@ bool KListView::isExecuteArea( int x )
 void KListView::slotOnItem( QListViewItem *item )
 {
-  if ( item && isExecuteArea( QCursor::pos().x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) {
+  QPoint vp = viewport()->mapFromGlobal( QCursor::pos() );
+  if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) {
     d->autoSelect.start( d->autoSelectDelay, true );
     d->pCurrentItem = item;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic