HaikuDepot: Fix click detection in featured packages
Take window activation and parent bounds (a featured package scrolled outside the visible region within the parent) into account.
This commit is contained in:
@@ -111,7 +111,12 @@ public:
|
|||||||
|
|
||||||
virtual void MouseDown(BPoint where)
|
virtual void MouseDown(BPoint where)
|
||||||
{
|
{
|
||||||
if (Bounds().Contains(where)) {
|
BRect bounds = Bounds();
|
||||||
|
BRect parentBounds = Parent()->Bounds();
|
||||||
|
ConvertFromParent(&parentBounds);
|
||||||
|
bounds = bounds & parentBounds;
|
||||||
|
|
||||||
|
if (bounds.Contains(where) && Window()->IsActive()) {
|
||||||
BMessage message(MSG_PACKAGE_SELECTED);
|
BMessage message(MSG_PACKAGE_SELECTED);
|
||||||
message.AddString("title", PackageTitle());
|
message.AddString("title", PackageTitle());
|
||||||
Window()->PostMessage(&message);
|
Window()->PostMessage(&message);
|
||||||
|
|||||||
Reference in New Issue
Block a user