author | zautrix <zautrix> | 2005-06-30 04:58:35 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-30 04:58:35 (UTC) |
commit | ba4a6a95356f9a8044257c45347cee8b15667d0c (patch) (side-by-side diff) | |
tree | 63ffa2000426f06cae7ec5be7d1847b5f9fb4e26 | |
parent | 63147898391dbeabca2dc8f48730b324c15a7498 (diff) | |
download | kdepimpi-ba4a6a95356f9a8044257c45347cee8b15667d0c.zip kdepimpi-ba4a6a95356f9a8044257c45347cee8b15667d0c.tar.gz kdepimpi-ba4a6a95356f9a8044257c45347cee8b15667d0c.tar.bz2 |
fixxx
-rw-r--r-- | microkde/kdeui/klistview.cpp | 9 | ||||
-rw-r--r-- | microkde/kdeui/klistview.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp index 25327aa..f7d2187 100644 --- a/microkde/kdeui/klistview.cpp +++ b/microkde/kdeui/klistview.cpp @@ -447,65 +447,74 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse { connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); } else { connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); } connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)), this, SLOT (emitContextMenu (KListView*, QListViewItem*))); //qDebug("KListView::KListView make alternate color configurable"); d->alternateBackground = KGlobalSettings::alternateBackgroundColor(); } KListView::~KListView() { delete d; } bool KListView::isExecuteArea( const QPoint& point ) { if ( itemAt( point ) ) return isExecuteArea( point.x() ); return false; } +QSize KListView::sizeHint() const +{ + //qDebug("KListView::QSize sizeHint() "); +#ifdef DESKTOP_VERSION + QListView::sizeHint(); +#else + return QSize ( 40, 40 ); +#endif +} bool KListView::isExecuteArea( int x ) { if( allColumnsShowFocus() ) return true; else { int offset = 0; int width = columnWidth( 0 ); int pos = header()->mapToIndex( 0 ); for ( int index = 0; index < pos; index++ ) offset += columnWidth( header()->mapToSection( index ) ); x += contentsX(); // in case of a horizontal scrollbar return ( x > offset && x < ( offset + width ) ); } } void KListView::slotOnItem( QListViewItem *item ) { 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; } } void KListView::slotOnViewport() { if ( d->bChangeCursorOverItem ) viewport()->unsetCursor(); d->autoSelect.stop(); diff --git a/microkde/kdeui/klistview.h b/microkde/kdeui/klistview.h index 0058416..9f0d9fd 100644 --- a/microkde/kdeui/klistview.h +++ b/microkde/kdeui/klistview.h @@ -101,64 +101,65 @@ public: * before will be deselected first. * * Additionally the current item is always selected automatically when * navigating using the keyboard, except other items were selected explicitely. * * This way e.g. SHIFT+up/PgUp then SHIFT+down/PgDn leaves no item selected */ enum SelectionModeExt { Single = QListView::Single, Multi = QListView::Multi, Extended = QListView::Extended, NoSelection = QListView::NoSelection, FileManager }; void repaintContents( bool erase = true ) { QScrollView::repaintContents( contentsX(), contentsY(), visibleWidth(), visibleHeight(), erase ); }; /** * Constructor. * * The parameters @p parent and @p name are handled by * @ref QListView, as usual. */ KListView (QWidget *parent = 0, const char *name = 0, bool emulateRightMouse = true ); /** * Destructor. */ virtual ~KListView(); + virtual QSize sizeHint() const; /** * Reimplemented for internal reasons. * Further reimplementations should call this function or else * some features may not work correctly. * * The API is unaffected. */ virtual void setAcceptDrops (bool); /** * This function determines whether the given coordinates are within the * execute area. The execute area is the part of a @ref QListViewItem where mouse * clicks or double clicks respectively generate a @ref #executed() signal. * Depending on @ref QListView::allColumnsShowFocus() this is either the * whole item or only the first column. * @return true if point is inside execute area of an item, false in all * other cases including the case that it is over the viewport. */ virtual bool isExecuteArea( const QPoint& point ); /** * Same thing, but from an x coordinate only. This only checks if x is in * the first column (if all columns don't show focus), without testing if * the y coordinate is over an item or not. */ bool isExecuteArea( int x ); /** * @return a list containing the currently selected items. */ QPtrList<QListViewItem> selectedItems() const; // ### BIC: KDE 4: use an implicitly shared class! (QValueList?) |