Adding a button at a specific position did not work since converting LaunchBox

to using layout management. When storing the settings, the new button was stored
last. Using the BLayoutItem at the given index retrieves the correct button.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37077 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2010-06-10 08:52:57 +00:00
parent 5d6d1935d6
commit 70e39d0927

View File

@ -297,7 +297,10 @@ PadView::RemoveButton(LaunchButton* button)
LaunchButton*
PadView::ButtonAt(int32 index) const
{
return dynamic_cast<LaunchButton*>(ChildAt(index));
BLayoutItem* item = fButtonLayout->ItemAt(index);
if (item == NULL)
return NULL;
return dynamic_cast<LaunchButton*>(item->View());
}