HaikuDepot: Package title tweaks, show publisher
This commit is contained in:
@@ -99,16 +99,30 @@ public:
|
|||||||
{
|
{
|
||||||
fIconView = new BitmapView("package icon view");
|
fIconView = new BitmapView("package icon view");
|
||||||
fTitleView = new BStringView("package title view", "");
|
fTitleView = new BStringView("package title view", "");
|
||||||
|
fPublisherView = new BStringView("package publisher view", "");
|
||||||
|
|
||||||
// Title font
|
// Title font
|
||||||
BFont font;
|
BFont font;
|
||||||
GetFont(&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);
|
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)
|
BLayoutBuilder::Group<>(this)
|
||||||
.Add(fIconView)
|
.Add(fIconView)
|
||||||
.Add(fTitleView)
|
.AddGroup(B_VERTICAL, 0.0f)
|
||||||
|
.Add(fTitleView)
|
||||||
|
.Add(fPublisherView)
|
||||||
|
.End()
|
||||||
.AddGlue()
|
.AddGlue()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
@@ -127,6 +141,10 @@ public:
|
|||||||
|
|
||||||
fTitleView->SetText(package.Title());
|
fTitleView->SetText(package.Title());
|
||||||
|
|
||||||
|
BString publisher = B_TRANSLATE("by %Publisher%");
|
||||||
|
publisher.ReplaceAll("%Publisher%", package.Publisher().Name());
|
||||||
|
fPublisherView->SetText(publisher);
|
||||||
|
|
||||||
InvalidateLayout();
|
InvalidateLayout();
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
@@ -134,11 +152,13 @@ public:
|
|||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
fTitleView->SetText("");
|
fTitleView->SetText("");
|
||||||
|
fPublisherView->SetText("");
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BitmapView* fIconView;
|
BitmapView* fIconView;
|
||||||
BStringView* fTitleView;
|
BStringView* fTitleView;
|
||||||
|
BStringView* fPublisherView;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -180,7 +200,7 @@ public:
|
|||||||
.Add(fDescriptionView)
|
.Add(fDescriptionView)
|
||||||
.AddGroup(B_HORIZONTAL)
|
.AddGroup(B_HORIZONTAL)
|
||||||
.AddGlue()
|
.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(fEmailIconView, 0, 0)
|
||||||
.Add(fEmailLinkView, 1, 0)
|
.Add(fEmailLinkView, 1, 0)
|
||||||
.Add(fWebsiteIconView, 0, 1)
|
.Add(fWebsiteIconView, 0, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user