Also delete the BScrollBar we detach from the BScrollView.
Even if it was detached, it was still scrolling the view, causing bug #5077. Moreover we were leaking it. Also call TargetedByScrollBar on the "old" target with a NULL parameter, and on the new target, with "this". git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34516 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -37,10 +37,13 @@ TermScrollView::TermScrollView(const char* name, BView* child, BView* target,
|
|||||||
:
|
:
|
||||||
BScrollView(name, child, resizingMode, 0, false, true, B_NO_BORDER)
|
BScrollView(name, child, resizingMode, 0, false, true, B_NO_BORDER)
|
||||||
{
|
{
|
||||||
|
child->TargetedByScrollView(NULL);
|
||||||
|
|
||||||
// replace the vertical scroll bar with our own
|
// replace the vertical scroll bar with our own
|
||||||
if (fVerticalScrollBar != NULL) {
|
if (fVerticalScrollBar != NULL) {
|
||||||
BRect frame(fVerticalScrollBar->Frame());
|
BRect frame(fVerticalScrollBar->Frame());
|
||||||
RemoveChild(fVerticalScrollBar);
|
RemoveChild(fVerticalScrollBar);
|
||||||
|
delete fVerticalScrollBar;
|
||||||
|
|
||||||
// Overlap one pixel at the top (if required) and the bottom of the
|
// Overlap one pixel at the top (if required) and the bottom of the
|
||||||
// scroll bar with the menu respectively resize knob for aesthetical
|
// scroll bar with the menu respectively resize knob for aesthetical
|
||||||
@@ -54,6 +57,8 @@ TermScrollView::TermScrollView(const char* name, BView* child, BView* target,
|
|||||||
AddChild(scrollBar);
|
AddChild(scrollBar);
|
||||||
fVerticalScrollBar = scrollBar;
|
fVerticalScrollBar = scrollBar;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target->TargetedByScrollView(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user