From d6a2d5594fc7dd95e0b4d6c993672de706d3bba5 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Wed, 15 Oct 2008 19:23:09 +0000 Subject: First step for having a details view, where only the icon + name act as selectable area (not the whole width of the name column - similar to KDE3). Thanks to Simon St. James for the original patch! Currently it is very confusing that although only the icon + name is selectable, still the selection and hovering is drawn above the whole column width. This will be fixed before KDE 4.2. CCBUG: 165999 CCMAIL: simon@etotheipiplusone.com svn path=/trunk/KDE/kdebase/apps/; revision=871834 --- src/dolphindetailsview.h | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/dolphindetailsview.h') diff --git a/src/dolphindetailsview.h b/src/dolphindetailsview.h index bd8f1e8a8..512bd6201 100644 --- a/src/dolphindetailsview.h +++ b/src/dolphindetailsview.h @@ -63,6 +63,8 @@ protected: virtual void wheelEvent(QWheelEvent* event); virtual void currentChanged(const QModelIndex& current, const QModelIndex& previous); virtual bool eventFilter(QObject* watched, QEvent* event); + virtual QModelIndex indexAt (const QPoint& point) const; + virtual void setSelection(const QRect& rect, QItemSelectionModel::SelectionFlags command); private slots: /** @@ -160,10 +162,17 @@ private: */ void resizeColumns(); + QRect nameColumnRect(const QModelIndex& index) const; + + void setSelectionRecursive(const QModelIndex& startIndex, + const QRect& rect, + QItemSelectionModel::SelectionFlags command); + private: - bool m_autoResize; // if true, the columns are resized automatically to the available width - bool m_expandingTogglePressed; - bool m_keyPressed; // true if a key is pressed currently; info used by currentChanged() + bool m_autoResize : 1; // if true, the columns are resized automatically to the available width + bool m_expandingTogglePressed : 1; + bool m_keyPressed : 1; // true if a key is pressed currently; info used by currentChanged() + bool m_useDefaultIndexAt : 1; // true, if QTreeView::indexAt() should be used DolphinController* m_controller; SelectionManager* m_selectionManager; @@ -173,9 +182,12 @@ private: QRect m_dropRect; + // Elastic band coordinates are relative to the origin of the + // view, not the viewport. bool m_showElasticBand; QPoint m_elasticBandOrigin; QPoint m_elasticBandDestination; + }; #endif -- cgit v1.3