summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--baserender.c47
-rw-r--r--baserender.h7
-rw-r--r--displayreplay.c4
3 files changed, 34 insertions, 24 deletions
diff --git a/baserender.c b/baserender.c
index ccbdd58..1905076 100644
--- a/baserender.c
+++ b/baserender.c
@@ -126,7 +126,7 @@ void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char
void cFlatBaseRender::MessageCreate(void) {
messageHeight = fontHeight;
- messagePixmap = osd->CreatePixmap(2, cRect(0, osdHeight - messageHeight - 50, osdWidth, messageHeight));
+ messagePixmap = osd->CreatePixmap(2, cRect(0, osdHeight - messageHeight - 150, osdWidth, messageHeight));
messagePixmap->Fill(clrTransparent);
}
@@ -293,8 +293,6 @@ void cFlatBaseRender::ProgressBarCreate(int Left, int Top, int Width, tColor Col
}
void cFlatBaseRender::ProgressBarDraw(int Current, int Total) {
- progressBarCurrent = Current;
- progressBarTotal = Total;
int top = progressBarHeight / 2 - 3;
double percentLeft = ((double)Current) / (double)Total;
@@ -310,39 +308,54 @@ int cFlatBaseRender::ProgressBarHeight(void) {
}
-void cFlatBaseRender::ProgressBarDrawMarks(const cMarks *Marks, tColor Color, tColor ColorCurrent) {
+void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks *Marks, tColor Color, tColor ColorCurrent) {
progressBarColorMark = Color;
progressBarColorMarkCurrent = ColorCurrent;
+ int posLast = 0;
+ int posCurrent = 0;
+
+ int top = progressBarHeight / 2 - 3;
+ progressBarPixmap->Fill( progressBarColorBg );
+ progressBarPixmap->DrawRectangle(cRect( 0, top + 2, progressBarWidth, 2), progressBarColorFg);
if( Marks ) {
bool Start = true;
for( const cMark *m = Marks->First(); m; m = Marks->Next(m) ) {
- int p1 = ProgressBarMarkPos( m->Position() );
- ProgressBarDrawMark(p1, Start, m->Position() == progressBarCurrent);
+ posCurrent = ProgressBarMarkPos( m->Position(), Total );
+ ProgressBarDrawMark(posCurrent, posLast, Start, m->Position() == Current);
+ posLast = posCurrent;
Start = !Start;
}
+ progressBarPixmap->DrawRectangle(cRect( posLast, top, progressBarWidth - posLast, 6), progressBarColorBarFg);
+ } else {
+ ProgressBarDraw(Current, Total);
}
}
-int cFlatBaseRender::ProgressBarMarkPos(int P) {
- return P * progressBarWidth / progressBarTotal;
+int cFlatBaseRender::ProgressBarMarkPos(int P, int Total) {
+ return P * progressBarWidth / Total;
}
-void cFlatBaseRender::ProgressBarDrawMark(int X, bool Start, bool Current)
+void cFlatBaseRender::ProgressBarDrawMark(int X1, int X0, bool Start, bool Current)
{
- if( Start )
+ int top = progressBarHeight / 2 - 3;
+
+ if( Start ) {
if( Current )
- progressBarPixmap->DrawRectangle(cRect( X-5, 0, 10, 3), progressBarColorMarkCurrent);
+ progressBarPixmap->DrawRectangle(cRect( X1-5, 0, 10, 3), progressBarColorMarkCurrent);
else
- progressBarPixmap->DrawRectangle(cRect( X-3, 0, 6, 3), progressBarColorMark);
- else
+ progressBarPixmap->DrawRectangle(cRect( X1-3, 0, 6, 3), progressBarColorMark);
+ } else {
if( Current )
- progressBarPixmap->DrawRectangle(cRect( X-5, progressBarHeight - 3, 10, 3), progressBarColorMarkCurrent);
+ progressBarPixmap->DrawRectangle(cRect( X1-5, progressBarHeight - 3, 10, 3), progressBarColorMarkCurrent);
else
- progressBarPixmap->DrawRectangle(cRect( X-3, progressBarHeight - 3, 6, 3), progressBarColorMark);
+ progressBarPixmap->DrawRectangle(cRect( X1-3, progressBarHeight - 3, 6, 3), progressBarColorMark);
+
+ progressBarPixmap->DrawRectangle(cRect( X0, top, X1 - X0, 6), progressBarColorBarFg);
+ }
if( Current )
- progressBarPixmap->DrawRectangle(cRect( X-1, 0, 2, progressBarHeight), progressBarColorMarkCurrent);
+ progressBarPixmap->DrawRectangle(cRect( X1-1, 0, 2, progressBarHeight), progressBarColorMarkCurrent);
else
- progressBarPixmap->DrawRectangle(cRect( X-1, 0, 2, progressBarHeight), progressBarColorMark);
+ progressBarPixmap->DrawRectangle(cRect( X1-1, 0, 2, progressBarHeight), progressBarColorMark);
}
diff --git a/baserender.h b/baserender.h
index 0a712c1..fe6a9c4 100644
--- a/baserender.h
+++ b/baserender.h
@@ -29,7 +29,6 @@ class cFlatBaseRender
// Progressbar
cPixmap *progressBarPixmap;
int progressBarHeight, progressBarTop, progressBarWidth;
- int progressBarCurrent, progressBarTotal;
tColor progressBarColorFg, progressBarColorBarFg, progressBarColorBg;
tColor progressBarColorMark, progressBarColorMarkCurrent;
@@ -53,8 +52,8 @@ class cFlatBaseRender
void contentDraw(void);
double ScrollbarSize(void);
- void ProgressBarDrawMark(int X, bool Start, bool Current);
- int ProgressBarMarkPos(int P);
+ void ProgressBarDrawMark(int X1, int X0, bool Start, bool Current);
+ int ProgressBarMarkPos(int P, int Total);
public:
cImageLoader imgLoader;
@@ -79,7 +78,7 @@ class cFlatBaseRender
void ProgressBarCreate(int Left, int Top, int Width, tColor ColorFg, tColor ColorBarFg, tColor ColorBg);
void ProgressBarDraw(int Current, int Total);
int ProgressBarHeight(void);
- void ProgressBarDrawMarks(const cMarks *Marks, tColor Color, tColor ColorCurrent);
+ void ProgressBarDrawMarks(int Current, int Total, const cMarks *Marks, tColor Color, tColor ColorCurrent);
void ContentCreate(int Left, int Top, int Width, int Height);
void ContentSet(const char *Text, tColor ColorFg, tColor ColorBg);
diff --git a/displayreplay.c b/displayreplay.c
index 9343f3b..363066a 100644
--- a/displayreplay.c
+++ b/displayreplay.c
@@ -97,9 +97,7 @@ void cFlatDisplayReplay::SetMode(bool Play, bool Forward, int Speed) {
}
void cFlatDisplayReplay::SetProgress(int Current, int Total) {
- ProgressBarDraw(Current, Total);
- if( Total > 0 )
- ProgressBarDrawMarks(marks, Theme.Color(clrReplayMarkFg), Theme.Color(clrReplayMarkCurrentFg));
+ ProgressBarDrawMarks(Current, Total, marks, Theme.Color(clrReplayMarkFg), Theme.Color(clrReplayMarkCurrentFg));
}
void cFlatDisplayReplay::SetCurrent(const char *Current) {