]> cloud.milkyroute.net Git - dolphin.git/commitdiff
hover fix for the details mode: hovering should only be done on the name column,...
authorPeter Penz <peter.penz19@gmail.com>
Sat, 12 May 2007 13:41:31 +0000 (13:41 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 12 May 2007 13:41:31 +0000 (13:41 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=663861

src/dolphindetailsview.cpp
src/dolphindetailsview.h

index df07fb9a52a1fa10966cd34c4408b27bfd7aed7d..87fa851655ae943578544918769f73ecf10b6f80 100644 (file)
@@ -71,7 +71,7 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent, DolphinController* contr
     connect(this, SIGNAL(activated(const QModelIndex&)),
             controller, SLOT(triggerItem(const QModelIndex&)));
     connect(this, SIGNAL(entered(const QModelIndex&)),
-            controller, SLOT(emitItemEntered(const QModelIndex&)));
+            this, SLOT(slotEntered(const QModelIndex&)));
     connect(this, SIGNAL(viewportEntered()),
             controller, SLOT(emitViewportEntered()));
     connect(controller, SIGNAL(zoomIn()),
@@ -192,6 +192,18 @@ void DolphinDetailsView::synchronizeSortingState(int column)
     m_controller->indicateSortOrderChange(sortOrder);
 }
 
+void DolphinDetailsView::slotEntered(const QModelIndex& index)
+{
+    const QPoint pos = viewport()->mapFromGlobal(QCursor::pos());
+    const int nameColumnWidth = header()->sectionSize(KDirModel::Name);
+    if (pos.x() < nameColumnWidth) {
+        m_controller->emitItemEntered(index);
+    }
+    else {
+        m_controller->emitViewportEntered();
+    }
+}
+
 void DolphinDetailsView::zoomIn()
 {
     if (isZoomInPossible()) {
index e90a0bd89192b1469331ada8b972ddd4e975f3c6..03f1b8d53ed7d5baf7ffd4350fa7131d8cc405c2 100644 (file)
@@ -72,6 +72,15 @@ private slots:
      */
     void synchronizeSortingState(int column);
 
+    /**
+     * Is invoked when the mouse cursor has entered an item. The controller
+     * gets informed to emit the itemEntered() signal if the mouse cursor
+     * is above the name column. Otherwise the controller gets informed
+     * to emit the itemViewportEntered() signal (all other columns should
+     * behave as viewport area).
+     */
+    void slotEntered(const QModelIndex& index);
+
     void zoomIn();
     void zoomOut();