diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2013-11-06 19:19:00 +0100 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2013-11-06 19:19:00 +0100 |
commit | 11e6acd1be1276b301535d2c6f5095f542ca0e9c (patch) | |
tree | c85df721dc0a9c694ccbbd4068dd6d3bf351d6f7 | |
parent | e4024a0b5b0ebe4c27b9c8390cd2d845d992606e (diff) | |
download | skin-flatplus-11e6acd1be1276b301535d2c6f5095f542ca0e9c.tar.gz skin-flatplus-11e6acd1be1276b301535d2c6f5095f542ca0e9c.tar.bz2 |
fix marker first line in replay
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | baserender.c | 24 | ||||
-rw-r--r-- | baserender.h | 4 | ||||
-rw-r--r-- | displaymenu.c | 6 |
4 files changed, 26 insertions, 12 deletions
@@ -1,6 +1,10 @@ VDR Plugin 'skinflatplus' Revision History --------------------------------------- +2013-XX-XX: Version 0.0.2 +- [fix] marker position +- [fix] borders displaced + 2013-23-09: Version 0.0.1 difference to skinflat - [add] configurable borders diff --git a/baserender.c b/baserender.c index 4e70ecd5..8d8d0486 100644 --- a/baserender.c +++ b/baserender.c @@ -272,8 +272,13 @@ void cFlatBaseRender::ContentCreate(int Left, int Top, int Width, int Height) { contentHeight = lines * fontHeight; } -void cFlatBaseRender::ContentSet(const char *Text, tColor ColorFg, tColor ColorBg) { - contentWrapper.Set(Text, font, contentWidth - marginItem*2); +void cFlatBaseRender::ContentSet(const char *Text, bool FixedFont, tColor ColorFg, tColor ColorBg) { + contentFixedFont = FixedFont; + if( FixedFont ) + contentWrapper.Set(Text, fontFixed, contentWidth - marginItem*2); + else + contentWrapper.Set(Text, font, contentWidth - marginItem*2); + contentColorFg = ColorFg; contentColorBg = ColorBg; @@ -376,7 +381,10 @@ void cFlatBaseRender::contentDraw(void) { int currentHeight = 0; for (int i=0; i < linesText; i++) { currentHeight = (i)*fontHeight; - contentPixmap->DrawText(cPoint(marginItem, currentHeight), contentWrapper.GetLine(i), contentColorFg, contentColorBg, font, contentWidth - marginItem*2); + if( contentFixedFont ) + contentPixmap->DrawText(cPoint(marginItem, currentHeight), contentWrapper.GetLine(i), contentColorFg, contentColorBg, fontFixed, contentWidth - marginItem*2); + else + contentPixmap->DrawText(cPoint(marginItem, currentHeight), contentWrapper.GetLine(i), contentColorFg, contentColorBg, font, contentWidth - marginItem*2); } } @@ -598,8 +606,9 @@ void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks // the small line progressBarPixmap->DrawRectangle(cRect( 0, top - sml/2, progressBarWidth, sml), progressBarColorFg); - + bool Start = true; + for( const cMark *m = Marks->First(); m; m = Marks->Next(m) ) { posMark = ProgressBarMarkPos( m->Position(), Total ); posCurrent = ProgressBarMarkPos( Current, Total ); @@ -627,7 +636,6 @@ void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks if( posCurrent > posMarkLast + sml/2 ) progressBarPixmap->DrawRectangle(cRect( posMarkLast - sml/2, 0, sml, progressBarHeight), progressBarColorMark); } - } int cFlatBaseRender::ProgressBarMarkPos(int P, int Total) { @@ -686,10 +694,10 @@ void cFlatBaseRender::ProgressBarDrawMark(int posMark, int posMarkLast, int posC else progressBarPixmap->DrawRectangle(cRect( posMark - mbig/2, progressBarHeight - sml, mbig, sml), progressBarColorMark); } - - if( posCurrent == posMarkLast ) + + if( posCurrent == posMarkLast && posMarkLast != 0 ) progressBarPixmap->DrawRectangle(cRect( posMarkLast - sml, 0, sml*2, progressBarHeight), progressBarColorMarkCurrent); - else + else if( posMarkLast != 0 ) progressBarPixmap->DrawRectangle(cRect( posMarkLast - sml/2, 0, sml, progressBarHeight), progressBarColorMark); } diff --git a/baserender.h b/baserender.h index 277ee4ee..7e4bf650 100644 --- a/baserender.h +++ b/baserender.h @@ -66,6 +66,8 @@ class cFlatBaseRender int contentDrawPortHeight; // gesamthöhe des Textes bool contentHasScrollbar; bool contentShown; + bool contentFixedFont; + tColor contentColorFg, contentColorBg; cTextWrapper contentWrapper; @@ -124,7 +126,7 @@ class cFlatBaseRender int ScrollBarWidth(void); void ContentCreate(int Left, int Top, int Width, int Height); - void ContentSet(const char *Text, tColor ColorFg, tColor ColorBg); + void ContentSet(const char *Text, bool FixedFont, tColor ColorFg, tColor ColorBg); bool ContentIsShown(void); bool ContentScrollable(void); int ContentScrollTotal(void); diff --git a/displaymenu.c b/displaymenu.c index 1cecf368..fe0ab134 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -358,7 +358,7 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) { DecorBorderDraw(chLeft, chTop, chWidth, chHeight, Config.decorBorderMenuContentHeadSize, Config.decorBorderMenuContentHeadType, Config.decorBorderMenuContentHeadFg, Config.decorBorderMenuContentHeadBg); - ContentSet( Event->Description(), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg) ); + ContentSet( Event->Description(), false, Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg) ); if( ContentScrollable() ) DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal()); @@ -387,7 +387,7 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { DecorBorderDraw(chLeft, chTop, chWidth, chHeight, Config.decorBorderMenuContentHeadSize, Config.decorBorderMenuContentHeadType, Config.decorBorderMenuContentHeadFg, Config.decorBorderMenuContentHeadBg); - ContentSet( recInfo->Description(), Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg) ); + ContentSet( recInfo->Description(), false, Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg) ); if( ContentScrollable() ) DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal()); @@ -400,7 +400,7 @@ void cFlatDisplayMenu::SetText(const char *Text, bool FixedFont) { return; contentHeadPixmap->Fill(clrTransparent); - ContentSet( Text, Theme.Color(clrMenuTextFont), Theme.Color(clrMenuTextBg) ); + ContentSet( Text, false, Theme.Color(clrMenuTextFont), Theme.Color(clrMenuTextBg) ); if( ContentScrollable() ) SetScrollbar( ContentScrollTotal(), 0 ); |