From 20a11271d02f6e1dc373e48f62ee699d44984c35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 17 Oct 2009 17:01:22 +0000 Subject: [PATCH] * Added a (to be virtual) DefaultItemSpacing() method to control look. This is what you should use in for example BGroupLayout as spacing/inset. * Changed the label spacing to be dependent on the font size, too (and enlarged it a bit as well). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33621 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/ControlLook.h | 4 ++++ src/kits/interface/ControlLook.cpp | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/headers/os/interface/ControlLook.h b/headers/os/interface/ControlLook.h index 63b5f1673d..4aa5e7eccc 100644 --- a/headers/os/interface/ControlLook.h +++ b/headers/os/interface/ControlLook.h @@ -72,6 +72,10 @@ public: virtual BAlignment DefaultLabelAlignment() const; virtual float DefaultLabelSpacing() const; + + /* TODO: virtual*/ + float DefaultItemSpacing() const; + uint32 Flags(BControl* control) const; virtual void DrawButtonFrame(BView* view, BRect& rect, diff --git a/src/kits/interface/ControlLook.cpp b/src/kits/interface/ControlLook.cpp index 984502eff5..72e15a175b 100644 --- a/src/kits/interface/ControlLook.cpp +++ b/src/kits/interface/ControlLook.cpp @@ -39,7 +39,14 @@ BControlLook::DefaultLabelAlignment() const float BControlLook::DefaultLabelSpacing() const { - return 4.0;//ceilf(be_plain_font->Size() / 4.0); + return ceilf(be_plain_font->Size() / 2.0); +} + + +float +BControlLook::DefaultItemSpacing() const +{ + return ceilf(be_plain_font->Size() * 0.85); }