Skip to content

Commit

Permalink
HaikuDepot: Allow RatingView to be wider than MinSize().
Browse files Browse the repository at this point in the history
  • Loading branch information
stippi committed Sep 27, 2014
1 parent 823d2b8 commit 63269a6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/apps/haikudepot/ui_generic/RatingView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#include <stdio.h>

#include <LayoutUtils.h>


RatingView::RatingView(const char* name)
:
Expand Down Expand Up @@ -62,6 +64,7 @@ RatingView::Draw(BRect updateRect)
SetDrawingMode(B_OP_OVER);

BRect rect(Bounds());
rect.right = x - 2;
rect.left = ceilf(rect.left + (fRating / 5.0f) * rect.Width());

rgb_color color = LowColor();
Expand All @@ -76,21 +79,22 @@ RatingView::Draw(BRect updateRect)
BSize
RatingView::MinSize()
{
return BSize(16 * 5 + 2 * 4, 16 + 2);
BSize size(16 * 5 + 2 * 4, 16 + 2);
return BLayoutUtils::ComposeSize(ExplicitMinSize(), size);
}


BSize
RatingView::PreferredSize()
{
return MinSize();
return BLayoutUtils::ComposeSize(ExplicitPreferredSize(), MinSize());
}


BSize
RatingView::MaxSize()
{
return MinSize();
return BLayoutUtils::ComposeSize(ExplicitMaxSize(), MinSize());
}


Expand Down

0 comments on commit 63269a6

Please sign in to comment.