Tracker: Style fixes

More style fixes
This commit is contained in:
John Scipione 2016-09-01 17:28:51 -07:00
parent bb5847906b
commit ee20ff95a4
5 changed files with 13 additions and 10 deletions

View File

@ -419,7 +419,7 @@ DraggableContainerIcon::MouseMoved(BPoint where, uint32, const BMessage*)
if (button) if (button)
message.AddInt32("buttons", (int32)button); message.AddInt32("buttons", (int32)button);
if (button & B_PRIMARY_MOUSE_BUTTON) { if ((button & B_PRIMARY_MOUSE_BUTTON) != 0) {
// add an action specifier to the message, so that it is not copied // add an action specifier to the message, so that it is not copied
message.AddInt32("be:actions", (modifiers() & B_OPTION_KEY) != 0 message.AddInt32("be:actions", (modifiers() & B_OPTION_KEY) != 0
? B_COPY_TARGET : B_MOVE_TARGET); ? B_COPY_TARGET : B_MOVE_TARGET);

View File

@ -523,7 +523,7 @@ bool
BPose::PointInPose(BPoint loc, const BPoseView* poseView, BPoint where, BPose::PointInPose(BPoint loc, const BPoseView* poseView, BPoint where,
BTextWidget** hitWidget) const BTextWidget** hitWidget) const
{ {
if (hitWidget) if (hitWidget != NULL)
*hitWidget = NULL; *hitWidget = NULL;
// check intersection with icon // check intersection with icon
@ -962,7 +962,7 @@ BPose::CalcRect(const BPoseView* poseView) const
rect.right = rect.left + poseView->IconSizeInt(); rect.right = rect.left + poseView->IconSizeInt();
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash()); BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
if (widget) { if (widget != NULL) {
float textWidth = ceilf(widget->TextWidth(poseView) + 1); float textWidth = ceilf(widget->TextWidth(poseView) + 1);
if (textWidth > poseView->IconSizeInt()) { if (textWidth > poseView->IconSizeInt()) {
rect.left += (poseView->IconSizeInt() - textWidth) / 2; rect.left += (poseView->IconSizeInt() - textWidth) / 2;
@ -979,7 +979,7 @@ BPose::CalcRect(const BPoseView* poseView) const
rect.right = rect.left + B_MINI_ICON + kMiniIconSeparator; rect.right = rect.left + B_MINI_ICON + kMiniIconSeparator;
rect.bottom = rect.top + poseView->IconPoseHeight(); rect.bottom = rect.top + poseView->IconPoseHeight();
BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash()); BTextWidget* widget = WidgetFor(poseView->FirstColumn()->AttrHash());
if (widget) if (widget != NULL)
rect.right += ceil(widget->TextWidth(poseView) + 1); rect.right += ceil(widget->TextWidth(poseView) + 1);
} }

View File

@ -8129,7 +8129,7 @@ BPoseView::FindPose(BPoint point, int32* poseIndex) const
{ {
if (ViewMode() == kListMode) { if (ViewMode() == kListMode) {
int32 index = (int32)(point.y / fListElemHeight); int32 index = (int32)(point.y / fListElemHeight);
if (poseIndex) if (poseIndex != NULL)
*poseIndex = index; *poseIndex = index;
BPoint loc(0, index * fListElemHeight); BPoint loc(0, index * fListElemHeight);
@ -9488,11 +9488,13 @@ BPoseView::ColumnFor(uint32 attr) const
} }
bool // returns true if actually resized bool
BPoseView::ResizeColumnToWidest(BColumn* column) BPoseView::ResizeColumnToWidest(BColumn* column)
{ {
ASSERT(ViewMode() == kListMode); ASSERT(ViewMode() == kListMode);
// returns true if actually resized
float maxWidth = kMinColumnWidth; float maxWidth = kMinColumnWidth;
PoseList* poseList = CurrentPoseList(); PoseList* poseList = CurrentPoseList();

View File

@ -33,6 +33,8 @@ All rights reserved.
*/ */
#include "TextWidget.h"
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
@ -51,7 +53,6 @@ All rights reserved.
#include "Commands.h" #include "Commands.h"
#include "FSUtils.h" #include "FSUtils.h"
#include "PoseView.h" #include "PoseView.h"
#include "TextWidget.h"
#include "Utilities.h" #include "Utilities.h"

View File

@ -460,8 +460,8 @@ BViewState::_Init()
{ {
fViewMode = kListMode; fViewMode = kListMode;
fLastIconMode = 0; fLastIconMode = 0;
fIconSize = 32; fIconSize = B_LARGE_ICON;
fLastIconSize = 32; fLastIconSize = B_LARGE_ICON;
fListOrigin.Set(0, 0); fListOrigin.Set(0, 0);
fIconOrigin.Set(0, 0); fIconOrigin.Set(0, 0);
fPrimarySortAttr = AttrHashString(kAttrStatName, B_STRING_TYPE); fPrimarySortAttr = AttrHashString(kAttrStatName, B_STRING_TYPE);