diff --git a/src/preferences/media/MediaListItem.cpp b/src/preferences/media/MediaListItem.cpp index e64238404c..8681e0c2ff 100644 --- a/src/preferences/media/MediaListItem.cpp +++ b/src/preferences/media/MediaListItem.cpp @@ -84,22 +84,24 @@ struct MediaListItem::Renderer { onto->FillRect(frame, B_SOLID_LOW); } - frame.left += 4; - frame.top += kITEM_MARGIN; - BRect iconFrame(MediaIcons::IconRectAt(frame.LeftTop() + BPoint(1, 0))); + BPoint point(frame.left + 4.0f, + frame.top + (frame.Height() - MediaIcons::sBounds.Height()) / 2.0f); + + BRect iconFrame(MediaIcons::IconRectAt(point + BPoint(1, 0))); onto->SetDrawingMode(B_OP_OVER); if (fPrimaryIcon && !fDoubleInsets) { onto->DrawBitmap(fPrimaryIcon, iconFrame); - frame.left = iconFrame.right + 1; + point.x = iconFrame.right + 1; } else if (fSecondaryIcon) { onto->DrawBitmap(fSecondaryIcon, iconFrame); } + iconFrame = MediaIcons::IconRectAt(iconFrame.RightTop() + BPoint(1, 0)); if (fDoubleInsets && fPrimaryIcon) { onto->DrawBitmap(fPrimaryIcon, iconFrame); - frame.left = iconFrame.right + 1; + point.x = iconFrame.right + 1; } onto->SetDrawingMode(B_OP_COPY); @@ -108,12 +110,11 @@ struct MediaListItem::Renderer { BFont font = be_plain_font; font_height fontInfo; font.GetHeight(&fontInfo); - float lineHeight = fontInfo.ascent + fontInfo.descent - + fontInfo.leading; + onto->SetFont(&font); - onto->MovePenTo(frame.left + 8, frame.top - + ((frame.Height() - (lineHeight)) / 2) - + (fontInfo.ascent + fontInfo.descent) - 1); + onto->MovePenTo(point.x + 8, frame.top + + fontInfo.ascent + (frame.Height() + - ceilf(fontInfo.ascent + fontInfo.descent)) / 2.0f); onto->DrawString(fTitle); onto->SetHighColor(highColor);