summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflat@schirrmacher.eu>2013-08-20 20:03:52 (GMT)
committerMartin Schirrmacher <vdr.skinflat@schirrmacher.eu>2013-08-20 20:03:52 (GMT)
commit57fe4a2bf12adc4ea461569551ecac935dbf3aae (patch)
treecb61a4dc28aebe6830c7740bd122d312ae96e9f6
parent18f84694f84c8e782fce274477dfefbd090b0345 (diff)
downloadskin-flat-57fe4a2bf12adc4ea461569551ecac935dbf3aae.tar.gz
skin-flat-57fe4a2bf12adc4ea461569551ecac935dbf3aae.tar.bz2
menu item channel
-rw-r--r--baserender.c14
-rw-r--r--baserender.h1
-rw-r--r--displaymenu.c11
-rw-r--r--flat.h9
4 files changed, 35 insertions, 0 deletions
diff --git a/baserender.c b/baserender.c
index d68ab3c..6bca3ba 100644
--- a/baserender.c
+++ b/baserender.c
@@ -320,6 +320,20 @@ void cFlatBaseRender::contentDraw(void) {
}
}
+void cFlatBaseRender::ProgressBarDrawInline(cPixmap *Pixmap, int Left, int Top, int Width, int Height, int Current, int Total, tColor ColorFg, tColor ColorBarFg, tColor ColorBg) {
+ int Middle = Top + Height/2;
+ double percentLeft = ((double)Current) / (double)Total;
+
+ // background
+ Pixmap->DrawRectangle(cRect( Left, Top, Width, Height), ColorBg);
+
+ // small line
+ Pixmap->DrawRectangle(cRect( Left, Middle-1, Width, 2), ColorFg);
+
+ if (Current > 0)
+ Pixmap->DrawRectangle(cRect( Left, Middle - 4, (Width * percentLeft), 8), ColorBarFg);
+}
+
void cFlatBaseRender::ProgressBarCreate(int Left, int Top, int Width, tColor ColorFg, tColor ColorBarFg, tColor ColorBg) {
progressBarTop = Top;
progressBarWidth = Width;
diff --git a/baserender.h b/baserender.h
index 5bd55ee..c0648ff 100644
--- a/baserender.h
+++ b/baserender.h
@@ -81,6 +81,7 @@ class cFlatBaseRender
void ProgressBarDraw(int Current, int Total);
int ProgressBarHeight(void);
void ProgressBarDrawMarks(int Current, int Total, const cMarks *Marks, tColor Color, tColor ColorCurrent);
+ void ProgressBarDrawInline(cPixmap *Pixmap, int Left, int Top, int Width, int Height, int Current, int Total, tColor ColorFg, tColor ColorBarFg, tColor ColorBg);
void ContentCreate(int Left, int Top, int Width, int Height);
void ContentSet(const char *Text, tColor ColorFg, tColor ColorBg);
diff --git a/displaymenu.c b/displaymenu.c
index cd2e40a..570095d 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -196,6 +196,17 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C
int w = (menuWidth / 10 * 3) - marginItem;
menuPixmap->DrawText(cPoint(marginItem + xt, y), s2, ColorFg, ColorBg, font, w);
}
+
+ menuPixmap->DrawRectangle(cRect( (menuWidth/10*3) + marginItem, y, marginItem, fontHeight), ColorBg);
+
+ if( Current )
+ ProgressBarDrawInline(menuPixmap, (menuWidth/10*3) + marginItem*2, y, menuWidth/10 - marginItem, fontHeight,
+ progress, 100, Theme.Color(clrMenuItemChanCurProgressFg), Theme.Color(clrMenuItemChanCurProgressBarFg),
+ Theme.Color(clrMenuItemChanCurProgressBg));
+ else
+ ProgressBarDrawInline(menuPixmap, (menuWidth/10*3) + marginItem*2, y, menuWidth/10 - marginItem, fontHeight,
+ progress, 100, Theme.Color(clrMenuItemChanProgressFg), Theme.Color(clrMenuItemChanProgressBarFg),
+ Theme.Color(clrMenuItemChanProgressBg));
/*
int progressTop = menuTop + y + (fontHeight / 2) - ProgressBarHeight() / 2;
ProgressBarCreate((menuWidth / 10 * 3) + marginItem, progressTop, menuWidth / 10,
diff --git a/flat.h b/flat.h
index 9798db2..1a14adf 100644
--- a/flat.h
+++ b/flat.h
@@ -75,6 +75,15 @@ THEME_CLR(Theme, clrMenuRecFontInfo, 0xFFEEEEEE);
THEME_CLR(Theme, clrMenuTextBg, 0xB0101010);
THEME_CLR(Theme, clrMenuTextFont, 0xFFEEEEEE);
+// Menu Items
+THEME_CLR(Theme, clrMenuItemChanProgressFg, 0xFF3090B0);
+THEME_CLR(Theme, clrMenuItemChanProgressBarFg, 0xFF3090B0);
+THEME_CLR(Theme, clrMenuItemChanProgressBg, 0xB0101010);
+
+THEME_CLR(Theme, clrMenuItemChanCurProgressFg, 0xFFEEEEEE);
+THEME_CLR(Theme, clrMenuItemChanCurProgressBarFg, 0xFFEEEEEE);
+THEME_CLR(Theme, clrMenuItemChanCurProgressBg, 0xB03090B0);
+
// Replay
THEME_CLR(Theme, clrReplayBg, 0xB0101010);
THEME_CLR(Theme, clrReplayFont, 0xFFEEEEEE);