HaikuDepot: Added PackagesListView::Select(PackageInfo)
which also scrolls the row into view (if it exists).
This commit is contained in:
parent
ede65a8f9b
commit
b2843daed7
@ -758,6 +758,21 @@ PackageListView::AddPackage(const PackageInfoRef& package)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PackageListView::SelectPackage(const PackageInfoRef& package)
|
||||
{
|
||||
PackageRow* row = _FindRow(package);
|
||||
BRow* selected = CurrentSelection();
|
||||
if (row != selected)
|
||||
DeselectAll();
|
||||
if (row != NULL) {
|
||||
AddToSelection(row);
|
||||
SetFocusRow(row, false);
|
||||
ScrollTo(row);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PackageRow*
|
||||
PackageListView::_FindRow(const PackageInfoRef& package, PackageRow* parent)
|
||||
{
|
||||
|
@ -32,6 +32,8 @@ public:
|
||||
virtual void Clear();
|
||||
void AddPackage(const PackageInfoRef& package);
|
||||
|
||||
void SelectPackage(const PackageInfoRef& package);
|
||||
|
||||
private:
|
||||
PackageRow* _FindRow(const PackageInfoRef& package,
|
||||
PackageRow* parent = NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user