HaikuDepot: Avoid showing ugly rating info when there are no ratings.
This commit is contained in:
parent
735ec4c018
commit
cb67ac0163
@ -442,6 +442,7 @@ public:
|
|||||||
|
|
||||||
fRatingView->SetRating(ratingSummary.averageRating);
|
fRatingView->SetRating(ratingSummary.averageRating);
|
||||||
|
|
||||||
|
if (ratingSummary.ratingCount > 0) {
|
||||||
BString avgRating;
|
BString avgRating;
|
||||||
avgRating.SetToFormat("%.1f", ratingSummary.averageRating);
|
avgRating.SetToFormat("%.1f", ratingSummary.averageRating);
|
||||||
fAvgRating->SetText(avgRating);
|
fAvgRating->SetText(avgRating);
|
||||||
@ -453,6 +454,10 @@ public:
|
|||||||
voteInfo.ReplaceAll("%Votes%", votes);
|
voteInfo.ReplaceAll("%Votes%", votes);
|
||||||
|
|
||||||
fVoteInfo->SetText(voteInfo);
|
fVoteInfo->SetText(voteInfo);
|
||||||
|
} else {
|
||||||
|
fAvgRating->SetText("");
|
||||||
|
fVoteInfo->SetText(B_TRANSLATE("n/a"));
|
||||||
|
}
|
||||||
|
|
||||||
InvalidateLayout();
|
InvalidateLayout();
|
||||||
Invalidate();
|
Invalidate();
|
||||||
|
Loading…
Reference in New Issue
Block a user