BMenu: made left side padding font size relative.

* Also changed BMenuItem to make better use of that size.
This commit is contained in:
Axel Dörfler 2015-09-09 20:44:39 +02:00
parent d8b517b50f
commit ac9ec47d27
2 changed files with 6 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2013 Haiku, Inc. All rights reserved. * Copyright 2001-2015 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license. * Distributed under the terms of the MIT license.
* *
* Authors: * Authors:
@ -216,7 +216,7 @@ BMenu::BMenu(const char* name, menu_layout layout)
: :
BView(BRect(0, 0, 0, 0), name, 0, B_WILL_DRAW), BView(BRect(0, 0, 0, 0), name, 0, B_WILL_DRAW),
fChosenItem(NULL), fChosenItem(NULL),
fPad(14.0f, 2.0f, 20.0f, 0.0f), fPad(std::max(14.0f, be_plain_font->Size() + 2.0f), 2.0f, 20.0f, 0.0f),
fSelected(NULL), fSelected(NULL),
fCachedMenuWindow(NULL), fCachedMenuWindow(NULL),
fSuper(NULL), fSuper(NULL),

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2001-2013 Haiku, Inc. All rights reserved. * Copyright 2001-2015 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Authors: * Authors:
@ -683,8 +683,9 @@ BMenuItem::_DrawMarkSymbol()
BRect r(fBounds); BRect r(fBounds);
float leftMargin; float leftMargin;
MenuPrivate(fSuper).GetItemMargins(&leftMargin, NULL, NULL, NULL); MenuPrivate(fSuper).GetItemMargins(&leftMargin, NULL, NULL, NULL);
r.right = r.left + leftMargin - 3; float gap = leftMargin / 4;
r.left += 1; r.right = r.left + leftMargin - gap;
r.left += gap / 3;
BPoint center(floorf((r.left + r.right) / 2.0), BPoint center(floorf((r.left + r.right) / 2.0),
floorf((r.top + r.bottom) / 2.0)); floorf((r.top + r.bottom) / 2.0));