summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY1
-rw-r--r--displaymenu.c2
-rw-r--r--displaymenuview.c2
-rw-r--r--menuitem.c4
4 files changed, 6 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 4944016..8918c85 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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;
diff --git a/menuitem.c b/menuitem.c
index 8b207bd..1b541bc 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -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);