[haiku-commits] Re: r41185 - haiku/trunk/src/apps/screenshot

  • From: Stephan Aßmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 06 Apr 2011 21:11:26 +0200

Hi Humdinger,

Am 06.04.2011 18:27, schrieb Humdinger:
Axel Dörfler, Tue, 05 Apr 2011 21:23:56 +0200:
Instead of using fixed spacings, you should always make it depend on
the font size. The best way to do this is to utilize BControlLook::
DefaultItemSpacing(), and in this case maybe rather BControlLook::
DefaultLabelSpacing().

Right. Like this?:

        const float kSpacing = be_control_look->DefaultItemSpacing();
        const float kLabelSpacing = be_control_look->DefaultLabelSpacing();
        
        BGridLayout* gridLayout = BGridLayoutBuilder(0.0, kSpacing / 2)
                .Add(fDelayControl->CreateLabelLayoutItem(), 0, 0)
                .Add(fDelayControl->CreateTextViewLayoutItem(), 1, 0)
                .Add(BSpaceLayoutItem::CreateHorizontalStrut(kLabelSpacing), 2,
0)

Looks fine, yes.

Best regards,
-Stephan

Other related posts: