ProcessController: fix bars height computation

The previous code used a fixed margin, which would lead to too small
bars with small font sizes (the bar content would not even be visible).

Instead, use the font height as the base for the bar height, which
allows us to use the same code everywhere, no matter the menu item
height (which can vary depending on if there is an icon, etc)

Fixes #15391.
This commit is contained in:
Adrien Destugues
2019-11-24 13:11:36 +01:00
parent 5de2f989bc
commit 32bc3e2c0f
8 changed files with 47 additions and 20 deletions
@@ -116,10 +116,11 @@ MemoryBarMenuItem::DrawBar(bool force)
BMenu* menu = Menu();
rgb_color highColor = menu->HighColor();
// draw the bar itself
BFont font;
menu->GetFont(&font);
BRect rect = bar_rect(frame, &font);
BRect rect(frame.right - kMargin - kBarWidth, frame.top + kBarPadding,
frame.right - kMargin, frame.bottom - kBarPadding);
// draw the bar itself
if (fWriteMemory < 0)
return;