HaikuDepot: Show package version...
... and add short description to about page.
This commit is contained in:
parent
0046c36dfc
commit
c887e3ac0d
@ -331,13 +331,19 @@ public:
|
|||||||
fPublisherView->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT,
|
fPublisherView->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT,
|
||||||
B_ALIGN_VERTICAL_UNSET));
|
B_ALIGN_VERTICAL_UNSET));
|
||||||
|
|
||||||
|
// slightly bigger font
|
||||||
|
GetFont(&font);
|
||||||
|
font.SetSize(ceilf(font.Size() * 1.2f));
|
||||||
|
|
||||||
|
// Version info
|
||||||
|
fVersionInfo = new BStringView("package version info", "");
|
||||||
|
fVersionInfo->SetFont(&font);
|
||||||
|
fVersionInfo->SetHighColor(kLightBlack);
|
||||||
|
|
||||||
// Rating view
|
// Rating view
|
||||||
fRatingView = new RatingView();
|
fRatingView = new RatingView();
|
||||||
|
|
||||||
fAvgRating = new BStringView("package average rating", "");
|
fAvgRating = new BStringView("package average rating", "");
|
||||||
// small font
|
|
||||||
GetFont(&font);
|
|
||||||
font.SetSize(ceilf(font.Size() * 1.2f));
|
|
||||||
fAvgRating->SetFont(&font);
|
fAvgRating->SetFont(&font);
|
||||||
fAvgRating->SetHighColor(kLightBlack);
|
fAvgRating->SetHighColor(kLightBlack);
|
||||||
|
|
||||||
@ -354,6 +360,8 @@ public:
|
|||||||
.Add(fTitleView)
|
.Add(fTitleView)
|
||||||
.Add(fPublisherView)
|
.Add(fPublisherView)
|
||||||
.End()
|
.End()
|
||||||
|
.AddGlue(0.1f)
|
||||||
|
.Add(fVersionInfo)
|
||||||
.AddGlue(0.2f)
|
.AddGlue(0.2f)
|
||||||
.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING)
|
.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING)
|
||||||
.Add(fRatingView)
|
.Add(fRatingView)
|
||||||
@ -383,6 +391,8 @@ public:
|
|||||||
publisher.ReplaceAll("%Publisher%", package.Publisher().Name());
|
publisher.ReplaceAll("%Publisher%", package.Publisher().Name());
|
||||||
fPublisherView->SetText(publisher);
|
fPublisherView->SetText(publisher);
|
||||||
|
|
||||||
|
fVersionInfo->SetText(package.Version());
|
||||||
|
|
||||||
RatingSummary ratingSummary = package.CalculateRatingSummary();
|
RatingSummary ratingSummary = package.CalculateRatingSummary();
|
||||||
|
|
||||||
fRatingView->SetRating(ratingSummary.averageRating);
|
fRatingView->SetRating(ratingSummary.averageRating);
|
||||||
@ -408,6 +418,7 @@ public:
|
|||||||
fIconView->SetBitmap(NULL);
|
fIconView->SetBitmap(NULL);
|
||||||
fTitleView->SetText("");
|
fTitleView->SetText("");
|
||||||
fPublisherView->SetText("");
|
fPublisherView->SetText("");
|
||||||
|
fVersionInfo->SetText("");
|
||||||
fRatingView->SetRating(-1.0f);
|
fRatingView->SetRating(-1.0f);
|
||||||
fAvgRating->SetText("");
|
fAvgRating->SetText("");
|
||||||
fVoteInfo->SetText("");
|
fVoteInfo->SetText("");
|
||||||
@ -419,6 +430,8 @@ private:
|
|||||||
BStringView* fTitleView;
|
BStringView* fTitleView;
|
||||||
BStringView* fPublisherView;
|
BStringView* fPublisherView;
|
||||||
|
|
||||||
|
BStringView* fVersionInfo;
|
||||||
|
|
||||||
RatingView* fRatingView;
|
RatingView* fRatingView;
|
||||||
BStringView* fAvgRating;
|
BStringView* fAvgRating;
|
||||||
BStringView* fVoteInfo;
|
BStringView* fVoteInfo;
|
||||||
@ -590,7 +603,11 @@ public:
|
|||||||
|
|
||||||
void SetPackage(const PackageInfo& package)
|
void SetPackage(const PackageInfo& package)
|
||||||
{
|
{
|
||||||
fDescriptionView->SetText(package.FullDescription());
|
fDescriptionView->SetText(package.ShortDescription());
|
||||||
|
fDescriptionView->Insert(fDescriptionView->TextLength(), "\n\n", 2);
|
||||||
|
fDescriptionView->Insert(fDescriptionView->TextLength(),
|
||||||
|
package.FullDescription(), package.FullDescription().Length());
|
||||||
|
|
||||||
fEmailIconView->SetBitmap(fEmailIcon.Bitmap(SharedBitmap::SIZE_16));
|
fEmailIconView->SetBitmap(fEmailIcon.Bitmap(SharedBitmap::SIZE_16));
|
||||||
fEmailLinkView->SetText(package.Publisher().Email());
|
fEmailLinkView->SetText(package.Publisher().Email());
|
||||||
fWebsiteIconView->SetBitmap(fWebsiteIcon.Bitmap(SharedBitmap::SIZE_16));
|
fWebsiteIconView->SetBitmap(fWebsiteIcon.Bitmap(SharedBitmap::SIZE_16));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user