diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | displaymenu.c | 2 | ||||
-rw-r--r-- | displaymenuview.c | 2 | ||||
-rw-r--r-- | menuitem.c | 4 |
4 files changed, 6 insertions, 3 deletions
@@ -188,3 +188,4 @@ Version 0.1.1 - changed stereo and ac3 icons in tracks display - Added RSS Feed support - Fixed crash on initial startup with xine plugin as output device +- Fixed crash / hang if menu is opened with small screen size diff --git a/displaymenu.c b/displaymenu.c index b059707..cc3a901 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -9,7 +9,6 @@ namespace PluginRemoteTimers { #include <string> cNopacityDisplayMenu::cNopacityDisplayMenu(void) { -esyslog("nopacity: starting menu"); config.setDynamicValues(); menuCategoryLast = mcUndefined; FrameTime = config.menuFrameTime; @@ -359,7 +358,6 @@ void cNopacityDisplayMenu::SetButtonPositions(void) { continue; } } - } void cNopacityDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { diff --git a/displaymenuview.c b/displaymenuview.c index 0b4fed1..6026462 100644 --- a/displaymenuview.c +++ b/displaymenuview.c @@ -90,7 +90,7 @@ void cNopacityDisplayMenuView::SetGeometry(void) { menuItemHeightRecordings = config.menuRecFolderSize + 2; diskUsageWidth = diskUsageHeight = osdWidth * config.menuSizeDiskUsage / 100; timersWidth = osdWidth * config.menuWidthRightItems / 100; - buttonsBorder = 10; + buttonsBorder = footerHeight / 6; buttonWidth = (osdWidth / 4) - 2 * buttonsBorder; buttonHeight = footerHeight - 3 * buttonsBorder; messageWidth = 0.8 * osdWidth; @@ -155,6 +155,8 @@ void cNopacityMenuItem::DoSleep(int duration) { } std::string cNopacityMenuItem::CutText(std::string *text, int width, const cFont *font) { + if (width <= font->Size()) + return text->c_str(); cTextWrapper twText; twText.Set(text->c_str(), font, width); std::string cuttedTextNative = twText.GetLine(0); @@ -165,6 +167,8 @@ std::string cNopacityMenuItem::CutText(std::string *text, int width, const cFont if (actWidth > width) { int overlap = actWidth - width; int charWidth = font->Width("."); + if (charWidth == 0) + charWidth = 1; int cutChars = overlap / charWidth; if (cutChars > 0) { cuttedTextNative = cuttedTextNative.substr(0, cuttedTextNative.length() - cutChars); |