When initially starting filtering we need to make sure that non-matching poses

fall out of the selection. The same is later done when removing them from the
matching subset, so moved that to a common EnsurePoseUnselected().


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35345 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz 2010-01-30 17:10:46 +00:00
parent beb2e05421
commit ac53da69c7
2 changed files with 10 additions and 1 deletions

View File

@ -9607,7 +9607,7 @@ BPoseView::SetWidgetTextOutline(bool on)
void
BPoseView::RemoveFilteredPose(BPose *pose, int32 index)
BPoseView::EnsurePoseUnselected(BPose *pose)
{
if (pose == fDropTarget)
fDropTarget = NULL;
@ -9626,7 +9626,13 @@ BPoseView::RemoveFilteredPose(BPose *pose, int32 index)
if (fSelectionChangedHook)
ContainerWindow()->SelectionChanged();
}
}
void
BPoseView::RemoveFilteredPose(BPose *pose, int32 index)
{
EnsurePoseUnselected(pose);
fFilteredPoseList->RemoveItemAt(index);
BRect invalidRect = CalcPoseRectList(pose, index);
@ -9744,6 +9750,8 @@ BPoseView::StartFiltering()
BPose *pose = fPoseList->ItemAt(i);
if (FilterPose(pose))
fFilteredPoseList->AddItem(pose);
else
EnsurePoseUnselected(pose);
}
Invalidate();

View File

@ -613,6 +613,7 @@ class BPoseView : public BView {
bool IsValidAddPosesThread(thread_id) const;
// filtering
void EnsurePoseUnselected(BPose *pose);
void RemoveFilteredPose(BPose *pose, int32 index);
void FilterChanged();
void UpdateAfterFilterChange();