GRAPHICS: MACGUI: Adding style to menu items

This commit is contained in:
Eugene Sandulenko 2020-02-07 19:07:54 +01:00
parent e4d17f881c
commit 9b3ca6498e
2 changed files with 7 additions and 4 deletions

View File

@ -565,8 +565,8 @@ void MacMenu::createSubMenuFromString(int id, const char *str, int commandId) {
}
}
const Font *MacMenu::getMenuFont() {
return _wm->_fontMan->getFont(Graphics::MacFont(kMacFontChicago, 12));
const Font *MacMenu::getMenuFont(int slant) {
return _wm->_fontMan->getFont(Graphics::MacFont(kMacFontChicago, 12, slant));
}
const Common::String MacMenu::getAcceleratorString(MacMenuItem *item, const char *prefix) {
@ -802,7 +802,9 @@ bool MacMenu::draw(ManagedSurface *g, bool forceRedraw) {
_font->drawString(&_screen, it->unicodeText, x, y, it->bbox.width(), color);
underlineAccelerator(&_screen, _font, it->unicodeText, x, y, it->shortcutPos, color);
} else {
_font->drawString(&_screen, it->text, x, y, it->bbox.width(), color);
const Font *font = getMenuFont(it->style);
font->drawString(&_screen, it->text, x, y, it->bbox.width(), color);
}
}

View File

@ -24,6 +24,7 @@
#define GRAPHICS_MACGUI_MACMENU_H
#include "common/str-array.h"
#include "graphics/macgui/macfontmanager.h"
namespace Common {
class U32String;
@ -93,7 +94,7 @@ private:
private:
bool checkCallback(bool unicode = false);
const Font *getMenuFont();
const Font *getMenuFont(int slant = kMacFontRegular);
const Common::String getAcceleratorString(MacMenuItem *item, const char *prefix);
void processTabs();
void processSubmenuTabs(MacMenuSubMenu *submenu);