Subtract the dragger size more consequently from the legend frame, fixing the
ugly big color indicators. BTW, I noticed that the ActivityView is not really using layout management at all. But with the incomplete archiving features, this probably wouldn't work too well anyway. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35850 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -545,6 +545,7 @@ ActivityView::LegendLayoutItem::BaseAlignment()
|
|||||||
|
|
||||||
const rgb_color kWhite = (rgb_color){255, 255, 255, 255};
|
const rgb_color kWhite = (rgb_color){255, 255, 255, 255};
|
||||||
const rgb_color kBlack = (rgb_color){0, 0, 0, 255};
|
const rgb_color kBlack = (rgb_color){0, 0, 0, 255};
|
||||||
|
const float kDraggerSize = 7;
|
||||||
|
|
||||||
|
|
||||||
ActivityView::ActivityView(BRect frame, const char* name,
|
ActivityView::ActivityView(BRect frame, const char* name,
|
||||||
@@ -556,8 +557,8 @@ ActivityView::ActivityView(BRect frame, const char* name,
|
|||||||
_Init(settings);
|
_Init(settings);
|
||||||
|
|
||||||
BRect rect(Bounds());
|
BRect rect(Bounds());
|
||||||
rect.top = rect.bottom - 7;
|
rect.top = rect.bottom - kDraggerSize;
|
||||||
rect.left = rect.right - 7;
|
rect.left = rect.right - kDraggerSize;
|
||||||
BDragger* dragger = new BDragger(rect, this,
|
BDragger* dragger = new BDragger(rect, this,
|
||||||
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
AddChild(dragger);
|
AddChild(dragger);
|
||||||
@@ -578,8 +579,8 @@ ActivityView::ActivityView(const char* name, const BMessage* settings)
|
|||||||
_Init(settings);
|
_Init(settings);
|
||||||
|
|
||||||
BRect rect(Bounds());
|
BRect rect(Bounds());
|
||||||
rect.top = rect.bottom - 7;
|
rect.top = rect.bottom - kDraggerSize;
|
||||||
rect.left = rect.right - 7;
|
rect.left = rect.right - kDraggerSize;
|
||||||
BDragger* dragger = new BDragger(rect, this,
|
BDragger* dragger = new BDragger(rect, this,
|
||||||
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
AddChild(dragger);
|
AddChild(dragger);
|
||||||
@@ -1239,11 +1240,8 @@ ActivityView::_LegendHeight() const
|
|||||||
int32 boldMargin = Parent()
|
int32 boldMargin = Parent()
|
||||||
&& (Parent()->Flags() & B_DRAW_ON_CHILDREN) != 0 ? 2 : 0;
|
&& (Parent()->Flags() & B_DRAW_ON_CHILDREN) != 0 ? 2 : 0;
|
||||||
|
|
||||||
int32 draggerMargin = (fSources.CountItems() % 2) != 0 ? 0 : 7;
|
|
||||||
|
|
||||||
return rows * (4 + ceilf(fontHeight.ascent)
|
return rows * (4 + ceilf(fontHeight.ascent)
|
||||||
+ ceilf(fontHeight.descent) + ceilf(fontHeight.leading)) + boldMargin
|
+ ceilf(fontHeight.descent) + ceilf(fontHeight.leading)) + boldMargin;
|
||||||
+ draggerMargin;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1259,6 +1257,7 @@ ActivityView::_LegendFrame() const
|
|||||||
height = _LegendHeight();
|
height = _LegendHeight();
|
||||||
|
|
||||||
BRect frame = Bounds();
|
BRect frame = Bounds();
|
||||||
|
frame.bottom -= kDraggerSize;
|
||||||
frame.top = frame.bottom - height;
|
frame.top = frame.bottom - height;
|
||||||
|
|
||||||
return frame;
|
return frame;
|
||||||
@@ -1488,8 +1487,11 @@ ActivityView::Draw(BRect updateRect)
|
|||||||
// draw legend
|
// draw legend
|
||||||
BRect legendFrame = _LegendFrame();
|
BRect legendFrame = _LegendFrame();
|
||||||
SetLowColor(fLegendBackgroundColor);
|
SetLowColor(fLegendBackgroundColor);
|
||||||
if (drawBackground)
|
if (drawBackground) {
|
||||||
FillRect(legendFrame, B_SOLID_LOW);
|
BRect backgroundFrame(legendFrame);
|
||||||
|
backgroundFrame.bottom += kDraggerSize;
|
||||||
|
FillRect(backgroundFrame, B_SOLID_LOW);
|
||||||
|
}
|
||||||
|
|
||||||
BAutolock _(fSourcesLock);
|
BAutolock _(fSourcesLock);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user