┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphindetailsview.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-10-15 19:23:09 +0000
committerPeter Penz <[email protected]>2008-10-15 19:23:09 +0000
commitd6a2d5594fc7dd95e0b4d6c993672de706d3bba5 (patch)
treef8c6ef4acaaaba0b37433ffd1ceb43e4d1ec1cdc /src/dolphindetailsview.h
parent20587e7f1402c050156aa717413e742d226a3406 (diff)
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: [email protected] svn path=/trunk/KDE/kdebase/apps/; revision=871834
Diffstat (limited to 'src/dolphindetailsview.h')
-rw-r--r--src/dolphindetailsview.h18
1 files changed, 15 insertions, 3 deletions
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