diff options
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | PLUGINS/src/skincurses/HISTORY | 4 | ||||
-rw-r--r-- | PLUGINS/src/skincurses/skincurses.c | 14 | ||||
-rw-r--r-- | skinclassic.c | 12 | ||||
-rw-r--r-- | skinsttng.c | 12 |
5 files changed, 24 insertions, 19 deletions
@@ -5655,3 +5655,4 @@ Video Disk Recorder Revision History - Updated the Italian OSD texts (thanks to Diego Pierotto). - Fixed the format in cRemote::Put() to use "%016llX" instead of "%016LX" (thanks to Ludwig Nussel for pointing this out). +- Revised the fix of calculating the scrollbar height in the skins. diff --git a/PLUGINS/src/skincurses/HISTORY b/PLUGINS/src/skincurses/HISTORY index 45b79bb1..117286b6 100644 --- a/PLUGINS/src/skincurses/HISTORY +++ b/PLUGINS/src/skincurses/HISTORY @@ -70,3 +70,7 @@ VDR Plugin 'skincurses' Revision History - Using cString::sprintf() instead of asprintf(). - Implemented cSkinCursesDisplayMenu::SetScrollbar(). + +2008-02-22: Version 0.1.6 + +- Revised the fix of calculating the scrollbar height in the skins. diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c index 2f0bea92..833eb6aa 100644 --- a/PLUGINS/src/skincurses/skincurses.c +++ b/PLUGINS/src/skincurses/skincurses.c @@ -3,7 +3,7 @@ * * See the README file for copyright information and how to reach the author. * - * $Id: skincurses.c 1.20 2008/02/17 14:28:19 kls Exp $ + * $Id: skincurses.c 1.21 2008/02/22 17:02:31 kls Exp $ */ #include <ncurses.h> @@ -11,7 +11,7 @@ #include <vdr/plugin.h> #include <vdr/skins.h> -static const char *VERSION = "0.1.5"; +static const char *VERSION = "0.1.6"; static const char *DESCRIPTION = trNOOP("A text only skin"); static const char *MAINMENUENTRY = NULL; @@ -296,14 +296,14 @@ void cSkinCursesDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int { if (Total > 0 && Total > Shown) { int yt = Top; - int yb = yt + Height - 1; + int yb = yt + Height; int st = yt; int sb = yb; - int tt = st + (sb - st + 1) * Offset / Total; - int tb = tt + (sb - st + 1) * Shown / Total; + int tt = st + (sb - st) * double(Offset) / Total + 0.5; + int tb = tt + (sb - st) * double(Shown) / Total + 0.5; int xl = ScOsdWidth - 1; - osd->DrawRectangle(xl, st, xl, sb, clrWhite); - osd->DrawRectangle(xl, tt, xl, tb, clrCyan); + osd->DrawRectangle(xl, st, xl, sb - 1, clrWhite); + osd->DrawRectangle(xl, tt, xl, tb - 1, clrCyan); } } diff --git a/skinclassic.c b/skinclassic.c index ad26cfdc..30d7fc65 100644 --- a/skinclassic.c +++ b/skinclassic.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinclassic.c 1.25 2008/02/17 14:23:36 kls Exp $ + * $Id: skinclassic.c 1.26 2008/02/22 16:56:29 kls Exp $ */ #include "skinclassic.h" @@ -233,14 +233,14 @@ void cSkinClassicDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, in { if (Total > 0 && Total > Shown) { int yt = Top; - int yb = yt + Height - 1; + int yb = yt + Height; int st = yt; int sb = yb; - int tt = st + (sb - st + 1) * Offset / Total; - int tb = tt + (sb - st + 1) * Shown / Total; + int tt = st + (sb - st) * double(Offset) / Total + 0.5; + int tb = tt + (sb - st) * double(Shown) / Total + 0.5; int xl = x3 - ScrollWidth; - osd->DrawRectangle(xl, st, x3 - 1, sb, Theme.Color(clrMenuScrollbarTotal)); - osd->DrawRectangle(xl, tt, x3 - 1, tb, Theme.Color(clrMenuScrollbarShown)); + osd->DrawRectangle(xl, st, x3 - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal)); + osd->DrawRectangle(xl, tt, x3 - 1, tb - 1, Theme.Color(clrMenuScrollbarShown)); } } diff --git a/skinsttng.c b/skinsttng.c index 0aa22b72..95f4ebe3 100644 --- a/skinsttng.c +++ b/skinsttng.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinsttng.c 1.26 2008/02/17 14:23:45 kls Exp $ + * $Id: skinsttng.c 1.27 2008/02/22 16:56:30 kls Exp $ */ // Star Trek: The Next Generation® is a registered trademark of Paramount Pictures @@ -442,13 +442,13 @@ void cSkinSTTNGDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int if (Total > 0 && Total > Shown) { int h = lineHeight; int yt = Top; - int yb = yt + Height - 1; + int yb = yt + Height; int st = yt + h + Gap; int sb = yb - h - Gap; - int tt = st + (sb - st + 1) * Offset / Total; - int tb = tt + (sb - st + 1) * Shown / Total; - osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb, Theme.Color(clrMenuScrollbarTotal)); - osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb, Theme.Color(clrMenuScrollbarShown)); + int tt = st + (sb - st) * double(Offset) / Total + 0.5; + int tb = tt + (sb - st) * double(Shown) / Total + 0.5; + osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal)); + osd->DrawRectangle(x5, tt, x5 + ScrollWidth - 1, tb - 1, Theme.Color(clrMenuScrollbarShown)); osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor); osd->DrawEllipse (x6, yt, x7 - 1, yt + h - 1, frameColor, 5); osd->DrawRectangle(x5, yb - h, x6 - 1, yb - 1, frameColor); |