diff options
author | Martin Schirrmacher <vdr.skinflat@schirrmacher.eu> | 2013-08-04 23:50:53 +0200 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflat@schirrmacher.eu> | 2013-08-04 23:50:53 +0200 |
commit | 4e6f677b254f138e2f0deefea3f29553c6d4a41b (patch) | |
tree | 60d3502b460d42e7c1cee3628c89ce6d760de458 | |
parent | 33b71d21d4ea31a5ba79934e3341b06e8307462e (diff) | |
download | skin-flat-4e6f677b254f138e2f0deefea3f29553c6d4a41b.tar.gz skin-flat-4e6f677b254f138e2f0deefea3f29553c6d4a41b.tar.bz2 |
display volume, topbar fixes
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | baserender.c | 22 | ||||
-rw-r--r-- | displaymenu.c | 17 | ||||
-rw-r--r-- | displayreplay.c | 6 | ||||
-rw-r--r-- | displaytracks.c | 4 | ||||
-rw-r--r-- | displayvolume.c | 16 | ||||
-rw-r--r-- | flat.h | 2 | ||||
-rw-r--r-- | po/de_DE.po | 5 | ||||
-rw-r--r-- | themes/flat-default.theme | 2 |
9 files changed, 44 insertions, 32 deletions
@@ -1,6 +1,8 @@ VDR Plugin 'skinflat' Revision History --------------------------------------- 2013-XX-XX: Version 0.0.3 +- [update] display tracks margin, background color +- [update] display volume margin - [update] top bar, 2 rows date, color - [update] color values - [update] channel display, separate color for following epg diff --git a/baserender.c b/baserender.c index fea4749..d83f438 100644 --- a/baserender.c +++ b/baserender.c @@ -98,8 +98,10 @@ void cFlatBaseRender::TopBarUpdate(void) { time(&t); cString time = TimeString(t); - int timeWidth = font->Width(*time) + marginItem*2; - topBarPixmap->DrawText(cPoint(osdWidth - timeWidth, fontTop), time, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), font); + cString time2 = cString::sprintf("%s %s", *time, tr("clock")); + + int timeWidth = font->Width(*time2) + marginItem*2; + topBarPixmap->DrawText(cPoint(osdWidth - timeWidth, fontTop), time2, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), font); cString weekday = WeekDayNameFull(t); int weekdayWidth = fontSml->Width(*weekday); @@ -109,8 +111,9 @@ void cFlatBaseRender::TopBarUpdate(void) { int fullWidth = max(weekdayWidth, dateWidth); - topBarPixmap->DrawText(cPoint(osdWidth - timeWidth - fullWidth - marginItem*2, 0), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, 0, taCenter); - topBarPixmap->DrawText(cPoint(osdWidth - timeWidth - fullWidth - marginItem*2, fontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, 0, taCenter); + int fontSmlTop = (topBarHeight - fontSmlHeight*2) / 2; + topBarPixmap->DrawText(cPoint(osdWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, 0, taCenter); + topBarPixmap->DrawText(cPoint(osdWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop + fontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, 0, taCenter); } } @@ -145,7 +148,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char } void cFlatBaseRender::MessageCreate(void) { - messageHeight = fontHeight; + messageHeight = fontHeight + marginItem*2; int top = (osdHeight - messageHeight) / 2; messagePixmap = osd->CreatePixmap(2, cRect(0, top, osdWidth, messageHeight)); messagePixmap->Fill(clrTransparent); @@ -173,7 +176,7 @@ void cFlatBaseRender::MessageSet(eMessageType Type, const char *Text) { messagePixmap->DrawRectangle(cRect( osdWidth - messageHeight, 0, messageHeight, messageHeight), col); int textWidth = font->Width(Text); - messagePixmap->DrawText(cPoint((osdWidth - textWidth) / 2, 0), Text, Theme.Color(clrMessageFont), Theme.Color(clrMessageBg), font); + messagePixmap->DrawText(cPoint((osdWidth - textWidth) / 2, marginItem), Text, Theme.Color(clrMessageFont), Theme.Color(clrMessageBg), font); } void cFlatBaseRender::MessageClear(void) { @@ -193,7 +196,7 @@ void cFlatBaseRender::ContentCreate(int Left, int Top, int Width, int Height) { } void cFlatBaseRender::ContentSet(const char *Text, tColor ColorFg, tColor ColorBg) { - contentWrapper.Set(Text, font, contentWidth); + contentWrapper.Set(Text, font, contentWidth - marginItem*2); contentColorFg = ColorFg; contentColorBg = ColorBg; @@ -242,7 +245,7 @@ int cFlatBaseRender::ContentScrollOffset(void) { } int cFlatBaseRender::ContentVisibleLines(void) { - return (contentHeight / fontHeight); + return contentHeight / fontHeight; } bool cFlatBaseRender::ContentScroll(bool Up, bool Page) { @@ -295,9 +298,8 @@ void cFlatBaseRender::contentDraw(void) { int linesText = contentWrapper.Lines(); int currentHeight = 0; for (int i=0; i < linesText; i++) { - //printf("drawLine: %d %s\n", i, contentWrapper.GetLine(i)); currentHeight = (i)*fontHeight; - contentPixmap->DrawText(cPoint(0, currentHeight), contentWrapper.GetLine(i), contentColorFg, contentColorBg, font, contentWidth); + contentPixmap->DrawText(cPoint(marginItem, currentHeight), contentWrapper.GetLine(i), contentColorFg, contentColorBg, font, contentWidth - marginItem*2); } } diff --git a/displaymenu.c b/displaymenu.c index b8080ac..2ec8f09 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -16,7 +16,7 @@ cFlatDisplayMenu::cFlatDisplayMenu(void) { menuPixmap = osd->CreatePixmap(1, cRect(0, topBarHeight + marginItem, menuWidth, scrollBarHeight )); - contentTop = topBarHeight + marginItem + fontHeight + (fontSmlHeight*2) + marginItem; + contentTop = topBarHeight + marginItem + fontHeight + (fontSmlHeight*2) + marginItem*3; ContentCreate(0, contentTop, menuWidth, scrollBarHeight - fontHeight*2 -3); scrollbarPixmap = osd->CreatePixmap(2, cRect(osdWidth - scrollBarWidth, scrollBarTop, scrollBarWidth, scrollBarHeight)); @@ -124,6 +124,8 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) { return; menuPixmap->Fill(clrTransparent); + menuPixmap->DrawRectangle(cRect(0, 0, menuWidth, fontHeight + fontSmlHeight*2 + marginItem*2), Theme.Color(clrScrollbarBg)); + cString date = Event->GetDateString(); cString startTime = Event->GetTimeString(); cString endTime = Event->GetEndTimeString(); @@ -133,9 +135,9 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) { cString title = Event->Title(); cString shortText = Event->ShortText(); - menuPixmap->DrawText(cPoint(0, 0), timeString, Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, menuWidth); - menuPixmap->DrawText(cPoint(0, fontSmlHeight), title, Theme.Color(clrMenuEventFontTitle), Theme.Color(clrMenuEventBg), font, menuWidth); - menuPixmap->DrawText(cPoint(0, fontSmlHeight + fontHeight), shortText, Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, menuWidth); + menuPixmap->DrawText(cPoint(marginItem, marginItem), timeString, Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, menuWidth - marginItem*2); + menuPixmap->DrawText(cPoint(marginItem, marginItem + fontSmlHeight), title, Theme.Color(clrMenuEventFontTitle), Theme.Color(clrMenuEventBg), font, menuWidth - marginItem*2); + menuPixmap->DrawText(cPoint(marginItem, marginItem + fontSmlHeight + fontHeight), shortText, Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, menuWidth - marginItem*2); ContentSet( Event->Description(), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg) ); if( ContentScrollable() ) @@ -146,6 +148,7 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { if( !Recording ) return; menuPixmap->Fill(clrTransparent); + menuPixmap->DrawRectangle(cRect(0, 0, menuWidth, fontHeight + fontSmlHeight*2 + marginItem*2), Theme.Color(clrScrollbarBg)); const cRecordingInfo *recInfo = Recording->Info(); cString timeString = cString::sprintf("%s %s %s", *DateString(Recording->Start()), *TimeString(Recording->Start()), recInfo->ChannelName() ? recInfo->ChannelName() : ""); @@ -155,9 +158,9 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { title = Recording->Name(); cString shortText = recInfo->ShortText(); - menuPixmap->DrawText(cPoint(0, 0), timeString, Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg), fontSml, menuWidth); - menuPixmap->DrawText(cPoint(0, fontSmlHeight), title, Theme.Color(clrMenuRecFontTitle), Theme.Color(clrMenuRecBg), font, menuWidth); - menuPixmap->DrawText(cPoint(0, fontSmlHeight + fontHeight), shortText, Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg), fontSml, menuWidth); + menuPixmap->DrawText(cPoint(marginItem, marginItem), timeString, Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg), fontSml, menuWidth - marginItem*2); + menuPixmap->DrawText(cPoint(marginItem, marginItem + fontSmlHeight), title, Theme.Color(clrMenuRecFontTitle), Theme.Color(clrMenuRecBg), font, menuWidth - marginItem*2); + menuPixmap->DrawText(cPoint(marginItem, marginItem + fontSmlHeight + fontHeight), shortText, Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg), fontSml, menuWidth - marginItem*2); ContentSet( recInfo->Description(), Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg) ); if( ContentScrollable() ) diff --git a/displayreplay.c b/displayreplay.c index 3b16905..5ba88f6 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -36,7 +36,7 @@ void cFlatDisplayReplay::SetRecording(const cRecording *Recording) { else info = cString::sprintf("%s %s", *ShortDateString(Recording->Start()), *TimeString(Recording->Start())); - labelPixmap->DrawText(cPoint(0, fontHeight), info, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), fontSml, osdWidth); + labelPixmap->DrawText(cPoint(marginItem, fontHeight), info, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), fontSml, osdWidth); } void cFlatDisplayReplay::SetTitle(const char *Title) { @@ -112,8 +112,8 @@ void cFlatDisplayReplay::SetTotal(const char *Total) { void cFlatDisplayReplay::UpdateInfo(void) { int right = osdWidth - font->Width(total); - labelPixmap->DrawText(cPoint(0, 0), current, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), font, font->Width(current), fontHeight); - labelPixmap->DrawText(cPoint(right, 0), total, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), font, font->Width(total), fontHeight); + labelPixmap->DrawText(cPoint(marginItem, 0), current, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), font, font->Width(current), fontHeight); + labelPixmap->DrawText(cPoint(right - marginItem, 0), total, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), font, font->Width(total), fontHeight); } void cFlatDisplayReplay::SetJump(const char *Jump) { diff --git a/displaytracks.c b/displaytracks.c index 326b9b3..bdc4105 100644 --- a/displaytracks.c +++ b/displaytracks.c @@ -7,9 +7,9 @@ cFlatDisplayTracks::cFlatDisplayTracks(const char *Title, int NumTracks, const c itemHeight = fontHeight + 2; currentIndex = -1; - maxItemWidth = font->Width(Title); + maxItemWidth = font->Width(Title) + marginItem*2; for (int i = 0; i < NumTracks; i++) - maxItemWidth = max(maxItemWidth, font->Width(Tracks[i])); + maxItemWidth = max(maxItemWidth, font->Width(Tracks[i]) + marginItem*2); int itemsHeight = NumTracks * itemHeight; int left = osdWidth - maxItemWidth; diff --git a/displayvolume.c b/displayvolume.c index ee7919a..2c9ce51 100644 --- a/displayvolume.c +++ b/displayvolume.c @@ -3,7 +3,7 @@ cFlatDisplayVolume::cFlatDisplayVolume(void) { muted = false; - labelHeight = fontHeight; + labelHeight = fontHeight + marginItem*2; CreateFullOsd(); TopBarCreate(); @@ -28,17 +28,19 @@ void cFlatDisplayVolume::SetVolume(int Current, int Total, bool Mute) { cString label = cString::sprintf("%s: %d", tr("Volume"), Current); cString maxLabel = cString::sprintf("%s: %d", tr("Volume"), 555); - int maxlabelWidth = font->Width(maxLabel); + int maxlabelWidth = font->Width(maxLabel) + marginItem; int left = osdWidth / 2 - maxlabelWidth / 2; + labelPixmap->DrawRectangle(cRect(left - marginItem, marginItem, marginItem, fontHeight), Theme.Color(clrVolumeBg)); + if (Mute) { - labelPixmap->DrawText(cPoint(left, 0), *label, Theme.Color(clrVolumeFont), Theme.Color(clrVolumeBg), - font, maxlabelWidth + marginItem*2 + labelHeight, fontHeight, taLeft); - if( imgLoader.LoadIcon("mute", labelHeight, labelHeight) ) { - muteLogoPixmap->DrawImage( cPoint(left + maxlabelWidth + marginItem, 0), imgLoader.GetImage() ); + labelPixmap->DrawText(cPoint(left, marginItem), *label, Theme.Color(clrVolumeFont), Theme.Color(clrVolumeBg), + font, maxlabelWidth + marginItem + labelHeight, fontHeight, taLeft); + if( imgLoader.LoadIcon("mute", fontHeight, fontHeight) ) { + muteLogoPixmap->DrawImage( cPoint(left + maxlabelWidth + marginItem, marginItem), imgLoader.GetImage() ); } } else { - labelPixmap->DrawText(cPoint(left, 0), *label, Theme.Color(clrVolumeFont), Theme.Color(clrVolumeBg), + labelPixmap->DrawText(cPoint(left, marginItem), *label, Theme.Color(clrVolumeFont), Theme.Color(clrVolumeBg), font, maxlabelWidth, fontHeight, taLeft); } ProgressBarDraw(Current, Total); @@ -82,7 +82,7 @@ THEME_CLR(Theme, clrReplayMarkFg, 0xFFEEEEEE); THEME_CLR(Theme, clrReplayMarkCurrentFg, 0xFF3090B0); // Tracks -THEME_CLR(Theme, clrTrackItemBg, 0xBB909090); +THEME_CLR(Theme, clrTrackItemBg, 0xBB101010); THEME_CLR(Theme, clrTrackItemFont, 0xFFEEEEEE); THEME_CLR(Theme, clrTrackItemCurrentBg, 0xBB3090B0); THEME_CLR(Theme, clrTrackItemCurrentFont, 0xFFEEEEEE); diff --git a/po/de_DE.po b/po/de_DE.po index e05aff7..0c2e182 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: 2013-07-29 07:40+0200\n" +"POT-Creation-Date: 2013-08-04 18:47+0200\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" @@ -15,5 +15,8 @@ msgstr "" "Content-Type: text/plain; charset=ISO-8859-15\n" "Content-Transfer-Encoding: 8bit\n" +msgid "clock" +msgstr "Uhr" + msgid "Volume" msgstr "Lautstärke" diff --git a/themes/flat-default.theme b/themes/flat-default.theme index 31b1869..1cc181a 100644 --- a/themes/flat-default.theme +++ b/themes/flat-default.theme @@ -46,7 +46,7 @@ clrReplayProgressBarFg = FFEEEEEE clrReplayProgressBg = BB101010 clrReplayMarkFg = FFEEEEEE clrReplayMarkCurrentFg = FF3090B0 -clrTrackItemBg = BB909090 +clrTrackItemBg = BB101010 clrTrackItemFont = FFEEEEEE clrTrackItemCurrentBg = BB3090B0 clrTrackItemCurrentFont = FFEEEEEE |