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();
// draw the bar itself
BRect cadre (frame.right - kMargin - kBarWidth, frame.top + 5,
frame.right - kMargin, frame.top + 13);
BRect cadre (frame.right - kMargin - kBarWidth, frame.top + kBarPadding,
frame.right - kMargin, frame.bottom - kBarPadding);
if (fLastSum < 0)
force = true;
@@ -104,7 +104,6 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
menu->SetHighColor(gKernelColorSelected);
else
menu->SetHighColor(gKernelColor);
// menu->SetHighColor(gKernelColor);
menu->FillRect (r);
}
r.left = grenze1;
@@ -120,7 +119,6 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
menu->SetHighColor(tint_color (kLavender, B_HIGHLIGHT_BACKGROUND_TINT));
else
menu->SetHighColor(kLavender);
// menu->SetHighColor(gUserColor);
menu->FillRect (r);
}
r.left = grenze2;
@@ -118,8 +118,8 @@ MemoryBarMenuItem::DrawBar(bool force)
// draw the bar itself
BRect rect(frame.right - kMargin - kBarWidth, frame.top + 5,
frame.right - kMargin, frame.top + 13);
BRect rect(frame.right - kMargin - kBarWidth, frame.top + kBarPadding,
frame.right - kMargin, frame.bottom - kBarPadding);
if (fWriteMemory < 0)
return;
+14 -14
View File
@@ -1,20 +1,20 @@
/*
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
Copyright (C) 2004 beunited.org
Copyright (C) 2004 beunited.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -54,8 +54,8 @@ NoiseBarMenuItem::DrawBar(bool force)
rgb_color highColor = menu->HighColor();
frame.right -= 24;
frame.left = frame.right - kBarWidth;
frame.top += 5;
frame.bottom = frame.top + 8;
frame.top += kBarPadding;
frame.bottom -= kBarPadding;
if (fBusyWaiting < 0)
return;
@@ -92,5 +92,6 @@ extern bool gInDeskbar;
#define kBarWidth 100
#define kMargin 12
#define kBarPadding 7
#endif // _PCVIEW_H_
@@ -126,8 +126,8 @@ TeamBarMenuItem::DrawBar(bool force)
rgb_color highColor = menu->HighColor();
frame.right -= 24;
frame.left = frame.right-kBarWidth;
frame.top += 5;
frame.bottom = frame.top+8;
frame.top += kBarPadding;
frame.bottom -= kBarPadding;
if (fKernel < 0)
return;
@@ -1,20 +1,20 @@
/*
ProcessController © 2000, Georges-Edouard Berenger, All Rights Reserved.
Copyright (C) 2004 beunited.org
Copyright (C) 2004 beunited.org
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ThreadBarMenuItem.h"
@@ -59,8 +59,8 @@ ThreadBarMenuItem::DrawBar(bool force)
rgb_color highColor = menu->HighColor();
frame.right -= 24;
frame.left = frame.right - kBarWidth;
frame.top += 3;
frame.bottom = frame.top + 8;
frame.top += kBarPadding;
frame.bottom -= kBarPadding;
if (fKernel < 0)
return;
@@ -138,8 +138,6 @@ void
ThreadBarMenuItem::GetContentSize(float* width, float* height)
{
BMenuItem::GetContentSize(width, height);
// if (*height < 16)
// *height = 16;
*width += 10 + kBarWidth;
}