Use be_control_look != NULL everywhere in the Interface Kit.

Should not be a functional change. It is not in the Haiku Coding Guidelines but
I feel like 'if (object != NULL)' is generally preferred to 'if (object)', plus
in this case of be_control_look that is the more common style.
This commit is contained in:
Ryan Leavengood
2012-08-05 18:07:23 -04:00
parent 7483c98dec
commit 57c5b09e1a
7 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -407,7 +407,7 @@ _BMCMenuBar_::_Init(bool setMaxContentWidth)
bottom--; bottom--;
#endif #endif
if (be_control_look) if (be_control_look != NULL)
left = right = be_control_look->DefaultLabelSpacing(); left = right = be_control_look->DefaultLabelSpacing();
SetItemMargins(left, top, right + fShowPopUpMarker ? 10 : 0, bottom); SetItemMargins(left, top, right + fShowPopUpMarker ? 10 : 0, bottom);
+1 -1
View File
@@ -96,7 +96,7 @@ BCheckBox::Archive(BMessage *archive, bool deep) const
void void
BCheckBox::Draw(BRect updateRect) BCheckBox::Draw(BRect updateRect)
{ {
if (be_control_look) { if (be_control_look != NULL) {
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
uint32 flags = be_control_look->Flags(this); uint32 flags = be_control_look->Flags(this);
+1 -1
View File
@@ -89,7 +89,7 @@ BRadioButton::Draw(BRect updateRect)
font_height fontHeight; font_height fontHeight;
GetFontHeight(&fontHeight); GetFontHeight(&fontHeight);
if (be_control_look) { if (be_control_look != NULL) {
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
uint32 flags = be_control_look->Flags(this); uint32 flags = be_control_look->Flags(this);
+1 -1
View File
@@ -1081,7 +1081,7 @@ BScrollBar::Draw(BRect updateRect)
} }
// fill the clickable surface of the thumb // fill the clickable surface of the thumb
if (be_control_look) { if (be_control_look != NULL) {
be_control_look->DrawButtonBackground(this, rect, updateRect, be_control_look->DrawButtonBackground(this, rect, updateRect,
normal, 0, BControlLook::B_ALL_BORDERS, fOrientation); normal, 0, BControlLook::B_ALL_BORDERS, fOrientation);
} else { } else {
+1 -1
View File
@@ -1000,7 +1000,7 @@ BSlider::DrawHashMarks()
BRect frame = HashMarksFrame(); BRect frame = HashMarksFrame();
BView* view = OffscreenView(); BView* view = OffscreenView();
if (be_control_look) { if (be_control_look != NULL) {
rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR);
uint32 flags = be_control_look->Flags(this); uint32 flags = be_control_look->Flags(this);
be_control_look->DrawSliderHashMarks(view, frame, frame, base, be_control_look->DrawSliderHashMarks(view, frame, frame, base,
+1 -1
View File
@@ -574,7 +574,7 @@ BStatusBar::SetTo(float value, const char* text, const char* trailingText)
} }
// TODO: Ask the BControlLook in the first place about dirty rect. // TODO: Ask the BControlLook in the first place about dirty rect.
if (be_control_look) if (be_control_look != NULL)
update.InsetBy(-1, -1); update.InsetBy(-1, -1);
Invalidate(update); Invalidate(update);
+1 -1
View File
@@ -174,7 +174,7 @@ _BTextInput_::AlignTextRect()
float vInset = max_c(1, floorf((textRect.Height() - LineHeight(0)) / 2.0)); float vInset = max_c(1, floorf((textRect.Height() - LineHeight(0)) / 2.0));
float hInset = 2; float hInset = 2;
if (be_control_look) if (be_control_look != NULL)
hInset = be_control_look->DefaultLabelSpacing(); hInset = be_control_look->DefaultLabelSpacing();
textRect.InsetBy(hInset, vInset); textRect.InsetBy(hInset, vInset);