diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-05-30 19:35:42 +0200 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-05-30 19:35:42 +0200 |
commit | c50775492c0b1d3da71283572a755d9aec3b202a (patch) | |
tree | 8749fb8d9cd4688afce3cb1dda21d97f0bedda03 /displaymenu.c | |
parent | 2e5ecb5d9894cfd42f9117014fded3250eeb3688 (diff) | |
download | skin-flatplus-c50775492c0b1d3da71283572a755d9aec3b202a.tar.gz skin-flatplus-c50775492c0b1d3da71283572a755d9aec3b202a.tar.bz2 |
fix cut text on tab size
Diffstat (limited to 'displaymenu.c')
-rw-r--r-- | displaymenu.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/displaymenu.c b/displaymenu.c index b199b37a..eeecd522 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -316,6 +316,9 @@ 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 ) + xt2 = menuItemWidth; if( xt >= menuItemWidth ) continue; @@ -437,19 +440,19 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), first.c_str(), ColorFg, ColorBg, font); int l = font->Width( first.c_str() ); - menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize + l, y), second.c_str(), ColorExtraTextFg, ColorBg, font); + menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize + l, y), second.c_str(), ColorExtraTextFg, ColorBg, font, xt2 - xt); } 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); + menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), first.c_str(), ColorFg, ColorBg, font, xt2 - xt); 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); + menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize + l, y), second.c_str(), ColorExtraTextFg, ColorBg, font, xt2 - xt); } else - menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font); + menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font, xt2 - xt); } else - menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font); + menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font, xt2 - xt); } } } |