Move variable declaration into proper scope and where it's first needed.
git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@357 94f232f2-1747-11df-bad5-a5bfde151594
This commit is contained in:
committed by
Alexandre Deckner
parent
98b056e146
commit
ec7e3b29c4
@@ -315,11 +315,13 @@ DownloadWindow::_DownloadStarted(BWebDownload* download)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fDownloadViewsLayout->AddView(index, view);
|
fDownloadViewsLayout->AddView(index, view);
|
||||||
float viewHeight = view->MinSize().height + 1;
|
|
||||||
|
// Scroll new download into view
|
||||||
if (BScrollBar* scrollBar = fDownloadsScrollView->ScrollBar(B_VERTICAL)) {
|
if (BScrollBar* scrollBar = fDownloadsScrollView->ScrollBar(B_VERTICAL)) {
|
||||||
float min;
|
float min;
|
||||||
float max;
|
float max;
|
||||||
scrollBar->GetRange(&min, &max);
|
scrollBar->GetRange(&min, &max);
|
||||||
|
float viewHeight = view->MinSize().height + 1;
|
||||||
float scrollOffset = min + index * viewHeight;
|
float scrollOffset = min + index * viewHeight;
|
||||||
float scrollBarHeight = scrollBar->Bounds().Height() - 1;
|
float scrollBarHeight = scrollBar->Bounds().Height() - 1;
|
||||||
float value = scrollBar->Value();
|
float value = scrollBar->Value();
|
||||||
@@ -330,6 +332,7 @@ DownloadWindow::_DownloadStarted(BWebDownload* download)
|
|||||||
scrollBar->SetValue(value + diff);
|
scrollBar->SetValue(value + diff);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_SaveSettings();
|
_SaveSettings();
|
||||||
|
|
||||||
SetWorkspaces(B_CURRENT_WORKSPACE);
|
SetWorkspaces(B_CURRENT_WORKSPACE);
|
||||||
|
|||||||
Reference in New Issue
Block a user