┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/views
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2011-12-06 19:46:31 +0100
committerPeter Penz <[email protected]>2011-12-06 19:50:09 +0100
commit9135ff953740f27686e3c5e11dce5b8cae6cd0d0 (patch)
tree9a542bcd71af879723b59bd2b181937a27887046 /src/views
parent0c314917a5a498666817bb4c803736756f11ae2e (diff)
Don't animate when switching view-modes
Currently when switching the view-modes an animation of the items is done, where the position and size is adjusted for the new view-mode. Although this might look nice initially I'd consider this as a kind of animation that is distracting and hence it has been turned off.
Diffstat (limited to 'src/views')
-rw-r--r--src/views/dolphinview.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp
index 7a3903561..94eed5cf3 100644
--- a/src/views/dolphinview.cpp
+++ b/src/views/dolphinview.cpp
@@ -1126,9 +1126,18 @@ void DolphinView::applyViewProperties()
m_container->beginTransaction();
const ViewProperties props(url());
+ KFileItemModel* model = fileItemModel();
const Mode mode = props.viewMode();
if (m_mode != mode) {
+ // Prevent an animated transition of the position and size of the items when switching
+ // the view-mode by temporary clearing the model and updating it again after the view mode
+ // has been modified.
+ const bool restoreModel = (model->count() > 0);
+ if (restoreModel) {
+ model->clear();
+ }
+
const Mode previousMode = m_mode;
m_mode = mode;
@@ -1149,6 +1158,10 @@ void DolphinView::applyViewProperties()
if (m_container->zoomLevel() != oldZoomLevel) {
emit zoomLevelChanged(m_container->zoomLevel(), oldZoomLevel);
}
+
+ if (restoreModel) {
+ loadDirectory(url());
+ }
}
const bool hiddenFilesShown = props.hiddenFilesShown();
@@ -1158,8 +1171,6 @@ void DolphinView::applyViewProperties()
emit hiddenFilesShownChanged(hiddenFilesShown);
}
- KFileItemModel* model = fileItemModel();
-
const bool groupedSorting = props.groupedSorting();
if (groupedSorting != model->groupedSorting()) {
model->setGroupedSorting(groupedSorting);