From 70e39d0927de250e35e88299bc02887e0d163693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 10 Jun 2010 08:52:57 +0000 Subject: [PATCH] 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 --- src/apps/launchbox/PadView.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/apps/launchbox/PadView.cpp b/src/apps/launchbox/PadView.cpp index 6166826f90..080e1a22c1 100644 --- a/src/apps/launchbox/PadView.cpp +++ b/src/apps/launchbox/PadView.cpp @@ -297,7 +297,10 @@ PadView::RemoveButton(LaunchButton* button) LaunchButton* PadView::ButtonAt(int32 index) const { - return dynamic_cast(ChildAt(index)); + BLayoutItem* item = fButtonLayout->ItemAt(index); + if (item == NULL) + return NULL; + return dynamic_cast(item->View()); }