2 * Copyright 2012-2017 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
7 #include <ControlLook.h>
13 BControlLook::BControlLook()
20 BControlLook::~BControlLook()
26 BControlLook::ComposeSpacing(float spacing
)
28 switch ((int)spacing
) {
29 case B_USE_DEFAULT_SPACING
:
30 case B_USE_ITEM_SPACING
:
31 return be_control_look
->DefaultItemSpacing();
32 case B_USE_HALF_ITEM_SPACING
:
33 return ceilf(be_control_look
->DefaultItemSpacing() * 0.5f
);
34 case B_USE_WINDOW_SPACING
:
35 return be_control_look
->DefaultItemSpacing();
36 case B_USE_SMALL_SPACING
:
37 return ceilf(be_control_look
->DefaultItemSpacing() * 0.7f
);
38 case B_USE_BIG_SPACING
:
39 return ceilf(be_control_look
->DefaultItemSpacing() * 1.3f
);
47 BControlLook::DrawLabel(BView
* view
, const char* label
, const BBitmap
* icon
,
48 BRect rect
, const BRect
& updateRect
, const rgb_color
& base
, uint32 flags
,
49 const rgb_color
* textColor
)
51 DrawLabel(view
, label
, icon
, rect
, updateRect
, base
, flags
,
52 DefaultLabelAlignment(), textColor
);
57 BControlLook::GetInsets(frame_type frameType
, background_type backgroundType
,
58 uint32 flags
, float& _left
, float& _top
, float& _right
, float& _bottom
)
60 GetFrameInsets(frameType
, flags
, _left
, _top
, _right
, _bottom
);
62 float left
, top
, right
, bottom
;
63 GetBackgroundInsets(backgroundType
, flags
, left
, top
, right
, bottom
);
73 BControlLook::SetBackgroundInfo(const BMessage
& backgroundInfo
)
75 fBackgroundInfo
= backgroundInfo
;
76 fCachedWorkspace
= -1;
80 // NOTE: May come from a add-on in the future. Initialized in
82 BControlLook
* be_control_look
= NULL
;
85 } // namespace BPrivate