diff options
author | louis <louis.braun@gmx.de> | 2013-02-26 18:36:51 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-02-26 18:36:51 +0100 |
commit | d099b5d5f922e6773ad5c5165e951fc280c5c5c1 (patch) | |
tree | 4078905ca9b7761f29b6140a0465d9c76cb8a5d9 /menuitem.c | |
parent | 6b4c35ae9aac8b9081a5d9f8e28fe4f4ce7458e3 (diff) | |
download | skin-nopacity-d099b5d5f922e6773ad5c5165e951fc280c5c5c1.tar.gz skin-nopacity-d099b5d5f922e6773ad5c5165e951fc280c5c5c1.tar.bz2 |
Usage of menu icons in main and setup menu configurable
Diffstat (limited to 'menuitem.c')
-rw-r--r-- | menuitem.c | 22 |
1 files changed, 14 insertions, 8 deletions
@@ -212,8 +212,12 @@ cString cNopacityMainMenuItem::GetIconName() { } void cNopacityMainMenuItem::CreatePixmapTextScroller(int totalWidth) { - int pixmapLeft = left + config.iconHeight + 10; - int pixmapWidth = width - config.iconHeight - 10; + int pixmapLeft = left + 10; + if (config.useMenuIcons) + pixmapLeft += config.iconHeight; + int pixmapWidth = width - 10; + if (config.useMenuIcons) + pixmapWidth -= config.iconHeight; int drawPortWidth = totalWidth + 10; pixmapTextScroller = osd->CreatePixmap(4, cRect(pixmapLeft, top + index * (height + left), pixmapWidth, height), cRect(0, 0, drawPortWidth, height)); pixmapTextScroller->Fill(clrTransparent); @@ -300,13 +304,15 @@ void cNopacityMainMenuItem::Render() { if (config.roundedCorners) DrawRoundedCorners(Theme.Color(clrMenuBorder)); if (selectable) { - cString cIcon = GetIconName(); - if (!drawn) { - cImageLoader imgLoader; - if (imgLoader.LoadIcon(*cIcon, config.iconHeight)) { - pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + if (config.useMenuIcons) { + cString cIcon = GetIconName(); + if (!drawn) { + cImageLoader imgLoader; + if (imgLoader.LoadIcon(*cIcon, config.iconHeight)) { + pixmapIcon->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + } + drawn = true; } - drawn = true; } SetTextShort(); if (current && scrollable && !Running() && config.menuScrollSpeed) { |