From 63269a60e45ccdfc9fa4eed64d2654cc2600e8c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 27 Sep 2014 22:45:58 +0200 Subject: [PATCH] HaikuDepot: Allow RatingView to be wider than MinSize(). --- src/apps/haikudepot/ui_generic/RatingView.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/apps/haikudepot/ui_generic/RatingView.cpp b/src/apps/haikudepot/ui_generic/RatingView.cpp index ab97cb1fa0..aab3174863 100644 --- a/src/apps/haikudepot/ui_generic/RatingView.cpp +++ b/src/apps/haikudepot/ui_generic/RatingView.cpp @@ -8,6 +8,8 @@ #include +#include + RatingView::RatingView(const char* name) : @@ -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(); @@ -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()); }