HaikuDepot: Select clicked featured packages

This commit is contained in:
Stephan Aßmus 2014-11-02 01:06:29 +01:00
parent a3056e412a
commit 1f3c1ef1c5

View File

@ -16,6 +16,7 @@
#include <SpaceLayoutItem.h>
#include "BitmapView.h"
#include "MainWindow.h"
#include "MessagePackageListener.h"
#include "RatingView.h"
#include "ScrollableGroupView.h"
@ -40,6 +41,7 @@ public:
new(std::nothrow) OnePackageMessagePackageListener(this))
{
SetViewColor(255, 255, 255);
SetEventMask(B_POINTER_EVENTS);
fIconView = new BitmapView("package icon view");
fTitleView = new BStringView("package title view", "");
@ -106,6 +108,15 @@ public:
}
}
}
virtual void MouseDown(BPoint where)
{
if (Bounds().Contains(where)) {
BMessage message(MSG_PACKAGE_SELECTED);
message.AddString("title", PackageTitle());
Window()->PostMessage(&message);
}
}
void SetPackage(const PackageInfoRef& package)
{