ProcessController: Fixed bars so they are aligned in center and scale

with the selected fonts

Change-Id: I016c600d62ea28d4197f94f29ec0c372b5a87169
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1848
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Mikael Konradsson
2019-09-14 17:31:11 +00:00
committed by waddlesplash
parent d46af3075e
commit 9b695ae61d
6 changed files with 35 additions and 38 deletions
@@ -73,8 +73,8 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
rgb_color highColor = menu->HighColor(); rgb_color highColor = menu->HighColor();
// draw the bar itself // draw the bar itself
BRect cadre (frame.right - kMargin - kBarWidth, frame.top + 5, BRect cadre (frame.right - kMargin - kBarWidth, frame.top + kBarPadding,
frame.right - kMargin, frame.top + 13); frame.right - kMargin, frame.bottom - kBarPadding);
if (fLastSum < 0) if (fLastSum < 0)
force = true; force = true;
@@ -104,7 +104,6 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
menu->SetHighColor(gKernelColorSelected); menu->SetHighColor(gKernelColorSelected);
else else
menu->SetHighColor(gKernelColor); menu->SetHighColor(gKernelColor);
// menu->SetHighColor(gKernelColor);
menu->FillRect (r); menu->FillRect (r);
} }
r.left = grenze1; r.left = grenze1;
@@ -120,7 +119,6 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
menu->SetHighColor(tint_color (kLavender, B_HIGHLIGHT_BACKGROUND_TINT)); menu->SetHighColor(tint_color (kLavender, B_HIGHLIGHT_BACKGROUND_TINT));
else else
menu->SetHighColor(kLavender); menu->SetHighColor(kLavender);
// menu->SetHighColor(gUserColor);
menu->FillRect (r); menu->FillRect (r);
} }
r.left = grenze2; r.left = grenze2;
@@ -118,8 +118,8 @@ MemoryBarMenuItem::DrawBar(bool force)
// draw the bar itself // draw the bar itself
BRect rect(frame.right - kMargin - kBarWidth, frame.top + 5, BRect rect(frame.right - kMargin - kBarWidth, frame.top + kBarPadding,
frame.right - kMargin, frame.top + 13); frame.right - kMargin, frame.bottom - kBarPadding);
if (fWriteMemory < 0) if (fWriteMemory < 0)
return; return;
@@ -54,8 +54,8 @@ NoiseBarMenuItem::DrawBar(bool force)
rgb_color highColor = menu->HighColor(); rgb_color highColor = menu->HighColor();
frame.right -= 24; frame.right -= 24;
frame.left = frame.right - kBarWidth; frame.left = frame.right - kBarWidth;
frame.top += 5; frame.top += kBarPadding;
frame.bottom = frame.top + 8; frame.bottom -= kBarPadding;
if (fBusyWaiting < 0) if (fBusyWaiting < 0)
return; return;
@@ -92,5 +92,6 @@ extern bool gInDeskbar;
#define kBarWidth 100 #define kBarWidth 100
#define kMargin 12 #define kMargin 12
#define kBarPadding 7
#endif // _PCVIEW_H_ #endif // _PCVIEW_H_
@@ -126,8 +126,8 @@ TeamBarMenuItem::DrawBar(bool force)
rgb_color highColor = menu->HighColor(); rgb_color highColor = menu->HighColor();
frame.right -= 24; frame.right -= 24;
frame.left = frame.right-kBarWidth; frame.left = frame.right-kBarWidth;
frame.top += 5; frame.top += kBarPadding;
frame.bottom = frame.top+8; frame.bottom -= kBarPadding;
if (fKernel < 0) if (fKernel < 0)
return; return;
@@ -59,8 +59,8 @@ ThreadBarMenuItem::DrawBar(bool force)
rgb_color highColor = menu->HighColor(); rgb_color highColor = menu->HighColor();
frame.right -= 24; frame.right -= 24;
frame.left = frame.right - kBarWidth; frame.left = frame.right - kBarWidth;
frame.top += 3; frame.top += kBarPadding;
frame.bottom = frame.top + 8; frame.bottom -= kBarPadding;
if (fKernel < 0) if (fKernel < 0)
return; return;
@@ -138,8 +138,6 @@ void
ThreadBarMenuItem::GetContentSize(float* width, float* height) ThreadBarMenuItem::GetContentSize(float* width, float* height)
{ {
BMenuItem::GetContentSize(width, height); BMenuItem::GetContentSize(width, height);
// if (*height < 16)
// *height = 16;
*width += 10 + kBarWidth; *width += 10 + kBarWidth;
} }