Skip to content

Commit

Permalink
Update StringItem use be_control_look->DefaultLabelSpacing()
Browse files Browse the repository at this point in the history
Also update the Update() method to take into account the added
spacing.

Thanks Axel and Stippi.
  • Loading branch information
jscipione committed Nov 24, 2012
1 parent 7018b3c commit 63881c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/kits/interface/StringItem.cpp
Expand Up @@ -14,6 +14,7 @@
#include <stdlib.h>
#include <string.h>

#include <ControlLook.h>
#include <Message.h>
#include <View.h>

Expand Down Expand Up @@ -85,7 +86,8 @@ BStringItem::DrawItem(BView *owner, BRect frame, bool complete)
owner->FillRect(frame);
}

owner->MovePenTo(frame.left + 4, frame.top + fBaselineOffset);
owner->MovePenTo(frame.left + be_control_look->DefaultLabelSpacing(),
frame.top + fBaselineOffset);

if (!IsEnabled()) {
rgb_color textColor = ui_color(B_LIST_ITEM_TEXT_COLOR);
Expand Down Expand Up @@ -128,8 +130,10 @@ BStringItem::Text() const
void
BStringItem::Update(BView *owner, const BFont *font)
{
if (fText)
SetWidth(font->StringWidth(fText));
if (fText) {
SetWidth(font->StringWidth(fText)
+ be_control_look->DefaultLabelSpacing());
}

font_height fheight;
font->GetHeight(&fheight);
Expand Down

0 comments on commit 63881c3

Please sign in to comment.