Fixed SetTarget() - BTW is even correctly implemented in R5.
Beautified SetBorderHighlighting(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6669 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -291,13 +291,13 @@ BScrollView::Border() const
|
|||||||
status_t
|
status_t
|
||||||
BScrollView::SetBorderHighlighted(bool state)
|
BScrollView::SetBorderHighlighted(bool state)
|
||||||
{
|
{
|
||||||
if (fBorder != B_FANCY_BORDER)
|
|
||||||
return B_ERROR;
|
|
||||||
|
|
||||||
if (fHighlighted == state)
|
if (fHighlighted == state)
|
||||||
// no change
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
|
if (fBorder != B_FANCY_BORDER)
|
||||||
|
// highlighting only works for B_FANCY_BORDER
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
fHighlighted = state;
|
fHighlighted = state;
|
||||||
|
|
||||||
// ToDo: The BeBook describes something like this:
|
// ToDo: The BeBook describes something like this:
|
||||||
@@ -329,21 +329,30 @@ BScrollView::IsBorderHighlighted() const
|
|||||||
void
|
void
|
||||||
BScrollView::SetTarget(BView *target)
|
BScrollView::SetTarget(BView *target)
|
||||||
{
|
{
|
||||||
|
if (fTarget == target)
|
||||||
|
return;
|
||||||
|
|
||||||
if (fTarget != NULL) {
|
if (fTarget != NULL) {
|
||||||
fTarget->TargetedByScrollView(NULL);
|
fTarget->TargetedByScrollView(NULL);
|
||||||
RemoveChild(fTarget);
|
RemoveChild(fTarget);
|
||||||
|
|
||||||
// ToDo: investigate if we are supposed to delete it
|
// we are not supposed to delete the view
|
||||||
//delete fTarget;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fTarget = target;
|
fTarget = target;
|
||||||
|
if (fHorizontalScrollBar != NULL)
|
||||||
|
fHorizontalScrollBar->SetTarget(target);
|
||||||
|
if (fVerticalScrollBar != NULL)
|
||||||
|
fVerticalScrollBar->SetTarget(target);
|
||||||
|
|
||||||
if (target != NULL) {
|
if (target != NULL) {
|
||||||
|
target->MoveTo(BorderSize(fBorder), BorderSize(fBorder));
|
||||||
|
target->TargetedByScrollView(this);
|
||||||
|
|
||||||
AddChild(target, ChildAt(0));
|
AddChild(target, ChildAt(0));
|
||||||
// This way, we are making sure that the target will
|
// This way, we are making sure that the target will
|
||||||
// be added top most in the list (which is important
|
// be added top most in the list (which is important
|
||||||
// for unarchiving)
|
// for unarchiving)
|
||||||
target->TargetedByScrollView(this);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user