HaikuDepot: Implement publisher hyperlink handling.
- Clicking the publisher link now actually attempts to open the site in the browser.
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
|
|
||||||
|
#include <support/Url.h>
|
||||||
|
|
||||||
#include "BitmapButton.h"
|
#include "BitmapButton.h"
|
||||||
#include "BitmapView.h"
|
#include "BitmapView.h"
|
||||||
#include "MarkupParser.h"
|
#include "MarkupParser.h"
|
||||||
@@ -654,6 +656,27 @@ public:
|
|||||||
Clear();
|
Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void AttachedToWindow()
|
||||||
|
{
|
||||||
|
fWebsiteLinkView->SetTarget(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void MessageReceived(BMessage* message)
|
||||||
|
{
|
||||||
|
switch(message->what) {
|
||||||
|
case MSG_VISIT_PUBLISHER_WEBSITE:
|
||||||
|
{
|
||||||
|
BPrivate::Support::BUrl url(fWebsiteLinkView->Text());
|
||||||
|
url.OpenWithPreferredApplication();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
BView::MessageReceived(message);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void SetPackage(const PackageInfo& package)
|
void SetPackage(const PackageInfo& package)
|
||||||
{
|
{
|
||||||
fDescriptionView->SetText(package.ShortDescription(),
|
fDescriptionView->SetText(package.ShortDescription(),
|
||||||
@@ -696,7 +719,7 @@ private:
|
|||||||
|
|
||||||
SharedBitmap fWebsiteIcon;
|
SharedBitmap fWebsiteIcon;
|
||||||
BitmapView* fWebsiteIconView;
|
BitmapView* fWebsiteIconView;
|
||||||
BStringView* fWebsiteLinkView;
|
LinkView* fWebsiteLinkView;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user