Skip to content

Commit

Permalink
HaikuDepot: Show package version...
Browse files Browse the repository at this point in the history
 ... and add short description to about page.
  • Loading branch information
stippi committed Aug 4, 2013
1 parent 0046c36 commit c887e3a
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions src/apps/haiku-depot/PackageInfoView.cpp
Expand Up @@ -331,13 +331,19 @@ class TitleView : public BGroupView {
fPublisherView->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT,
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
fRatingView = new RatingView();

fAvgRating = new BStringView("package average rating", "");
// small font
GetFont(&font);
font.SetSize(ceilf(font.Size() * 1.2f));
fAvgRating->SetFont(&font);
fAvgRating->SetHighColor(kLightBlack);

Expand All @@ -354,6 +360,8 @@ class TitleView : public BGroupView {
.Add(fTitleView)
.Add(fPublisherView)
.End()
.AddGlue(0.1f)
.Add(fVersionInfo)
.AddGlue(0.2f)
.AddGroup(B_HORIZONTAL, B_USE_SMALL_SPACING)
.Add(fRatingView)
Expand Down Expand Up @@ -383,6 +391,8 @@ class TitleView : public BGroupView {
publisher.ReplaceAll("%Publisher%", package.Publisher().Name());
fPublisherView->SetText(publisher);

fVersionInfo->SetText(package.Version());

RatingSummary ratingSummary = package.CalculateRatingSummary();

fRatingView->SetRating(ratingSummary.averageRating);
Expand All @@ -408,6 +418,7 @@ class TitleView : public BGroupView {
fIconView->SetBitmap(NULL);
fTitleView->SetText("");
fPublisherView->SetText("");
fVersionInfo->SetText("");
fRatingView->SetRating(-1.0f);
fAvgRating->SetText("");
fVoteInfo->SetText("");
Expand All @@ -419,6 +430,8 @@ class TitleView : public BGroupView {
BStringView* fTitleView;
BStringView* fPublisherView;

BStringView* fVersionInfo;

RatingView* fRatingView;
BStringView* fAvgRating;
BStringView* fVoteInfo;
Expand Down Expand Up @@ -590,7 +603,11 @@ class AboutView : public BView {

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));
fEmailLinkView->SetText(package.Publisher().Email());
fWebsiteIconView->SetBitmap(fWebsiteIcon.Bitmap(SharedBitmap::SIZE_16));
Expand Down

0 comments on commit c887e3a

Please sign in to comment.