setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
+ setMouseTracking(true);
viewport()->setAttribute(Qt::WA_Hover);
if (KGlobalSettings::singleClick()) {
}
connect(this, SIGNAL(activated(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
+ connect(this, SIGNAL(entered(const QModelIndex&)),
+ controller, SLOT(emitItemEntered(const QModelIndex&)));
+ connect(this, SIGNAL(viewportEntered()),
+ controller, SLOT(emitViewportEntered()));
connect(controller, SIGNAL(zoomIn()),
this, SLOT(zoomIn()));
connect(controller, SIGNAL(zoomOut()),
emit itemTriggered(index);
}
+void DolphinController::emitItemEntered(const QModelIndex& index)
+{
+ emit itemEntered(index);
+}
+
+void DolphinController::emitViewportEntered()
+{
+ emit viewportEntered();
+}
+
void DolphinController::indicateSelectionChange()
{
emit selectionChanged();
inline bool isZoomOutPossible() const;
public slots:
+ /**
+ * Emits the signal itemTriggered(). The method should be invoked by the
+ * controller parent whenever the user has triggered an item. */
void triggerItem(const QModelIndex& index);
+
+ /**
+ * Emits the signal itemEntered(). The method should be invoked by
+ * the controller parent whenever the mouse cursor is above an item.
+ */
+ void emitItemEntered(const QModelIndex& index);
+
+ /**
+ * Emits the signal viewportEntered(). The method should be invoked by
+ * the controller parent whenever the mouse cursor is above the viewport.
+ */
+ void emitViewportEntered();
+
void indicateSelectionChange();
signals:
*/
void itemTriggered(const QModelIndex& index);
+ /**
+ * Is emitted if the mouse cursor has entered the item
+ * given by \a index.
+ */
+ void itemEntered(const QModelIndex& index);
+
+ /**
+ * Is emitted if the mouse cursor has entered
+ * the viewport. */
+ void viewportEntered();
+
/** Is emitted if the selection has been changed by the user. */
void selectionChanged();
setDragDropMode(QAbstractItemView::DragDrop);
setDropIndicatorShown(false);
+ setMouseTracking(true);
viewport()->setAttribute(Qt::WA_Hover);
const ViewProperties props(controller->url());
}
connect(this, SIGNAL(activated(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
-
+ connect(this, SIGNAL(entered(const QModelIndex&)),
+ controller, SLOT(emitItemEntered(const QModelIndex&)));
+ connect(this, SIGNAL(viewportEntered()),
+ controller, SLOT(emitViewportEntered()));
connect(controller, SIGNAL(zoomIn()),
this, SLOT(zoomIn()));
connect(controller, SIGNAL(zoomOut()),
setViewMode(QListView::IconMode);
setResizeMode(QListView::Adjust);
+ setMouseTracking(true);
viewport()->setAttribute(Qt::WA_Hover);
if (KGlobalSettings::singleClick()) {
}
connect(this, SIGNAL(activated(const QModelIndex&)),
controller, SLOT(triggerItem(const QModelIndex&)));
+ connect(this, SIGNAL(entered(const QModelIndex&)),
+ controller, SLOT(emitItemEntered(const QModelIndex&)));
+ connect(this, SIGNAL(viewportEntered()),
+ controller, SLOT(emitViewportEntered()));
connect(controller, SIGNAL(showPreviewChanged(bool)),
this, SLOT(slotShowPreviewChanged(bool)));
connect(controller, SIGNAL(showAdditionalInfoChanged(bool)),
this, SLOT(emitSelectionChangedSignal()));
connect(m_controller, SIGNAL(activated()),
this, SLOT(requestActivation()));
+ connect(m_controller, SIGNAL(itemEntered(const QModelIndex&)),
+ this, SLOT(showHoverInformation(const QModelIndex&)));
+ connect(m_controller, SIGNAL(viewportEntered()),
+ this, SLOT(clearHoverInformation()));
createView();
applyCutItemEffect();
}
+void DolphinView::showHoverInformation(const QModelIndex& index)
+{
+ if (hasSelection()) {
+ return;
+ }
+
+ const KFileItem* item = fileItem(index);
+ if (item != 0) {
+ m_statusBar->setMessage(item->getStatusBarInfo(), DolphinStatusBar::Default);
+ emit requestItemInfo(item->url());
+ }
+}
+
+void DolphinView::clearHoverInformation()
+{
+ m_statusBar->clear();
+}
+
+
void DolphinView::createView()
{
// delete current view
/** Applies an item effect to all cut items of the clipboard. */
void updateCutItems();
+ /**
+ * Updates the status bar to show hover information for the
+ * item with the index \a index. If currently other items are selected,
+ * no hover information is shown.
+ * @see DolphinView::clearHoverInformation()
+ */
+ void showHoverInformation(const QModelIndex& index);
+
+ /**
+ * Clears the hover information shown in the status bar.
+ * @see DolphinView::showHoverInformation().
+ */
+ void clearHoverInformation();
+
private:
void startDirLister(const KUrl& url, bool reload = false);