┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/folders/folderspanel.h
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-11-26 01:05:58 +0100
committerPeter Penz <[email protected]>2011-11-26 01:16:31 +0100
commit362817d1834f2ada3ea4552a25fa39bbbb540f8c (patch)
tree706f316224397b44f95516ba857bb8d380a0bb47 /src/panels/folders/folderspanel.h
parentbf1a8f989e75a50c9a5c839e69573a87ab9ad934 (diff)
Folders Panel fixes
The following functionality from Dolphin 1.x has been ported to the new view-engine: - Allow expanding/collapsing of items - Automatically select the current item - Context menu for items Related improvements to the view-engine: - Make the expanding/collapsing interface already accessible in the base classes KItemModelBase and KItemListView. If no expanding/collapsing is supported at all by derived models (which is usually the default case) simply not reimplementing those 3 methods is sufficient and it does not introduce an additional complexity like in QAbstractItemModel/QModelIndex. - Automatically handle the expanding/collapsing in KItemListController. This also includes the key-handling, which is quite special for expandable items. - Don't let KItemListView automatically scroll to the current item if the current item got changed. The automatic scrolling should only be done if the current item has been changed by the user. Hence this functionality has been moved to the KItemListController which currently only triggers the automatic scrolling if the current item has been changed by the keyboard (we might extend the usecases later if required).
Diffstat (limited to 'src/panels/folders/folderspanel.h')
-rw-r--r--src/panels/folders/folderspanel.h48
1 files changed, 14 insertions, 34 deletions
diff --git a/src/panels/folders/folderspanel.h b/src/panels/folders/folderspanel.h
index 70390da60..d249f850f 100644
--- a/src/panels/folders/folderspanel.h
+++ b/src/panels/folders/folderspanel.h
@@ -63,37 +63,14 @@ protected:
/** @see QWidget::showEvent() */
virtual void showEvent(QShowEvent* event);
- /** @see QWidget::contextMenuEvent() */
- virtual void contextMenuEvent(QContextMenuEvent* event);
-
/** @see QWidget::keyPressEvent() */
virtual void keyPressEvent(QKeyEvent* event);
private slots:
- /**
- * Updates the active view to the URL
- * which is given by the item with the index \a index.
- */
- //void updateActiveView(const QModelIndex& index);
-
- /**
- * Is emitted if URLs have been dropped
- * to the index \a index.
- */
- //void dropUrls(const QModelIndex& index, QDropEvent* event);
-
- /**
- * Expands the treeview to show the directory
- * specified by \a index.
- */
- //void expandToDir(const QModelIndex& index);
-
- /**
- * Assures that the leaf folder gets visible.
- */
- //void scrollToLeaf();
-
- void updateMouseButtons();
+ void slotItemActivated(int index);
+ void slotItemMiddleClicked(int index);
+ void slotItemContextMenuRequested(int index, const QPointF& pos);
+ void slotViewContextMenuRequested(const QPointF& pos);
void slotLoadingCompleted();
@@ -101,6 +78,12 @@ private slots:
void slotVerticalScrollBarMoved(int value);
+ /**
+ * Increases the opacity of the view step by step until it is fully
+ * opaque.
+ */
+ void startFadeInAnimation();
+
private:
/**
* Initializes the base URL of the tree and expands all
@@ -110,20 +93,17 @@ private:
void loadTree(const KUrl& url);
/**
- * Selects the current leaf directory m_leafDir and assures
- * that the directory is visible if the leaf has been set by
- * FoldersPanel::setUrl().
+ * Sets the item with the index \a index as current item, selects
+ * the item and assures that the item will be visible.
*/
- void selectLeafDirectory();
+ void updateCurrentItem(int index);
KFileItemModel* fileItemModel() const;
private:
- bool m_setLeafVisible;
- Qt::MouseButtons m_mouseButtons;
+ bool m_updateCurrentItem;
KDirLister* m_dirLister;
KItemListController* m_controller;
- KUrl m_leafDir;
};
#endif // FOLDERSPANEL_H