* Removed the call to Refresh() when switching to scaled icon mode as it
would scroll to (0, 0), and screw the now always-in-sync fViewState. After testing every possible mode transition, there seem to be no side effect as the comment would suggest. Stippi, do you remember why it was necessary? See r18699. * This enabled me to do my previously added TODO's. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28231 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
ca5e024130
commit
842cd2b8cc
@ -2003,16 +2003,6 @@ BPoseView::MessageReceived(BMessage *message)
|
||||
if (message->FindInt32("size", &size) == B_OK) {
|
||||
if (size != (int32)IconSizeInt()) {
|
||||
fViewState->SetIconSize(size);
|
||||
|
||||
// we must save the current view origin if we come from
|
||||
// any icon mode. We can't do that in SetViewMode() since
|
||||
// Refresh() resets the current view origin.
|
||||
// TODO: Shouldn't be needed anymore
|
||||
if (ViewMode() != kListMode)
|
||||
fViewState->SetIconOrigin(LeftTop());
|
||||
|
||||
Refresh(); // we need to refresh since the icons need
|
||||
// to be rescaled
|
||||
} else
|
||||
break; // no change
|
||||
}
|
||||
@ -2736,23 +2726,12 @@ BPoseView::SetViewMode(uint32 newMode)
|
||||
}
|
||||
}
|
||||
|
||||
// save the current origin and get origin for new view mode
|
||||
// TODO: shouldn't be needed anymore
|
||||
BPoint origin(LeftTop());
|
||||
BPoint newOrigin(origin);
|
||||
|
||||
if (ViewMode() == kListMode) {
|
||||
// update origin in case of a list <-> icon mode transition
|
||||
BPoint newOrigin;
|
||||
if (ViewMode() == kListMode)
|
||||
newOrigin = fViewState->ListOrigin();
|
||||
fViewState->SetIconOrigin(origin);
|
||||
} else if (oldMode == kListMode) {
|
||||
fViewState->SetListOrigin(origin);
|
||||
else
|
||||
newOrigin = fViewState->IconOrigin();
|
||||
}
|
||||
|
||||
// any transition to kScaleIconMode needs restoring the origin
|
||||
// in any other xIconMode -> xIconMode transition, the origin doesn't change
|
||||
if (ViewMode() == kScaleIconMode)
|
||||
newOrigin = fViewState->IconOrigin();
|
||||
|
||||
PinPointToValidRange(newOrigin);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user