┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphiniconsview.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-02-24 08:09:35 +0000
committerPeter Penz <[email protected]>2009-02-24 08:09:35 +0000
commit7b6ace6466cf349a4ce7a080d5e978aa0a7043e2 (patch)
tree42f92ce2db3868834c7f06a63e256011989d93a7 /src/dolphiniconsview.cpp
parent7e7c14ba65bfc524d03bfce00d158010194e9534 (diff)
After renaming an item the view should be scrolled in a way to still have a fully visible renamed item. The implementation required a lot of more code changes as such a fix should require: QAbstractItemView::scrollTo() cannot be used directly (inconsistent default behavior in QListView and QTreeView, a special case for the column view), so the communication has to be done with the DolphinController...
BUG: 185191 svn path=/trunk/KDE/kdebase/apps/; revision=930754
Diffstat (limited to 'src/dolphiniconsview.cpp')
-rw-r--r--src/dolphiniconsview.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp
index f5b69bade..4b861df44 100644
--- a/src/dolphiniconsview.cpp
+++ b/src/dolphiniconsview.cpp
@@ -88,6 +88,8 @@ DolphinIconsView::DolphinIconsView(QWidget* parent, DolphinController* controlle
controller, SLOT(emitViewportEntered()));
connect(controller, SIGNAL(zoomLevelChanged(int)),
this, SLOT(setZoomLevel(int)));
+ connect(controller, SIGNAL(scrollToCurrentItem()),
+ this, SLOT(scrollToCurrentItem()));
const DolphinView* view = controller->dolphinView();
connect(view, SIGNAL(showPreviewChanged()),
@@ -390,6 +392,13 @@ void DolphinIconsView::slotGlobalSettingsChanged(int category)
}
}
+void DolphinIconsView::scrollToCurrentItem()
+{
+ m_enableScrollTo = true;
+ scrollTo(currentIndex());
+ m_enableScrollTo = false;
+}
+
void DolphinIconsView::updateGridSize(bool showPreview, int additionalInfoCount)
{
const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();