diff options
author | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-03-05 18:46:32 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger (at) gmx (dot) de> | 2008-03-05 18:46:32 +0100 |
commit | 0e3a3840e8daf19e2e8583cc2850a7b88bbf167a (patch) | |
tree | 226d67a197c6bac770a7ef91a509cecf6752290e /patches | |
parent | d39a1b1fdec0e05c3b6b31a3c2db3d0b3b105174 (diff) | |
download | vdr-plugin-epgsearch-0e3a3840e8daf19e2e8583cc2850a7b88bbf167a.tar.gz vdr-plugin-epgsearch-0e3a3840e8daf19e2e8583cc2850a7b88bbf167a.tar.bz2 |
update for progressbar patch
Diffstat (limited to 'patches')
-rw-r--r-- | patches/vdr-1.5.17-progressbar-support-0.0.1.diff | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/patches/vdr-1.5.17-progressbar-support-0.0.1.diff b/patches/vdr-1.5.17-progressbar-support-0.0.1.diff new file mode 100644 index 0000000..98b887d --- /dev/null +++ b/patches/vdr-1.5.17-progressbar-support-0.0.1.diff @@ -0,0 +1,106 @@ +diff -Nru vdr-1.5.17-orig/skinclassic.c vdr-1.5.17-progressbar/skinclassic.c +--- vdr-1.5.17-orig/skinclassic.c ++++ vdr-1.5.17-progressbar/skinclassic.c +@@ -314,8 +314,47 @@ + for (int i = 0; i < MaxTabs; i++) { + const char *s = GetTabbedText(Text, i); + if (s) { +- int xt = x0 + Tab(i); +- osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x2 - xt); ++ bool isprogressbar = false; ++ int now = 0, total = 0; ++ // check if progress bar: "[||||||| ]" ++ if ((strlen(s) > 5 && s[0] == '[' && s[strlen(s) - 1] == ']')) { ++ const char *p = s + 1; ++ // update status ++ isprogressbar = true; ++ for (; *p != ']'; ++p) { ++ // check if progressbar characters ++ if (*p == ' ' || *p == '|') { ++ // update counters ++ ++total; ++ if (*p == '|') ++ ++now; ++ } ++ else { ++ // wrong character detected; not a progressbar ++ isprogressbar = false; ++ break; ++ } ++ } ++ } ++ int xt = x0 + Tab(i); ++ if (isprogressbar) { ++ // define x coordinates of progressbar ++ int px0 = xt; ++ int px1 = (Tab(i + 1)?Tab(i+1):x1) - 5; ++ int px = px0 + max((int)((float) now * (float) (px1 - px0) / (float) total), 1); ++ // define y coordinates of progressbar ++ int py0 = y + 4; ++ int py1 = y + lineHeight - 4; ++ // draw background ++ osd->DrawRectangle(px0, y, (Tab(i + 1)?Tab(i+1):x1) - 1, y + lineHeight - 1, ColorBg); ++ // draw progressbar ++ osd->DrawRectangle(px0, py0, px, py1, ColorFg); ++ osd->DrawRectangle(px + 1, py0, px1, py0 + 1, ColorFg); ++ osd->DrawRectangle(px + 1, py1 - 1, px1, py1, ColorFg); ++ osd->DrawRectangle(px1 - 1, py0, px1, py1, ColorFg); ++ } ++ else ++ osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x2 - xt); + } + if (!Tab(i + 1)) + break; +diff -Nru vdr-1.5.17-orig/skinsttng.c vdr-1.5.17-progressbar/skinsttng.c +--- vdr-1.5.17-orig/skinsttng.c ++++ vdr-1.5.17-progressbar/skinsttng.c +@@ -558,8 +558,47 @@ + for (int i = 0; i < MaxTabs; i++) { + const char *s = GetTabbedText(Text, i); + if (s) { +- int xt = x3 + 5 + Tab(i); +- osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x4 - xt); ++ bool isprogressbar = false; ++ int now = 0, total = 0; ++ // check if progress bar: "[||||||| ]" ++ if ((strlen(s) > 5 && s[0] == '[' && s[strlen(s) - 1] == ']')) { ++ const char *p = s + 1; ++ // update status ++ isprogressbar = true; ++ for (; *p != ']'; ++p) { ++ // check if progressbar characters ++ if (*p == ' ' || *p == '|') { ++ // update counters ++ ++total; ++ if (*p == '|') ++ ++now; ++ } ++ else { ++ // wrong character detected; not a progressbar ++ isprogressbar = false; ++ break; ++ } ++ } ++ } ++ int xt = x3 + 5 + Tab(i); ++ if (isprogressbar) { ++ // define x coordinates of progressbar ++ int px0 = xt; ++ int px1 = x3 + (Tab(i + 1)?Tab(i + 1):x4-x3-5) - 1; ++ int px = px0 + max((int)((float) now * (float) (px1 - px0) / (float) total), 1); ++ // define y coordinates of progressbar ++ int py0 = y + 4; ++ int py1 = y + lineHeight - 4; ++ // draw background ++ osd->DrawRectangle(px0, y, (Tab(i + 1)?Tab(i + 1):x4-x3-5) - 1, y + lineHeight - 1, ColorBg); ++ // draw progressbar ++ osd->DrawRectangle(px0, py0, px, py1, ColorFg); ++ osd->DrawRectangle(px + 1, py0, px1, py0 + 1, ColorFg); ++ osd->DrawRectangle(px + 1, py1 - 1, px1, py1, ColorFg); ++ osd->DrawRectangle(px1 - 1, py0, px1, py1, ColorFg); ++ } ++ else ++ osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x4 - xt); + } + if (!Tab(i + 1)) + break; |