diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2008-02-22 17:02:31 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2008-02-22 17:02:31 +0100 |
commit | 3a704841210fa2b939e0158e29e79333da5817e7 (patch) | |
tree | 190c4697bf3a09ce3b8aa3e6555bbd8f87ce6452 /PLUGINS | |
parent | 8bf512690ae3c1d367b79dc79674115be1e29571 (diff) | |
download | vdr-3a704841210fa2b939e0158e29e79333da5817e7.tar.gz vdr-3a704841210fa2b939e0158e29e79333da5817e7.tar.bz2 |
Revised the fix of calculating the scrollbar height in the skins
Diffstat (limited to 'PLUGINS')
-rw-r--r-- | PLUGINS/src/skincurses/HISTORY | 4 | ||||
-rw-r--r-- | PLUGINS/src/skincurses/skincurses.c | 14 |
2 files changed, 11 insertions, 7 deletions
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); } } |