From 1a47b15dfa2c90d0311077f96f3b458376c282c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 16 Mar 2015 23:32:20 +0000 Subject: [PATCH] Network: interface list item now used BControlLook spacing. * Instead of hard-coded values. --- src/preferences/network/InterfaceListItem.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/preferences/network/InterfaceListItem.cpp b/src/preferences/network/InterfaceListItem.cpp index 502fb30d6f..adb06cd817 100644 --- a/src/preferences/network/InterfaceListItem.cpp +++ b/src/preferences/network/InterfaceListItem.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -71,9 +72,11 @@ InterfaceListItem::DrawItem(BView* owner, BRect bounds, bool complete) const char* stateText = _StateText(); // Set the initial bounds of item contents - BPoint iconPoint = bounds.LeftTop() + BPoint(4, 2); + BPoint iconPoint = bounds.LeftTop() + + BPoint(be_control_look->DefaultLabelSpacing(), 2); BPoint statePoint = bounds.RightTop() + BPoint(0, fFirstLineOffset) - - BPoint(be_plain_font->StringWidth(stateText) + 4.0f, 0); + - BPoint(be_plain_font->StringWidth(stateText) + + be_control_look->DefaultLabelSpacing(), 0); BPoint namePoint = bounds.LeftTop() + BPoint(ICON_SIZE + 12, fFirstLineOffset); @@ -134,7 +137,8 @@ InterfaceListItem::Update(BView* owner, const BFont* font) _UpdateState(); - SetWidth(fIcon->Bounds().Width() + 44 + SetWidth(fIcon->Bounds().Width() + 36 + + be_control_look->DefaultLabelSpacing() + be_bold_font->StringWidth(fDeviceName.String()) + owner->StringWidth(_StateText())); SetHeight(std::max(2 * lineHeight + 4, fIcon->Bounds().Height() + 4));