summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY5
-rw-r--r--baserender.c273
-rw-r--r--baserender.h2
-rw-r--r--displaymenu.c261
-rw-r--r--displaymenu.h2
-rw-r--r--textscroller.c35
-rw-r--r--textscroller.h6
7 files changed, 346 insertions, 238 deletions
diff --git a/HISTORY b/HISTORY
index 151d6284..9315602c 100644
--- a/HISTORY
+++ b/HISTORY
@@ -4,8 +4,11 @@ VDR Plugin 'skinflatplus' Revision History
2014-MM-DD: Version 0.4.0
- [add] Textscroller support
- text in displaychannel for epg-text and epgshort-text
- - topbar
- messages
+ - menu item channel
+ - menu item timer
+ - menu item recording
+ - menu item event
- [add] new options in general settings for textscroller
2014-06-19: Version 0.3.1
diff --git a/baserender.c b/baserender.c
index fa79a01d..468f3f54 100644
--- a/baserender.c
+++ b/baserender.c
@@ -17,7 +17,6 @@ cFlatBaseRender::cFlatBaseRender(void) {
tobBarTitleExtra2 = "";
topBarLastDate = "";
topBarUpdateTitle = false;
- topBarUpdateScroller = false;
topBarHeight = 0;
topBarExtraIconSet = false;
topBarMenuIconSet = false;
@@ -53,7 +52,6 @@ cFlatBaseRender::~cFlatBaseRender(void) {
if( osd ) {
messageScroller.Clear();
- topBarScroller.Clear();
if( topBarPixmap )
osd->DestroyPixmap(topBarPixmap);
if( buttonsPixmap )
@@ -122,22 +120,11 @@ void cFlatBaseRender::TopBarCreate(void) {
topBarIconBGPixmap->Fill(clrTransparent);
topBarIconPixmap->Fill(clrTransparent);
- topBarScroller.SetOsd(osd);
- topBarScroller.SetScrollStep( Config.ScrollerStep );
- topBarScroller.SetScrollDelay( Config.ScrollerDelay );
- topBarScroller.SetScrollType( Config.ScrollerType );
- topBarScroller.Clear();
-
if( Config.DiskUsageShow == 3)
TopBarEnableDiskUsage();
}
void cFlatBaseRender::TopBarSetTitle(cString title) {
- if( strcmp(*topBarTitle, *title) != 0 )
- topBarUpdateScroller = true;
-
- dsyslog("topBarTitle: %s title: %s topBarUpdateScroller: %d", *topBarTitle, *title, topBarUpdateScroller);
-
topBarTitle = title;
tobBarTitleExtra1 = "";
tobBarTitleExtra2 = "";
@@ -207,7 +194,7 @@ void cFlatBaseRender::TopBarEnableDiskUsage(void) {
TopBarSetTitleExtra(extra1, extra2);
TopBarSetExtraIcon(iconName);
}
-// sollte bei jedem "Flush" aufgerufen werden!
+// sollte bei jedum "Flush" aufgerufen werden!
void cFlatBaseRender::TopBarUpdate(void) {
cString curDate = DayDateTime();
int TopBarWidth = osdWidth - Config.decorBorderTopBarSize*2;
@@ -217,18 +204,13 @@ void cFlatBaseRender::TopBarUpdate(void) {
topBarUpdateTitle = false;
topBarLastDate = curDate;
- int TitleWidthLeft = TopBarWidth;
-
int fontTop = (topBarHeight - topBarFontHeight) / 2;
int fontSmlTop = (topBarHeight - topBarFontSmlHeight*2) / 2;
- int RecLeft = TopBarWidth / 2;
-
topBarPixmap->Fill(Theme.Color(clrTopBarBg));
topBarIconPixmap->Fill(clrTransparent);
topBarIconBGPixmap->Fill(clrTransparent);
- int TitleWidth = topBarFont->Width(topBarTitle);
time_t t;
time(&t);
@@ -236,9 +218,8 @@ void cFlatBaseRender::TopBarUpdate(void) {
cString time2 = cString::sprintf("%s %s", *time, tr("clock"));
int timeWidth = topBarFont->Width(*time2) + marginItem*2;
- topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth, fontTop), time2, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), topBarFont);
-
- TitleWidthLeft -= timeWidth;
+ int Right = TopBarWidth - timeWidth;
+ topBarPixmap->DrawText(cPoint(Right, fontTop), time2, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), topBarFont);
cString weekday = WeekDayNameFull(t);
int weekdayWidth = topBarFontSml->Width(*weekday);
@@ -246,9 +227,122 @@ void cFlatBaseRender::TopBarUpdate(void) {
cString date = ShortDateString(t);
int dateWidth = topBarFontSml->Width(*date);
- int fullWidth = max(weekdayWidth, dateWidth);
- TitleWidthLeft -= fullWidth;
- int DateRight = TopBarWidth - timeWidth - fullWidth - marginItem*2;
+ Right = TopBarWidth - timeWidth - max(weekdayWidth, dateWidth) - marginItem;
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, max(weekdayWidth, dateWidth), 0, taRight);
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, max(weekdayWidth, dateWidth), 0, taRight);
+
+ int numConflicts = 0, ConW = 0;
+ if( Config.TopBarRecConflictsShow ) {
+ cPlugin *p = cPluginManager::GetPlugin("epgsearch");
+ if (p) {
+ Epgsearch_lastconflictinfo_v1_0 *serviceData = new Epgsearch_lastconflictinfo_v1_0;
+ if (serviceData) {
+ serviceData->nextConflict = 0;
+ serviceData->relevantConflicts = 0;
+ serviceData->totalConflicts = 0;
+ p->Service("Epgsearch-lastconflictinfo-v1.0", serviceData);
+ if (serviceData->relevantConflicts > 0) {
+ numConflicts = serviceData->relevantConflicts;
+ }
+ delete serviceData;
+ }
+ }
+ if( numConflicts ) {
+ cImage *imgCon = NULL;
+ if( numConflicts < Config.TopBarRecConflictsHigh )
+ imgCon = imgLoader.LoadIcon("topbar_timerconflict_low", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
+ else
+ imgCon = imgLoader.LoadIcon("topbar_timerconflict_high", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
+
+ if( imgCon ) {
+ ConW = imgCon->Width();
+ cString Con = cString::sprintf("%d", numConflicts);
+ ConW += topBarFontSml->Width(*Con);
+ Right -= ConW + marginItem;
+
+ int iconTop = (topBarFontHeight - imgCon->Height()) / 2;
+ topBarIconPixmap->DrawImage( cPoint(Right, iconTop), *imgCon );
+ ConW = imgCon->Width();
+
+ cString ConNum = cString::sprintf("%d", numConflicts);
+ if( numConflicts < Config.TopBarRecConflictsHigh )
+ topBarPixmap->DrawText(cPoint(Right + imgCon->Width(), fontSmlTop), ConNum, Theme.Color(clrTopBarConflictLowFg), Theme.Color(clrTopBarConflictLowBg), topBarFontSml);
+ else
+ topBarPixmap->DrawText(cPoint(Right + imgCon->Width(), fontSmlTop), ConNum, Theme.Color(clrTopBarConflictHighFg), Theme.Color(clrTopBarConflictHighBg), topBarFontSml);
+ }
+ }
+ }
+ if( numConflicts == 0 ) {
+ cImage *imgCon = NULL;
+ if( numConflicts < Config.TopBarRecConflictsHigh )
+ imgCon = imgLoader.LoadIcon("topbar_timerconflict_low", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
+ else
+ imgCon = imgLoader.LoadIcon("topbar_timerconflict_high", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
+
+ if( imgCon ) {
+ ConW = imgCon->Width();
+ cString Con = cString::sprintf("%d", numConflicts);
+ ConW += topBarFontSml->Width(*Con);
+ Right -= ConW + marginItem;
+ }
+ }
+
+ int RecW = 0;
+ int numRec = 0;
+ if( Config.TopBarRecordingShow ) {
+ // look for timers
+ for(cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) {
+ if( ti->Matches(t) ) {
+ numRec++;
+ }
+ }
+ if( numRec ) {
+ cImage *imgRec = imgLoader.LoadIcon("topbar_timer", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
+ if( imgRec ) {
+ RecW = imgRec->Width();
+
+ cString Rec = cString::sprintf("%d", numRec);
+ RecW += topBarFontSml->Width(*Rec);
+ Right -= RecW + marginItem;
+
+ int iconTop = (topBarFontHeight - imgRec->Height()) / 2;
+ topBarIconPixmap->DrawImage( cPoint(Right, iconTop), *imgRec );
+ RecW = imgRec->Width() + marginItem;
+
+ cString RecNum = cString::sprintf("%d", numRec);
+ topBarPixmap->DrawText(cPoint(Right + imgRec->Width(), fontSmlTop), RecNum, Theme.Color(clrTopBarRecordingActiveFg), Theme.Color(clrTopBarRecordingActiveBg), topBarFontSml);
+ }
+ }
+ }
+ if( numRec == 0 ) {
+ cImage *imgRec = imgLoader.LoadIcon("topbar_timer", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
+ if( imgRec ) {
+ RecW = imgRec->Width();
+
+ cString Rec = cString::sprintf("%d", numRec);
+ RecW += topBarFontSml->Width(*Rec);
+ Right -= RecW + marginItem;
+ }
+ }
+
+
+ int extra1Width = topBarFontSml->Width(tobBarTitleExtra1);
+ int extra2Width = topBarFontSml->Width(tobBarTitleExtra2);
+ int extraMaxWidth = max(extra1Width, extra2Width);
+
+ if( topBarExtraIconSet ) {
+ cImage *img = imgLoader.LoadIcon(*topBarExtraIcon, 999, topBarHeight);
+ if( img ) {
+ int iconTop = 0;
+ Right -= img->Width() + marginItem;
+ topBarIconPixmap->DrawImage(cPoint(Right, iconTop), *img);
+ }
+ }
+
+ Right -= extraMaxWidth + marginItem;
+
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop), tobBarTitleExtra1, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight);
+ topBarPixmap->DrawText(cPoint(Right, fontSmlTop + topBarFontSmlHeight), tobBarTitleExtra2, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight);
if( topBarMenuIconSet && Config.TopBarMenuIconShow ) {
int IconLeft = marginItem;
@@ -257,7 +351,6 @@ void cFlatBaseRender::TopBarUpdate(void) {
int iconTop = (topBarHeight / 2 - img->Height()/2);
topBarIconPixmap->DrawImage(cPoint(IconLeft, iconTop), *img);
MenuIconWidth = img->Width()+marginItem*2;
- TitleWidthLeft -= MenuIconWidth + marginItem*3;
}
}
@@ -283,137 +376,11 @@ void cFlatBaseRender::TopBarUpdate(void) {
topBarIconPixmap->DrawImage(cPoint(IconLeft, iconTop), *img);
}
MenuIconWidth = imageBGWidth+marginItem*2;
- TitleWidthLeft -= MenuIconWidth + marginItem*3;
- }
-
- int extra1Width = topBarFontSml->Width(tobBarTitleExtra1);
- int extra2Width = topBarFontSml->Width(tobBarTitleExtra2);
- int extraMaxWidth = max(extra1Width, extra2Width);
-
- TitleWidthLeft -= extraMaxWidth + marginItem * 2;
-
- int extraLeft = TopBarWidth/2 - extraMaxWidth/2;
-// if( !Config.ScrollerEnable )
-// extraLeft = max(MenuIconWidth + marginItem*4 + TitleWidth, extraLeft);
-
- topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop), tobBarTitleExtra1, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight);
- topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop + topBarFontSmlHeight), tobBarTitleExtra2, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, extraMaxWidth, 0, taRight);
-
- RecLeft = extraLeft + extraMaxWidth + marginItem;
-
- if( topBarExtraIconSet ) {
- int extraIconLeft = extraLeft + extraMaxWidth + marginItem;
- cImage *img = imgLoader.LoadIcon(*topBarExtraIcon, 999, topBarHeight);
- if( img ) {
- if( (extraIconLeft + img->Width() + marginItem) < DateRight ) {
- int iconTop = 0;
- topBarIconPixmap->DrawImage(cPoint(extraIconLeft, iconTop), *img);
-
- RecLeft += topBarHeight + marginItem;
- }
- }
}
- topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight);
- topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop + topBarFontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), topBarFontSml, fullWidth, 0, taRight);
+ topBarPixmap->DrawText(cPoint(MenuIconWidth + marginItem*2, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), topBarFont, Right - MenuIconWidth - marginItem*4);
DecorBorderDraw(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight, Config.decorBorderTopBarSize, Config.decorBorderTopBarType, Config.decorBorderTopBarFg, Config.decorBorderTopBarBg);
-
- int RecW = 0;
- int numRec = 0;
- cImage *imgRec = imgLoader.LoadIcon("topbar_timer", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
- if( imgRec )
- RecW = imgRec->Width();
- if( Config.TopBarRecordingShow ) {
- // look for timers
- for(cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) {
- if( ti->Matches(t) ) {
- numRec++;
- }
- }
- if( numRec ) {
- cString Rec = cString::sprintf("%d", numRec);
- RecW += topBarFont->Width(*Rec);
- TitleWidthLeft -= RecW + marginItem*2;
- }
- }
-
- int numConflicts = 0, ConW = 0;
- if( Config.TopBarRecConflictsShow ) {
- cPlugin *p = cPluginManager::GetPlugin("epgsearch");
- if (p) {
- Epgsearch_lastconflictinfo_v1_0 *serviceData = new Epgsearch_lastconflictinfo_v1_0;
- if (serviceData) {
- serviceData->nextConflict = 0;
- serviceData->relevantConflicts = 0;
- serviceData->totalConflicts = 0;
- p->Service("Epgsearch-lastconflictinfo-v1.0", serviceData);
- if (serviceData->relevantConflicts > 0) {
- numConflicts = serviceData->relevantConflicts;
- }
- delete serviceData;
- }
- }
- }
- cImage *imgCon = NULL;
- if( numConflicts < Config.TopBarRecConflictsHigh )
- imgCon = imgLoader.LoadIcon("topbar_timerconflict_low", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
- else
- imgCon = imgLoader.LoadIcon("topbar_timerconflict_high", topBarFontHeight - marginItem*2, topBarFontHeight - marginItem*2);
-
- if( imgCon )
- ConW = imgCon->Width();
- if( numConflicts ) {
- cString Con = cString::sprintf("%d", numRec);
- ConW += topBarFont->Width(*Con);
- TitleWidthLeft -= ConW + marginItem*2;
- }
-
- int maxWidth = extraLeft - (MenuIconWidth + marginItem*2) - marginItem;
- if( (TitleWidth > maxWidth) && Config.ScrollerEnable ) {
- if( topBarUpdateScroller ) {
- topBarScroller.Clear();
- topBarScroller.AddScroller(*topBarTitle, cRect(MenuIconWidth + marginItem*2, fontTop, maxWidth, topBarFontHeight), Theme.Color(clrTopBarFont), clrTransparent, topBarFont);
- topBarUpdateScroller = false;
- }
- TitleWidth = TitleWidthLeft;
- } else {
- topBarScroller.Clear();
-/* int dotsWidth = topBarFont->Width("... ");
- cTextWrapper TitleWrapper(topBarTitle, topBarFont, TitleWidthLeft - dotsWidth);
- topBarTitle = TitleWrapper.GetLine(0);
- topBarTitle = cString::sprintf("%s...", *topBarTitle);
- TitleWidth = topBarFont->Width(topBarTitle);
-*/ topBarPixmap->DrawText(cPoint(MenuIconWidth + marginItem*2, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), topBarFont, maxWidth);
- }
-
- if( TitleWidth > RecLeft )
- RecLeft = TitleWidth + marginItem*2;
- if( numRec > 0 && Config.TopBarRecordingShow && (RecLeft + RecW) < DateRight ) {
- if( imgRec ) {
- int iconTop = (topBarFontHeight - imgRec->Height()) / 2;
- topBarIconPixmap->DrawImage( cPoint(RecLeft, iconTop), *imgRec );
- RecW = imgRec->Width() + marginItem;
- }
- cString RecNum = cString::sprintf("%d", numRec);
- topBarPixmap->DrawText(cPoint(RecLeft + RecW, fontSmlTop), RecNum, Theme.Color(clrTopBarRecordingActiveFg), Theme.Color(clrTopBarRecordingActiveBg), topBarFontSml);
- RecLeft += RecW + marginItem*2 + topBarFontSml->Width(RecNum);
- }
-
- int ConLeft = RecLeft + marginItem;
- if( numConflicts > 0 && Config.TopBarRecConflictsShow && (ConLeft + ConW) < DateRight ) {
- if( imgCon ) {
- int iconTop = (topBarFontHeight - imgCon->Height()) / 2;
- topBarIconPixmap->DrawImage( cPoint(RecLeft, iconTop), *imgCon );
- ConW = imgCon->Width();
- }
-
- cString ConNum = cString::sprintf("%d", numConflicts);
- if( numConflicts < Config.TopBarRecConflictsHigh )
- topBarPixmap->DrawText(cPoint(ConLeft + ConW + marginItem, fontSmlTop), ConNum, Theme.Color(clrTopBarConflictLowFg), Theme.Color(clrTopBarConflictLowBg), topBarFontSml);
- else
- topBarPixmap->DrawText(cPoint(ConLeft + ConW + marginItem, fontSmlTop), ConNum, Theme.Color(clrTopBarConflictHighFg), Theme.Color(clrTopBarConflictHighBg), topBarFontSml);
- }
}
}
diff --git a/baserender.h b/baserender.h
index cfe19392..6ed286f4 100644
--- a/baserender.h
+++ b/baserender.h
@@ -44,8 +44,6 @@ class cFlatBaseRender
cPixmap *topBarIconBGPixmap;
cFont *topBarFont, *topBarFontSml;
int topBarFontHeight, topBarFontSmlHeight;
- cTextScrollers topBarScroller;
- bool topBarUpdateScroller;
cString topBarTitle;
cString tobBarTitleExtra1, tobBarTitleExtra2;
diff --git a/displaymenu.c b/displaymenu.c
index f9307f4a..08284dc8 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -66,15 +66,15 @@ cFlatDisplayMenu::cFlatDisplayMenu(void) {
menuCategory = mcUndefined;
- scrollers.SetOsd(osd);
- scrollers.SetScrollStep( Config.ScrollerStep );
- scrollers.SetScrollDelay( Config.ScrollerDelay );
- scrollers.SetScrollType( Config.ScrollerType );
+ menuItemScroller.SetOsd(osd);
+ menuItemScroller.SetScrollStep( Config.ScrollerStep );
+ menuItemScroller.SetScrollDelay( Config.ScrollerDelay );
+ menuItemScroller.SetScrollType( Config.ScrollerType );
}
cFlatDisplayMenu::~cFlatDisplayMenu() {
- scrollers.Clear();
+ menuItemScroller.Clear();
osd->DestroyPixmap(menuPixmap);
osd->DestroyPixmap(menuIconsPixmap);
@@ -85,6 +85,7 @@ cFlatDisplayMenu::~cFlatDisplayMenu() {
void cFlatDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) {
ItemBorderClear();
+ menuItemScroller.Clear();
isScrolling = false;
ShowRecording = ShowEvent = ShowText = false;
@@ -629,6 +630,9 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C
cString buffer;
int y = Index * itemChannelHeight;
+ if( Current )
+ menuItemScroller.Clear();
+
int Height = fontHeight;
if( Config.MenuChannelView == 3 || Config.MenuChannelView == 4 )
Height = fontHeight + fontSmlHeight + marginItem + Config.decorProgressMenuItemSize;
@@ -761,8 +765,13 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C
menuPixmap->DrawRectangle(cRect( Left, lineTop, menuItemWidth - Left, 3), ColorFg);
cString groupname = cString::sprintf(" %s ", *buffer);
menuPixmap->DrawText(cPoint(Left + (menuItemWidth / 10 * 2), Top), groupname, ColorFg, ColorBg, font, 0, 0, taCenter);
- } else
- menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width);
+ } else {
+ if( Current && font->Width(buffer) > (Width) ) {
+ menuItemScroller.AddScroller(buffer, cRect(LeftName, Top + menuTop, Width, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width);
+ }
+ }
} else {
Width = menuItemWidth / 10*2;
if( isScrolling )
@@ -777,7 +786,11 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C
cString groupname = cString::sprintf(" %s ", *buffer);
menuPixmap->DrawText(cPoint(Left + (menuItemWidth / 10 * 2), Top), groupname, ColorFg, ColorBg, font, 0, 0, taCenter);
} else {
- menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width);
+ if( Current && font->Width(buffer) > (Width) ) {
+ menuItemScroller.AddScroller(buffer, cRect(LeftName, Top + menuTop, Width, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width);
+ }
Left += Width + marginItem;
@@ -811,9 +824,19 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C
if( Config.MenuChannelView == 3 || Config.MenuChannelView == 4 ) {
Left = LeftName;
Top += fontHeight;
- menuPixmap->DrawText(cPoint(Left, Top), EventTitle, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem );
- } else
- menuPixmap->DrawText(cPoint(Left, Top), EventTitle, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem );
+
+ if( Current && fontSml->Width(EventTitle) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(EventTitle, cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontSmlHeight), ColorFg, clrTransparent, fontSml);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), EventTitle, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem );
+ }
+ } else {
+ if( Current && font->Width(EventTitle) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(EventTitle, cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), EventTitle, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem );
+ }
+ }
}
}
@@ -1022,6 +1045,9 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current
cString buffer;
int y = Index * itemTimerHeight;
+ if( Current )
+ menuItemScroller.Clear();
+
int Height = fontHeight;
if( Config.MenuTimerView == 2 || Config.MenuTimerView == 3 )
Height = fontHeight + fontSmlHeight + marginItem;
@@ -1159,29 +1185,34 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current
buffer = cString::sprintf("%02d:%02d - %02d:%02d",Timer->Start() / 100, Timer->Start() % 100, Timer->Stop() / 100, Timer->Stop() % 100);
menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
Left += font->Width("99:99 - 99:99 ");
- if( Config.MenuItemParseTilde ) {
- std::string tilde = File;
- size_t found = tilde.find(" ~ ");
- size_t found2 = tilde.find("~");
- if( found != string::npos ) {
- std::string first = tilde.substr(0, found);
- std::string second = tilde.substr(found +2, tilde.length() );
-
- menuPixmap->DrawText(cPoint(Left, Top), first.c_str(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
- int l = font->Width( first.c_str() );
- menuPixmap->DrawText(cPoint(Left + l, Top), second.c_str(), ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - l - marginItem);
- } else if ( found2 != string::npos ) {
- std::string first = tilde.substr(0, found2);
- std::string second = tilde.substr(found2 +1, tilde.length() );
-
- menuPixmap->DrawText(cPoint(Left, Top), first.c_str(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
- int l = font->Width( first.c_str() );
- l += font->Width("X");
- menuPixmap->DrawText(cPoint(Left + l, Top), second.c_str(), ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - l - marginItem);
- } else
- menuPixmap->DrawText(cPoint(Left, Top), File, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+
+ if( Current && font->Width(File) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(File, cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font, ColorExtraTextFg);
} else {
- menuPixmap->DrawText(cPoint(Left, Top), File, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ if( Config.MenuItemParseTilde ) {
+ std::string tilde = File;
+ size_t found = tilde.find(" ~ ");
+ size_t found2 = tilde.find("~");
+ if( found != string::npos ) {
+ std::string first = tilde.substr(0, found);
+ std::string second = tilde.substr(found +2, tilde.length() );
+
+ menuPixmap->DrawText(cPoint(Left, Top), first.c_str(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ int l = font->Width( first.c_str() );
+ menuPixmap->DrawText(cPoint(Left + l, Top), second.c_str(), ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - l - marginItem);
+ } else if ( found2 != string::npos ) {
+ std::string first = tilde.substr(0, found2);
+ std::string second = tilde.substr(found2 +1, tilde.length() );
+
+ menuPixmap->DrawText(cPoint(Left, Top), first.c_str(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ int l = font->Width( first.c_str() );
+ l += font->Width("X");
+ menuPixmap->DrawText(cPoint(Left + l, Top), second.c_str(), ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - l - marginItem);
+ } else
+ menuPixmap->DrawText(cPoint(Left, Top), File, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), File, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
}
} else if( Config.MenuTimerView == 2 || Config.MenuTimerView == 3 ) {
buffer = cString::sprintf("%s%s%s. %02d:%02d - %02d:%02d",
@@ -1190,29 +1221,33 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current
Timer->Stop() / 100, Timer->Stop() % 100);
menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
- if( Config.MenuItemParseTilde ) {
- std::string tilde = File;
- size_t found = tilde.find(" ~ ");
- size_t found2 = tilde.find("~");
- if( found != string::npos ) {
- std::string first = tilde.substr(0, found);
- std::string second = tilde.substr(found +2, tilde.length() );
-
- menuPixmap->DrawText(cPoint(Left, Top + fontHeight), first.c_str(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
- int l = fontSml->Width( first.c_str() );
- menuPixmap->DrawText(cPoint(Left + l, Top + fontHeight), second.c_str(), ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - l - marginItem);
- } else if ( found2 != string::npos ) {
- std::string first = tilde.substr(0, found2);
- std::string second = tilde.substr(found2 +1, tilde.length() );
-
- menuPixmap->DrawText(cPoint(Left, Top + fontHeight), first.c_str(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
- int l = fontSml->Width( first.c_str() );
- l += fontSml->Width("X");
- menuPixmap->DrawText(cPoint(Left + l, Top + fontHeight), second.c_str(), ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - l - marginItem);
- } else
- menuPixmap->DrawText(cPoint(Left, Top + fontHeight), File, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ if( Current && fontSml->Width(File) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(File, cRect(Left, Top + fontHeight + menuTop, menuItemWidth - Left - marginItem - scrollBarWidth, fontSmlHeight), ColorFg, clrTransparent, fontSml, ColorExtraTextFg);
} else {
- menuPixmap->DrawText(cPoint(Left, Top + fontHeight), File, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ if( Config.MenuItemParseTilde ) {
+ std::string tilde = File;
+ size_t found = tilde.find(" ~ ");
+ size_t found2 = tilde.find("~");
+ if( found != string::npos ) {
+ std::string first = tilde.substr(0, found);
+ std::string second = tilde.substr(found +2, tilde.length() );
+
+ menuPixmap->DrawText(cPoint(Left, Top + fontHeight), first.c_str(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ int l = fontSml->Width( first.c_str() );
+ menuPixmap->DrawText(cPoint(Left + l, Top + fontHeight), second.c_str(), ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - l - marginItem);
+ } else if ( found2 != string::npos ) {
+ std::string first = tilde.substr(0, found2);
+ std::string second = tilde.substr(found2 +1, tilde.length() );
+
+ menuPixmap->DrawText(cPoint(Left, Top + fontHeight), first.c_str(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ int l = fontSml->Width( first.c_str() );
+ l += fontSml->Width("X");
+ menuPixmap->DrawText(cPoint(Left + l, Top + fontHeight), second.c_str(), ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - l - marginItem);
+ } else
+ menuPixmap->DrawText(cPoint(Left, Top + fontHeight), File, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top + fontHeight), File, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ }
}
}
@@ -1267,6 +1302,9 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current
cString buffer;
int y = Index * itemEventHeight;
+ if( Current )
+ menuItemScroller.Clear();
+
int Height = fontHeight;
if( Config.MenuEventView == 2 || Config.MenuEventView == 3 )
Height = fontHeight + fontSmlHeight + marginItem*2 + Config.decorProgressMenuItemSize/2;
@@ -1488,24 +1526,72 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current
Left += imageHeight + marginItem;
if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) && Channel ) {
- menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
- if( Event->ShortText() ) {
- Left += fontSml->Width( Event->Title() );
- cString ShortText = cString::sprintf(" %s", Event->ShortText());
- menuPixmap->DrawText(cPoint(Left, Top), ShortText, ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ if( Current ) {
+ if( Event->ShortText() ) {
+ cString t = cString::sprintf("%s~%s", Event->Title(), Event->ShortText() );
+ if( fontSml->Width(t) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(*t, cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontSmlHeight), ColorFg, clrTransparent, fontSml, ColorExtraTextFg);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ Left += fontSml->Width( Event->Title() ) + fontSml->Width("~");
+ cString ShortText = cString::sprintf("%s", Event->ShortText());
+ menuPixmap->DrawText(cPoint(Left, Top), ShortText, ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ }
+ } else {
+ if( fontSml->Width(Event->Title()) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(Event->Title(), cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontSmlHeight), ColorFg, clrTransparent, fontSml, ColorExtraTextFg);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ }
+ }
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ if( Event->ShortText() ) {
+ Left += fontSml->Width( Event->Title() ) + font->Width("~");
+ cString ShortText = cString::sprintf("%s", Event->ShortText());
+ menuPixmap->DrawText(cPoint(Left, Top), ShortText, ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ }
}
} else if( (Config.MenuEventView == 2 || Config.MenuEventView == 3) ) {
- menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ if( Current && font->Width(Event->Title()) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(Event->Title(), cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
if( Event->ShortText() ) {
Top += fontHeight;
- menuPixmap->DrawText(cPoint(Left, Top), Event->ShortText(), ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ if( Current && fontSml->Width(Event->ShortText()) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(Event->ShortText(), cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorExtraTextFg, clrTransparent, fontSml);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->ShortText(), ColorExtraTextFg, ColorBg, fontSml, menuItemWidth - Left - marginItem);
+ }
}
} else {
- menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
- if( Event->ShortText() ) {
- Left += font->Width(Event->Title());
- cString ShortText = cString::sprintf(" %s", Event->ShortText());
- menuPixmap->DrawText(cPoint(Left, Top), ShortText, ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ if( Current ) {
+ if( Event->ShortText() ) {
+ cString t = cString::sprintf("%s~%s", Event->Title(), Event->ShortText() );
+ if( font->Width(t) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(*t, cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font, ColorExtraTextFg);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ Left += font->Width(Event->Title()) + font->Width("~");
+ cString ShortText = cString::sprintf("%s", Event->ShortText());
+ menuPixmap->DrawText(cPoint(Left, Top), ShortText, ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
+ } else {
+ if( font->Width(Event->Title()) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(Event->Title(), cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font, ColorExtraTextFg);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
+ }
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Event->Title(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ if( Event->ShortText() ) {
+ Left += font->Width(Event->Title()) + font->Width("~");
+ cString ShortText = cString::sprintf("%s", Event->ShortText());
+ menuPixmap->DrawText(cPoint(Left, Top), ShortText, ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
}
}
} else if( Event ) {
@@ -1580,6 +1666,9 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index,
cString buffer;
cString RecName = GetRecordingName(Recording, Level, Total == 0);
+ if( Current )
+ menuItemScroller.Clear();
+
int y = Index * itemRecordingHeight;
int Height = fontHeight;
@@ -1652,7 +1741,11 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index,
}
Left += imgRecCut->Width() + marginItem;
- menuPixmap->DrawText(cPoint(Left, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ if( Current && font->Width(RecName) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(RecName, cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
} else if( Total > 0 ) {
img = imgLoader.LoadIcon("folder", fontHeight, fontHeight);
if( img ) {
@@ -1675,7 +1768,11 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index,
menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorExtraTextFg, ColorBg, font, menuItemWidth - Left - marginItem);
}
- menuPixmap->DrawText(cPoint(LeftWidth, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - LeftWidth - marginItem);
+ if( Current && font->Width(RecName) > (menuItemWidth - LeftWidth - marginItem) ) {
+ menuItemScroller.AddScroller(RecName, cRect(LeftWidth, Top + menuTop, menuItemWidth - LeftWidth - marginItem, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(LeftWidth, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - LeftWidth - marginItem);
+ }
LeftWidth += font->Width(RecName) + marginItem*2;
} else if( Total == -1 ) {
img = imgLoader.LoadIcon("folder", fontHeight, fontHeight);
@@ -1684,7 +1781,11 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index,
Left += img->Width() + marginItem;
}
- menuPixmap->DrawText(cPoint(Left, Top), Recording->FileName(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ if( Current && font->Width(Recording->FileName()) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(Recording->FileName(), cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Recording->FileName(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
}
} else {
if( Total == 0 ) {
@@ -1697,7 +1798,12 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index,
if( isScrolling )
ImagesWidth -= scrollBarWidth;
- menuPixmap->DrawText(cPoint(Left, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem - ImagesWidth);
+ if( Current && font->Width(RecName) > (menuItemWidth - Left - marginItem - ImagesWidth) ) {
+ menuItemScroller.AddScroller(RecName, cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem - ImagesWidth, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem - ImagesWidth);
+ }
+
Top += fontHeight;
int Minutes = (Recording->LengthInSeconds() + 30) / 60;
@@ -1727,7 +1833,12 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index,
menuIconsPixmap->DrawImage( cPoint(Left, Top), *img );
Left += img->Width() + marginItem;
}
- menuPixmap->DrawText(cPoint(Left, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+
+ if( Current && font->Width(RecName) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(RecName, cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), RecName, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
Top += fontHeight;
buffer = cString::sprintf(" %d", Total);
@@ -1751,7 +1862,11 @@ bool cFlatDisplayMenu::SetItemRecording(const cRecording *Recording, int Index,
menuIconsPixmap->DrawImage( cPoint(Left, Top), *img );
Left += img->Width() + marginItem;
}
- menuPixmap->DrawText(cPoint(Left, Top), Recording->FileName(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ if( Current && font->Width(Recording->FileName()) > (menuItemWidth - Left - marginItem) ) {
+ menuItemScroller.AddScroller(Recording->FileName(), cRect(Left, Top + menuTop, menuItemWidth - Left - marginItem, fontHeight), ColorFg, clrTransparent, font);
+ } else {
+ menuPixmap->DrawText(cPoint(Left, Top), Recording->FileName(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem);
+ }
}
}
diff --git a/displaymenu.h b/displaymenu.h
index 1ad36333..aa3a4b31 100644
--- a/displaymenu.h
+++ b/displaymenu.h
@@ -40,7 +40,7 @@ class cFlatDisplayMenu : public cFlatBaseRender, public cSkinDisplayMenu {
cComplexContent ComplexContent;
// TextScroller
- cTextScrollers scrollers;
+ cTextScrollers menuItemScroller;
cString ItemEventLastChannelName;
diff --git a/textscroller.c b/textscroller.c
index ee88338b..e47246cb 100644
--- a/textscroller.c
+++ b/textscroller.c
@@ -1,6 +1,6 @@
#include "textscroller.h"
-void cTextScroll::SetText(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font) {
+void cTextScroll::SetText(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font, tColor colorExtraTextFg) {
if( Osd == NULL )
return;
@@ -9,7 +9,7 @@ void cTextScroll::SetText(const char *text, cRect position, tColor colorFg, tCol
Font = font;
Position = position;
- ColorFg = colorFg; ColorBg = colorBg;
+ ColorFg = colorFg; ColorBg = colorBg; ColorExtraTextFg = colorExtraTextFg;
cRect drawPort(0, 0, font->Width(Text.c_str()), Position.Height());
if( Osd && Pixmap )
@@ -31,7 +31,31 @@ void cTextScroll::Reset(void) {
void cTextScroll::Draw(void) {
if( !Pixmap )
return;
- Pixmap->DrawText(cPoint(0, 0), Text.c_str(), ColorFg, ColorBg, Font);
+
+ if( ColorExtraTextFg ) {
+ std::string tilde = Text;
+ size_t found = tilde.find(" ~ ");
+ size_t found2 = tilde.find("~");
+ if( found != std::string::npos ) {
+ std::string first = tilde.substr(0, found);
+ std::string second = tilde.substr(found +2, tilde.length() );
+
+ Pixmap->DrawText(cPoint(0, 0), first.c_str(), ColorFg, ColorBg, Font);
+ int l = Font->Width( first.c_str() );
+ Pixmap->DrawText(cPoint(l, 0), second.c_str(), ColorExtraTextFg, ColorBg, Font);
+ } else if ( found2 != std::string::npos ) {
+ std::string first = tilde.substr(0, found2);
+ std::string second = tilde.substr(found2 +1, tilde.length() );
+
+ Pixmap->DrawText(cPoint(0, 0), first.c_str(), ColorFg, ColorBg, Font);
+ int l = Font->Width( first.c_str() );
+ l += Font->Width("X");
+ Pixmap->DrawText(cPoint(l, 0), second.c_str(), ColorExtraTextFg, ColorBg, Font);
+ } else
+ Pixmap->DrawText(cPoint(0, 0), Text.c_str(), ColorFg, ColorBg, Font);
+ } else {
+ Pixmap->DrawText(cPoint(0, 0), Text.c_str(), ColorFg, ColorBg, Font);
+ }
}
void cTextScroll::DoStep(void) {
@@ -88,6 +112,7 @@ cTextScrollers::~cTextScrollers() {
}
void cTextScrollers::Clear(void) {
+ dsyslog("Clear");
Cancel(-1);
while( Active() )
cCondWait::SleepMs(10);
@@ -100,13 +125,13 @@ void cTextScrollers::Clear(void) {
Scrollers.clear();
}
-void cTextScrollers::AddScroller(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font) {
+void cTextScrollers::AddScroller(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font, tColor ColorExtraTextFg) {
Cancel(-1);
while( Active() )
cCondWait::SleepMs(10);
Scrollers.push_back( new cTextScroll(Osd, scrollType, scrollStep, (int)((double)WAITDELAY / (double)scrollDelay), Layer) );
- Scrollers.back()->SetText(text, position, colorFg, colorBg, font);
+ Scrollers.back()->SetText(text, position, colorFg, colorBg, font, ColorExtraTextFg);
StartScrolling();
}
diff --git a/textscroller.h b/textscroller.h
index b782ad81..53ffbff7 100644
--- a/textscroller.h
+++ b/textscroller.h
@@ -12,7 +12,7 @@ class cTextScroll
private:
cRect Position;
- tColor ColorFg, ColorBg;
+ tColor ColorFg, ColorExtraTextFg, ColorBg;
std::string Text;
cFont *Font;
cPixmap *Pixmap;
@@ -55,7 +55,7 @@ public:
}
void Reset(void);
- void SetText(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font);
+ void SetText(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font, tColor ColorExtraTextFg = 0);
void DoStep(void);
void Draw(void);
@@ -82,6 +82,6 @@ public:
void SetScrollStep(int step) { scrollStep = step; }
void SetScrollDelay(int delay) { scrollDelay = delay; }
void SetScrollType(int type) { scrollType = type; }
- void AddScroller(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font);
+ void AddScroller(const char *text, cRect position, tColor colorFg, tColor colorBg, cFont *font, tColor ColorExtraTextFg = 0);
bool isActive(void) { return Active(); }
};