Skip to content

Commit

Permalink
HaikuDepot: Package title tweaks, show publisher
Browse files Browse the repository at this point in the history
  • Loading branch information
stippi committed Aug 1, 2013
1 parent b42e741 commit c4a4cf9
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/apps/haiku-depot/PackageInfoView.cpp
Expand Up @@ -99,16 +99,30 @@ class TitleView : public BGroupView {
{
fIconView = new BitmapView("package icon view");
fTitleView = new BStringView("package title view", "");
fPublisherView = new BStringView("package publisher view", "");

// Title font
BFont font;
GetFont(&font);
font.SetSize(font.Size() * 2.0f);
font_family family;
font_style style;
font.SetSize(ceilf(font.Size() * 1.5f));
font.GetFamilyAndStyle(&family, &style);
font.SetFamilyAndStyle(family, "Bold");
fTitleView->SetFont(&font);

// Publisher font
GetFont(&font);
font.SetSize(std::max(9.0f, floorf(font.Size() * 0.9f)));
font.SetFamilyAndStyle(family, "Italic");
fPublisherView->SetFont(&font);

BLayoutBuilder::Group<>(this)
.Add(fIconView)
.Add(fTitleView)
.AddGroup(B_VERTICAL, 0.0f)
.Add(fTitleView)
.Add(fPublisherView)
.End()
.AddGlue()
;
}
Expand All @@ -126,6 +140,10 @@ class TitleView : public BGroupView {
fIconView->SetBitmap(NULL);

fTitleView->SetText(package.Title());

BString publisher = B_TRANSLATE("by %Publisher%");
publisher.ReplaceAll("%Publisher%", package.Publisher().Name());
fPublisherView->SetText(publisher);

InvalidateLayout();
Invalidate();
Expand All @@ -134,11 +152,13 @@ class TitleView : public BGroupView {
void Clear()
{
fTitleView->SetText("");
fPublisherView->SetText("");
}

private:
BitmapView* fIconView;
BStringView* fTitleView;
BStringView* fPublisherView;
};


Expand Down Expand Up @@ -180,7 +200,7 @@ class AboutView : public BView {
.Add(fDescriptionView)
.AddGroup(B_HORIZONTAL)
.AddGlue()
.AddGrid(B_USE_SMALL_SPACING, B_USE_SMALL_SPACING)
.AddGrid(B_USE_HALF_ITEM_SPACING, B_USE_HALF_ITEM_SPACING)
.Add(fEmailIconView, 0, 0)
.Add(fEmailLinkView, 1, 0)
.Add(fWebsiteIconView, 0, 1)
Expand Down

0 comments on commit c4a4cf9

Please sign in to comment.