BMenu: made left side padding font size relative.
* Also changed BMenuItem to make better use of that size.
This commit is contained in:
parent
d8b517b50f
commit
ac9ec47d27
@ -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.
|
||||
*
|
||||
* Authors:
|
||||
@ -216,7 +216,7 @@ BMenu::BMenu(const char* name, menu_layout layout)
|
||||
:
|
||||
BView(BRect(0, 0, 0, 0), name, 0, B_WILL_DRAW),
|
||||
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),
|
||||
fCachedMenuWindow(NULL),
|
||||
fSuper(NULL),
|
||||
|
@ -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.
|
||||
*
|
||||
* Authors:
|
||||
@ -683,8 +683,9 @@ BMenuItem::_DrawMarkSymbol()
|
||||
BRect r(fBounds);
|
||||
float leftMargin;
|
||||
MenuPrivate(fSuper).GetItemMargins(&leftMargin, NULL, NULL, NULL);
|
||||
r.right = r.left + leftMargin - 3;
|
||||
r.left += 1;
|
||||
float gap = leftMargin / 4;
|
||||
r.right = r.left + leftMargin - gap;
|
||||
r.left += gap / 3;
|
||||
|
||||
BPoint center(floorf((r.left + r.right) / 2.0),
|
||||
floorf((r.top + r.bottom) / 2.0));
|
||||
|
Loading…
x
Reference in New Issue
Block a user