summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-06-14 20:24:29 +0200
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-06-14 20:24:29 +0200
commitf483538a9ae9c05becc107daa1c5f2f62d9eab47 (patch)
tree7276df2568adca78c7b4f78ae0a972853fef9848
parentf13035e7401334e3511eaa4c093a8dd177550a3b (diff)
downloadskin-flatplus-f483538a9ae9c05becc107daa1c5f2f62d9eab47.tar.gz
skin-flatplus-f483538a9ae9c05becc107daa1c5f2f62d9eab47.tar.bz2
try fix #1868
-rw-r--r--displaymenu.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/displaymenu.c b/displaymenu.c
index 8883780a..e4391b8a 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -300,8 +300,7 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S
}
menuPixmap->DrawRectangle(cRect(Config.decorBorderMenuItemSize, y, menuItemWidth, fontHeight), ColorBg);
int lh = fontHeight;
- int x1 = 0;
- int xOff = x1;
+ int xOff = 0;
for (int i = 0; i < MaxTabs; i++) {
const char *s = GetTabbedText(Text, i);
if( s ) {
@@ -316,12 +315,7 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S
bool isRunning = false;
int xt = Tab(i);
- int xt2 = Tab(i+1);
- if( xt2 == 0 || i == MaxTabs || (GetTabbedText(Text, i+1) == NULL) )
- xt2 = menuItemWidth;
- if( xt >= menuItemWidth )
- continue;
if( true ) {
// check if timer info symbols: " !#>"
if (i == 0 && strlen(s) == 1 && strchr(" !#>", s[0])) {
@@ -352,7 +346,7 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S
if (s[3] == '*') isRunning = true;
}
}
- xOff = x1 + Tab(i) + Config.decorBorderMenuItemSize;
+ xOff = Tab(i) + Config.decorBorderMenuItemSize;
if( istimer ) {
// timer menu
@@ -438,21 +432,21 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S
std::string first = tilde.substr(0, found);
std::string second = tilde.substr(found +2, tilde.length() );
- menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), first.c_str(), ColorFg, ColorBg, font);
+ menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), first.c_str(), ColorFg, ColorBg, font, menuItemWidth - xt - Config.decorBorderMenuItemSize);
int l = font->Width( first.c_str() );
- menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize + l, y), second.c_str(), ColorExtraTextFg, ColorBg, font, xt2 - xt);
+ menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize + l, y), second.c_str(), ColorExtraTextFg, ColorBg, font, menuItemWidth - xt - Config.decorBorderMenuItemSize - l);
} else if ( found2 != string::npos ) {
std::string first = tilde.substr(0, found2);
std::string second = tilde.substr(found2 +1, tilde.length() );
- menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), first.c_str(), ColorFg, ColorBg, font, xt2 - xt);
+ menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), first.c_str(), ColorFg, ColorBg, font, menuItemWidth - xt - Config.decorBorderMenuItemSize);
int l = font->Width( first.c_str() );
l += font->Width("X");
- menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize + l, y), second.c_str(), ColorExtraTextFg, ColorBg, font, xt2 - xt);
+ menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize + l, y), second.c_str(), ColorExtraTextFg, ColorBg, font, menuItemWidth - xt - Config.decorBorderMenuItemSize -l);
} else
- menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font, xt2 - xt);
+ menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font, menuItemWidth - xt - Config.decorBorderMenuItemSize);
} else
- menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font, xt2 - xt);
+ menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font, menuItemWidth - xt - Config.decorBorderMenuItemSize);
}
}
}