diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-02-09 16:26:35 +0100 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-02-09 16:26:35 +0100 |
commit | 5530242d2c45e5833e4f29a5af1ee2ccdf76e05c (patch) | |
tree | f3e14000832bcd39036d63751e71f46be9e2e725 | |
parent | 1f46b4528d2eff9748836cffe919a82860322e12 (diff) | |
download | skin-flatplus-5530242d2c45e5833e4f29a5af1ee2ccdf76e05c.tar.gz skin-flatplus-5530242d2c45e5833e4f29a5af1ee2ccdf76e05c.tar.bz2 |
add menu SetItemTimer
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | baserender.c | 9 | ||||
-rw-r--r-- | baserender.h | 3 | ||||
-rw-r--r-- | config.c | 3 | ||||
-rw-r--r-- | config.h | 1 | ||||
-rw-r--r-- | displaymenu.c | 372 | ||||
-rw-r--r-- | displaymenu.h | 6 | ||||
-rw-r--r-- | po/de_DE.po | 12 | ||||
-rw-r--r-- | setup.c | 8 |
9 files changed, 292 insertions, 123 deletions
@@ -6,6 +6,7 @@ VDR Plugin 'skinflatplus' Revision History - [fix] load user decor settings - [fix] menu scrollbar size and margin - [fix] no scrollbar in some situations +- [fix] remove button border if button is not shown - [add] add support for menu SetItemChannel - [update] add Patch from MegaV0lt, support for simple aspect & format, new icons - [update] only log not loaded images diff --git a/baserender.c b/baserender.c index c0747106..6d28ba47 100644 --- a/baserender.c +++ b/baserender.c @@ -266,6 +266,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char int buttonWidth = (WidthMargin / 4) - Config.decorBorderButtonSize*2; buttonsPixmap->Fill(clrTransparent); + DecorBorderClearByFrom(BorderButton); buttonsDrawn = false; @@ -274,7 +275,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char buttonsPixmap->DrawText(cPoint(x, 0), Red, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); buttonsPixmap->DrawRectangle(cRect(x, fontHeight + marginButtonColor, buttonWidth, buttonColorHeight), Theme.Color(clrButtonRed)); DecorBorderDraw(x + Config.decorBorderButtonSize, buttonsTop, buttonWidth, buttonsHeight, Config.decorBorderButtonSize, Config.decorBorderButtonType, - Config.decorBorderButtonFg, Config.decorBorderButtonBg); + Config.decorBorderButtonFg, Config.decorBorderButtonBg, BorderButton); buttonsDrawn = true; } @@ -283,7 +284,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char buttonsPixmap->DrawText(cPoint(x, 0), Green, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); buttonsPixmap->DrawRectangle(cRect(x, fontHeight + marginButtonColor, buttonWidth, buttonColorHeight), Theme.Color(clrButtonGreen)); DecorBorderDraw(x + Config.decorBorderButtonSize, buttonsTop, buttonWidth, buttonsHeight, Config.decorBorderButtonSize, Config.decorBorderButtonType, - Config.decorBorderButtonFg, Config.decorBorderButtonBg); + Config.decorBorderButtonFg, Config.decorBorderButtonBg, BorderButton); buttonsDrawn = true; } @@ -292,7 +293,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char buttonsPixmap->DrawText(cPoint(x, 0), Yellow, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); buttonsPixmap->DrawRectangle(cRect(x, fontHeight + marginButtonColor, buttonWidth, buttonColorHeight), Theme.Color(clrButtonYellow)); DecorBorderDraw(x + Config.decorBorderButtonSize, buttonsTop, buttonWidth, buttonsHeight, Config.decorBorderButtonSize, Config.decorBorderButtonType, - Config.decorBorderButtonFg, Config.decorBorderButtonBg); + Config.decorBorderButtonFg, Config.decorBorderButtonBg, BorderButton); buttonsDrawn = true; } @@ -303,7 +304,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char buttonsPixmap->DrawText(cPoint(x, 0), Blue, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); buttonsPixmap->DrawRectangle(cRect(x, fontHeight + marginButtonColor, buttonWidth, buttonColorHeight), Theme.Color(clrButtonBlue)); DecorBorderDraw(x + Config.decorBorderButtonSize, buttonsTop, buttonWidth, buttonsHeight, Config.decorBorderButtonSize, Config.decorBorderButtonType, - Config.decorBorderButtonFg, Config.decorBorderButtonBg); + Config.decorBorderButtonFg, Config.decorBorderButtonBg, BorderButton); buttonsDrawn = true; } } diff --git a/baserender.h b/baserender.h index 8673be76..0ba8be0c 100644 --- a/baserender.h +++ b/baserender.h @@ -8,7 +8,8 @@ enum eBorder { BorderMenuItem = 1, BorderRecordJump = 2, BorderMenuRecord = 3, - BorderMessage = 4 + BorderMessage = 4, + BorderButton = 5 }; struct sDecorBorder { @@ -34,7 +34,7 @@ cFlatConfig::cFlatConfig(void) { MenuItemIconsShow = true; TopBarMenuIconShow = true; - MenuItemPadding = 5; + MenuItemPadding = 3; marginOsdVer = 5; marginOsdHor = 5; TopBarFontSize = 0.05; @@ -43,6 +43,7 @@ cFlatConfig::cFlatConfig(void) { MainMenuItemScale = 1.0; MenuChannelView = 1; + MenuTimerView = 3; decorBorderChannelByTheme = 1; decorBorderChannelTypeUser = 0; @@ -178,6 +178,7 @@ class cFlatConfig double MainMenuItemScale; int MenuChannelView; + int MenuTimerView; int DecorIndex; }; diff --git a/displaymenu.c b/displaymenu.c index b3b72f73..8b0bb392 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -42,6 +42,7 @@ cFlatDisplayMenu::cFlatDisplayMenu(void) { itemHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; itemChannelHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; + itemTimerHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; scrollBarWidth = ScrollBarWidth() + marginItem; scrollBarHeight = osdHeight - (topBarHeight + Config.decorBorderTopBarSize*2 + marginItem*3 + buttonsHeight + Config.decorBorderButtonSize*2); @@ -87,16 +88,23 @@ cFlatDisplayMenu::~cFlatDisplayMenu() { } void cFlatDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) { + if( menuCategory == 8 && MenuCategory == 7 ) { + DecorBorderClearByFrom(BorderMenuItem); + ItemBorderClear(); + } + menuCategory = MenuCategory; if( menuCategory == mcChannel ) { - if( Config.MenuChannelView == 0 ) - itemChannelHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; - else if( Config.MenuChannelView == 1 ) + if( Config.MenuChannelView == 0 || Config.MenuChannelView == 1 || Config.MenuChannelView == 2 ) itemChannelHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; - else if( Config.MenuChannelView == 2 || Config.MenuChannelView == 3 ) + else if( Config.MenuChannelView == 3 || Config.MenuChannelView == 4 ) itemChannelHeight = fontHeight + fontSmlHeight + marginItem + Config.decorProgressMenuItemSize + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; - + } else if( menuCategory == mcTimer ) { + if( Config.MenuTimerView == 0 || Config.MenuTimerView == 1 ) + itemTimerHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; + else if( Config.MenuTimerView == 2 || Config.MenuTimerView == 3 ) + itemTimerHeight = fontHeight + fontSmlHeight + marginItem + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; } } @@ -134,6 +142,8 @@ void cFlatDisplayMenu::Scroll(bool Up, bool Page) { int cFlatDisplayMenu::MaxItems(void) { if( menuCategory == mcChannel ) return scrollBarHeight / itemChannelHeight; + if( menuCategory == mcTimer ) + return scrollBarHeight / itemTimerHeight; return scrollBarHeight / itemHeight; } @@ -141,6 +151,8 @@ int cFlatDisplayMenu::MaxItems(void) { int cFlatDisplayMenu::ItemsHeight(void) { if( menuCategory == mcChannel ) return MaxItems() * itemChannelHeight - Config.MenuItemPadding; + if( menuCategory == mcTimer ) + return MaxItems() * itemTimerHeight - Config.MenuItemPadding; return MaxItems() * itemHeight - Config.MenuItemPadding; } @@ -246,21 +258,8 @@ void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool S int y = Index * itemHeight; menuItemWidth = menuWidth - Config.decorBorderMenuItemSize*2; - switch( menuCategory ) { - case mcMain: - case mcSchedule: - case mcScheduleNow: - case mcScheduleNext: - case mcChannel: - case mcTimer: - case mcRecording: - case mcCommand: - case mcEvent: - menuItemWidth *= Config.MainMenuItemScale; - break; - default: - break; - } + if( menuCategory == mcMain ) + menuItemWidth *= Config.MainMenuItemScale; int AvailableTextWidth = menuItemWidth - scrollBarWidth; if( isScrolling ) @@ -564,20 +563,21 @@ void cFlatDisplayMenu::DrawProgressBarFromText(int Top, int Left, int Width, con bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider) { if( Config.MenuChannelView == 0 || !Channel ) return false; - + cSchedulesLock schedulesLock; const cSchedules *schedules = cSchedules::Schedules(schedulesLock); const cEvent *Event = NULL; + bool DrawProgress = true; cString buffer; int y = Index * itemChannelHeight; int Height = fontHeight; - if( Config.MenuChannelView == 2 || Config.MenuChannelView == 3 ) + if( Config.MenuChannelView == 3 || Config.MenuChannelView == 4 ) Height = fontHeight + fontSmlHeight + marginItem + Config.decorProgressMenuItemSize; - + menuItemWidth = menuWidth - Config.decorBorderMenuItemSize*2; - if( Config.MenuChannelView == 2 || Config.MenuChannelView == 3 ) + if( Config.MenuChannelView == 3 || Config.MenuChannelView == 4 ) menuItemWidth *= 0.5; if( isScrolling ) @@ -605,57 +605,50 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C Left = Config.decorBorderMenuItemSize + marginItem; Top = y; - bool DrawChanNumber = true; - bool DrawChanLogo = true; - bool DrawProgress = true; if( Channel->GroupSep() ) DrawProgress = false; float progress = 0.0; cString EventTitle = ""; - if( DrawChanNumber ) { - cString ws = "999"; - int w = font->Width(ws); - if( !Channel->GroupSep() ) - buffer = cString::sprintf("%d", Channel->Number()); - else - buffer = ""; - Width = font->Width(buffer); - if( Width < w ) - Width = w; - menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, Width, fontHeight, taRight); - Left += Width + marginItem; - } + cString ws = cString::sprintf("%d", Channels.MaxNumber()); + int w = font->Width(ws); + if( !Channel->GroupSep() ) + buffer = cString::sprintf("%d", Channel->Number()); + else + buffer = ""; + Width = font->Width(buffer); + if( Width < w ) + Width = w; + menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, Width, fontHeight, taRight); + Left += Width + marginItem; - if( DrawChanLogo ) { - int imageHeight = fontHeight; - int imageLeft = Left; - int imageTop = Top; - if( imgLoader.LoadLogo(Channel->Name(), imageHeight, imageHeight) ) { - imageTop = Top + (fontHeight - imgLoader.Height()) / 2; - menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); - Left += imageHeight + marginItem * 2; - } else { - bool isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false; + int imageHeight = fontHeight; + int imageLeft = Left; + int imageTop = Top; + if( imgLoader.LoadLogo(Channel->Name(), imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; + } else { + bool isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false; - if( isRadioChannel ) { - if( imgLoader.LoadIcon("radio", imageHeight, imageHeight) ) { - imageTop = Top + (fontHeight - imgLoader.Height()) / 2; - menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); - Left += imageHeight + marginItem * 2; - } - } else if( Channel->GroupSep() ) { - if( imgLoader.LoadIcon("changroup", imageHeight, imageHeight) ) { - imageTop = Top + (fontHeight - imgLoader.Height()) / 2; - menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); - Left += imageHeight + marginItem * 2; - } - } else { - if( imgLoader.LoadIcon("tv", imageHeight, imageHeight) ) { - imageTop = Top + (fontHeight - imgLoader.Height()) / 2; - menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); - Left += imageHeight + marginItem * 2; - } + if( isRadioChannel ) { + if( imgLoader.LoadIcon("radio", imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; + } + } else if( Channel->GroupSep() ) { + if( imgLoader.LoadIcon("changroup", imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; + } + } else { + if( imgLoader.LoadIcon("tv", imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; } } } @@ -683,51 +676,56 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C else buffer = cString::sprintf("%s", Channel->Name()); - Width = menuItemWidth / 10*2; - if( isScrolling ) - Width = (menuItemWidth + scrollBarWidth) / 10*2; - - if( Config.MenuChannelView == 2 || Config.MenuChannelView == 3 ) + if( Config.MenuChannelView == 1 ) { Width = menuItemWidth - LeftName; - - menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width); - - Left += Width + marginItem; - - if( DrawProgress ) { - int PBTop = y + (itemChannelHeight-Config.MenuItemPadding)/2 - Config.decorProgressMenuItemSize/2 - Config.decorBorderMenuItemSize; - int PBLeft = Left; - int PBWidth = menuItemWidth/10; - if( Config.MenuChannelView == 2 || Config.MenuChannelView == 3 ) { - PBTop = Top + fontHeight + fontSmlHeight; - PBLeft = Left - Width - marginItem; - PBWidth = menuItemWidth - LeftName - marginItem*2; + menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width); + } else { + Width = menuItemWidth / 10*2; + if( isScrolling ) + Width = (menuItemWidth + scrollBarWidth) / 10*2; + + if( Config.MenuChannelView == 3 || Config.MenuChannelView == 4 ) + Width = menuItemWidth - LeftName; + + menuPixmap->DrawText(cPoint(LeftName, Top), buffer, ColorFg, ColorBg, font, Width); + + Left += Width + marginItem; + + if( DrawProgress ) { + int PBTop = y + (itemChannelHeight-Config.MenuItemPadding)/2 - Config.decorProgressMenuItemSize/2 - Config.decorBorderMenuItemSize; + int PBLeft = Left; + int PBWidth = menuItemWidth/10; + if( Config.MenuChannelView == 3 || Config.MenuChannelView == 4 ) { + PBTop = Top + fontHeight + fontSmlHeight; + PBLeft = Left - Width - marginItem; + PBWidth = menuItemWidth - LeftName - marginItem*2; + + if( isScrolling ) + PBWidth += scrollBarWidth; + } + Width = menuItemWidth/10; if( isScrolling ) - PBWidth += scrollBarWidth; + Width = (menuItemWidth + scrollBarWidth) / 10; + if( Current ) + ProgressBarDrawRaw(menuPixmap, menuPixmap, cRect( PBLeft, PBTop, PBWidth, Config.decorProgressMenuItemSize), + cRect( PBLeft, PBTop, PBWidth, Config.decorProgressMenuItemSize), progress, 100, + Config.decorProgressMenuItemCurFg, Config.decorProgressMenuItemCurBarFg, Config.decorProgressMenuItemCurBg, Config.decorProgressMenuItemType); + else + ProgressBarDrawRaw(menuPixmap, menuPixmap, cRect( PBLeft, PBTop, PBWidth, Config.decorProgressMenuItemSize), + cRect( PBLeft, PBTop, PBWidth, Config.decorProgressMenuItemSize), progress, 100, + Config.decorProgressMenuItemFg, Config.decorProgressMenuItemBarFg, Config.decorProgressMenuItemBg, Config.decorProgressMenuItemType); + Left += Width + marginItem; } - - Width = menuItemWidth/10; - if( isScrolling ) - Width = (menuItemWidth + scrollBarWidth) / 10; - if( Current ) - ProgressBarDrawRaw(menuPixmap, menuPixmap, cRect( PBLeft, PBTop, PBWidth, Config.decorProgressMenuItemSize), - cRect( PBLeft, PBTop, PBWidth, Config.decorProgressMenuItemSize), progress, 100, - Config.decorProgressMenuItemCurFg, Config.decorProgressMenuItemCurBarFg, Config.decorProgressMenuItemCurBg, Config.decorProgressMenuItemType); - else - ProgressBarDrawRaw(menuPixmap, menuPixmap, cRect( PBLeft, PBTop, PBWidth, Config.decorProgressMenuItemSize), - cRect( PBLeft, PBTop, PBWidth, Config.decorProgressMenuItemSize), progress, 100, - Config.decorProgressMenuItemFg, Config.decorProgressMenuItemBarFg, Config.decorProgressMenuItemBg, Config.decorProgressMenuItemType); - Left += Width + marginItem; - } - if( Config.MenuChannelView == 2 || Config.MenuChannelView == 3 ) { - 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( 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 ); + } + sDecorBorder ib; ib.Left = Config.decorBorderMenuItemSize; ib.Top = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize + y; @@ -764,14 +762,14 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C ItemBorderInsertUnique(ib); } - if( (Config.MenuChannelView == 2 || Config.MenuChannelView == 3) && Event && Current ) { - SetItemChannelDrawEvent(Event); + if( Config.MenuChannelView == 4 && Event && Current ) { + DrawItemExtraEvent(Event); } return true; } -void cFlatDisplayMenu::SetItemChannelDrawEvent(const cEvent *Event) { +void cFlatDisplayMenu::DrawItemExtraEvent(const cEvent *Event) { cLeft = menuItemWidth + Config.decorBorderMenuItemSize*2 + Config.decorBorderMenuContentSize + marginItem; if( isScrolling ) @@ -864,6 +862,158 @@ void cFlatDisplayMenu::SetItemChannelDrawEvent(const cEvent *Event) { Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg); } +bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable) { + if( Config.MenuTimerView == 0 || !Timer ) + return false; + const cChannel *Channel = Timer->Channel(); + const cEvent *Event = Timer->Event(); + + cString buffer; + int y = Index * itemTimerHeight; + + int Height = fontHeight; + if( Config.MenuTimerView == 2 || Config.MenuTimerView == 3 ) + Height = fontHeight + fontSmlHeight + marginItem; + + menuItemWidth = menuWidth - Config.decorBorderMenuItemSize*2; + if( Config.MenuTimerView == 2 || Config.MenuTimerView == 3 ) + menuItemWidth *= 0.5; + + if( isScrolling ) + menuItemWidth -= scrollBarWidth; + + tColor ColorFg, ColorBg; + if (Current) { + ColorFg = Theme.Color(clrItemCurrentFont); + ColorBg = Theme.Color(clrItemCurrentBg); + } + else { + if( Selectable ) { + ColorFg = Theme.Color(clrItemSelableFont); + ColorBg = Theme.Color(clrItemSelableBg); + } else { + ColorFg = Theme.Color(clrItemFont); + ColorBg = Theme.Color(clrItemBg); + } + } + + menuPixmap->DrawRectangle(cRect(Config.decorBorderMenuItemSize, y, menuItemWidth, Height), ColorBg); + + int Left, Top; + Left = Config.decorBorderMenuItemSize + marginItem; + Top = y; + + int imageHeight = fontHeight; + int imageLeft = Left; + int imageTop = Top; + + cString TimerIconName(""); + if (!(Timer->HasFlags(tfActive))) + TimerIconName = "timerInactive"; + else if (Timer->Recording()) + TimerIconName = "timerRecording"; + else + TimerIconName = "timerActive"; + + if( imgLoader.LoadIcon(TimerIconName, imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; + } + + imageLeft = Left; + + if( imgLoader.LoadLogo(Channel->Name(), imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; + } else { + bool isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false; + + if( isRadioChannel ) { + if( imgLoader.LoadIcon("radio", imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; + } + } else if( Channel->GroupSep() ) { + if( imgLoader.LoadIcon("changroup", imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; + } + } else { + if( imgLoader.LoadIcon("tv", imageHeight, imageHeight) ) { + imageTop = Top + (fontHeight - imgLoader.Height()) / 2; + menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + Left += imageHeight + marginItem * 2; + } + } + } + time_t tStart, tStop; + + tStart = Timer->StartTime(); + tStop = Timer->StopTime(); + + cString StartString = cString::sprintf("%s %s", *ShortDateString(tStart), *TimeString(tStart)); + cString StopString = cString::sprintf("%s", *TimeString(tStop)); + + cString EventTitle = ""; + if( Event ) + EventTitle = Event->Title(); + + if( Config.MenuTimerView == 1 ) { + buffer = cString::sprintf("%s - %s - %s", *StartString, *StopString, *EventTitle); + menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem); + } else if( Config.MenuTimerView == 2 || Config.MenuTimerView == 3 ) { + buffer = cString::sprintf("%s - %s", *StartString, *StopString); + menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem); + menuPixmap->DrawText(cPoint(Left, Top + fontHeight), EventTitle, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem); + } + + sDecorBorder ib; + ib.Left = Config.decorBorderMenuItemSize; + ib.Top = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize + y; + + ib.Width = menuItemWidth - Config.decorBorderMenuItemSize*2; + + if( isScrolling ) { + ib.Width -= scrollBarWidth; + } + + ib.Width = menuItemWidth; + + ib.Height = Height; + ib.Size = Config.decorBorderMenuItemSize; + ib.Type = Config.decorBorderMenuItemType; + + if( Current ) { + ib.ColorFg = Config.decorBorderMenuItemCurFg; + ib.ColorBg = Config.decorBorderMenuItemCurBg; + } else { + if( Selectable ) { + ib.ColorFg = Config.decorBorderMenuItemSelFg; + ib.ColorBg = Config.decorBorderMenuItemSelBg; + } else { + ib.ColorFg = Config.decorBorderMenuItemFg; + ib.ColorBg = Config.decorBorderMenuItemBg; + } + } + + DecorBorderDraw(ib.Left, ib.Top, ib.Width, ib.Height, + ib.Size, ib.Type, ib.ColorFg, ib.ColorBg, BorderMenuItem); + + if( !isScrolling ) { + ItemBorderInsertUnique(ib); + } + + if( Config.MenuTimerView == 3 && Event && Current ) { + DrawItemExtraEvent(Event); + } + + return true; +} + void cFlatDisplayMenu::SetEvent(const cEvent *Event) { if( !Event ) return; diff --git a/displaymenu.h b/displaymenu.h index 3455ff12..8fd51368 100644 --- a/displaymenu.h +++ b/displaymenu.h @@ -21,7 +21,7 @@ class cFlatDisplayMenu : public cFlatBaseRender, public cSkinDisplayMenu { cPixmap *scrollbarPixmap; int scrollBarTop, scrollBarWidth, scrollBarHeight; - int itemHeight, itemChannelHeight; + int itemHeight, itemChannelHeight, itemTimerHeight; std::list<sDecorBorder> ItemsBorder; sDecorBorder EventBorder, RecordingBorder, TextBorder; @@ -45,7 +45,7 @@ class cFlatDisplayMenu : public cFlatBaseRender, public cSkinDisplayMenu { cBitmap *bmNew, *bmRec, *bmArrowTurn, *bmClock, *bmClocksml, *bmVPS; static cBitmap bmCNew, bmCRec, bmCArrowTurn, bmCClock, bmCClocksml, bmCHD, bmCVPS; - void SetItemChannelDrawEvent(const cEvent *Event); + void DrawItemExtraEvent(const cEvent *Event); public: cFlatDisplayMenu(void); virtual ~cFlatDisplayMenu(); @@ -62,7 +62,7 @@ class cFlatDisplayMenu : public cFlatBaseRender, public cSkinDisplayMenu { virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable); //virtual bool SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch); - //virtual bool SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable); + virtual bool SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable); virtual bool SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider); //virtual bool SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New); diff --git a/po/de_DE.po b/po/de_DE.po index f68120ab..7dbe54cc 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinflat 0.0.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2014-02-08 13:52+0100\n" +"POT-Creation-Date: 2014-02-09 15:39+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -117,11 +117,14 @@ msgstr "VDR standard" msgid "flatPlus long" msgstr "flatPlus lang" +msgid "flatPlus long + EPG" +msgstr "flatPlus lang + EPG" + msgid "flatPlus short" msgstr "flatPlus kurz" msgid "flatPlus short + EPG" -msgstr "" +msgstr "flatPlus kurz + EPG" msgid "General settings" msgstr "Allgemeine Einstellungen" @@ -253,11 +256,14 @@ msgid "Show additional EPG info" msgstr "Zeige Zusatzinfo bei EPG" msgid "Main menuitem scale" -msgstr "" +msgstr "Hauptmenüeintrag Scale" msgid "Menu channel view" msgstr "Menü Kanal Ansicht" +msgid "Menu timer view" +msgstr "Menü Timer Ansicht" + msgid "Menuitem border by decor-file?" msgstr "Menüitem Rand von Decordatei?" @@ -3,6 +3,7 @@ cStringList Bordertypes; cStringList Progresstypes; cStringList MenuChannelViews; +cStringList MenuTimerViews; cFlatSetup::cFlatSetup(void) { SetupConfig = Config; @@ -40,9 +41,15 @@ void cFlatSetup::Setup(void) { MenuChannelViews.Append( strdup(tr("VDR default")) ); MenuChannelViews.Append( strdup(tr("flatPlus long")) ); + MenuChannelViews.Append( strdup(tr("flatPlus long + EPG")) ); MenuChannelViews.Append( strdup(tr("flatPlus short")) ); MenuChannelViews.Append( strdup(tr("flatPlus short + EPG")) ); + MenuTimerViews.Append( strdup(tr("VDR default")) ); + MenuTimerViews.Append( strdup(tr("flatPlus long")) ); + MenuTimerViews.Append( strdup(tr("flatPlus short")) ); + MenuTimerViews.Append( strdup(tr("flatPlus short + EPG")) ); + Add(new cOsdItem(tr("General settings"), osUnknown, true)); Add(new cOsdItem(tr("Channelinfo settings"), osUnknown, true)); Add(new cOsdItem(tr("Menu settings"), osUnknown, true)); @@ -354,6 +361,7 @@ void cFlatSetupMenu::Setup(void) { Add(new cMenuEditPrcItem(tr("Main menuitem scale"), &SetupConfig->MainMenuItemScale, 0.2, 1, 0)); Add(new cMenuEditStraItem(tr("Menu channel view"), &SetupConfig->MenuChannelView, MenuChannelViews.Size(), &MenuChannelViews[0])); + Add(new cMenuEditStraItem(tr("Menu timer view"), &SetupConfig->MenuTimerView, MenuTimerViews.Size(), &MenuTimerViews[0])); Add(new cMenuEditBoolItem(tr("Menuitem border by decor-file?"), &SetupConfig->decorBorderMenuItemByTheme)); if( SetupConfig->decorBorderMenuItemByTheme ) { |