ProcessController: fix display of CPU bars for systems having 3 cores

Generalize the drawing of separator lines for every number of cores
requesting them.

Fix the layout for 3 cores systems.

Should fix #8763.
This commit is contained in:
Philippe Saint-Pierre
2012-07-23 10:16:37 -04:00
parent 516cac7817
commit b6a70ecba9
@@ -124,7 +124,7 @@ layoutT layout[] = {
{ 1, 1, 1 }, { 1, 1, 1 },
{ 5, 1, 5 }, // 1 { 5, 1, 5 }, // 1
{ 3, 1, 4 }, // 2 { 3, 1, 4 }, // 2
{ 1, 1, 1 }, { 2, 1, 3 },
{ 2, 0, 3 }, // 4 { 2, 0, 3 }, // 4
{ 1, 1, 1 }, { 1, 1, 1 },
{ 1, 1, 1 }, { 1, 1, 1 },
@@ -549,9 +549,10 @@ ProcessController::DoDraw(bool force)
if (force) { if (force) {
SetHighColor(frame_color); SetHighColor(frame_color);
StrokeRect(BRect(left - 1, top - 1, right, bottom + 1)); StrokeRect(BRect(left - 1, top - 1, right, bottom + 1));
if (gCPUcount == 2) { if (gCPUcount > 1 && layout[gCPUcount].cpu_inter == 1) {
StrokeLine(BPoint(left + barWidth, top), BPoint(left + barWidth, for (int x = 1; x < gCPUcount; x++)
bottom)); StrokeLine(BPoint(left + x * barWidth + x - 1, top),
BPoint(left + x * barWidth + x - 1, bottom));
} }
} }
float leftMem = bounds.Width() - layout[gCPUcount].mem_width; float leftMem = bounds.Width() - layout[gCPUcount].mem_width;