diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2008-02-23 10:50:28 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2008-02-23 10:50:28 +0100 |
commit | 1b1267674f2b1d632097e60f1284f6ba97b10e00 (patch) | |
tree | d9df8a751ede3fa32a57bbffbb22e9fbc535fe49 /PLUGINS/src/skincurses | |
parent | 3a704841210fa2b939e0158e29e79333da5817e7 (diff) | |
download | vdr-1b1267674f2b1d632097e60f1284f6ba97b10e00.tar.gz vdr-1b1267674f2b1d632097e60f1284f6ba97b10e00.tar.bz2 |
The scrollbar handle now always has a height that is at least the width of the scrollbar
Diffstat (limited to 'PLUGINS/src/skincurses')
-rw-r--r-- | PLUGINS/src/skincurses/HISTORY | 5 | ||||
-rw-r--r-- | PLUGINS/src/skincurses/skincurses.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/PLUGINS/src/skincurses/HISTORY b/PLUGINS/src/skincurses/HISTORY index 117286b6..6088c8b6 100644 --- a/PLUGINS/src/skincurses/HISTORY +++ b/PLUGINS/src/skincurses/HISTORY @@ -71,6 +71,7 @@ VDR Plugin 'skincurses' Revision History - Using cString::sprintf() instead of asprintf(). - Implemented cSkinCursesDisplayMenu::SetScrollbar(). -2008-02-22: Version 0.1.6 +2008-02-23: Version 0.1.6 -- Revised the fix of calculating the scrollbar height in the skins. +- Revised the fix of calculating the scrollbar height in the skins. The scrollbar + handle now always has a height that is at least the width of the scrollbar. diff --git a/PLUGINS/src/skincurses/skincurses.c b/PLUGINS/src/skincurses/skincurses.c index 833eb6aa..ed30a5e7 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.21 2008/02/22 17:02:31 kls Exp $ + * $Id: skincurses.c 1.22 2008/02/23 10:38:04 kls Exp $ */ #include <ncurses.h> @@ -299,8 +299,9 @@ void cSkinCursesDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int int yb = yt + Height; int st = yt; int sb = yb; - int tt = st + (sb - st) * double(Offset) / Total + 0.5; - int tb = tt + (sb - st) * double(Shown) / Total + 0.5; + int th = max(int((sb - st) * double(Shown) / Total + 0.5), 1); + int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th); + int tb = min(tt + th, sb); int xl = ScOsdWidth - 1; osd->DrawRectangle(xl, st, xl, sb - 1, clrWhite); osd->DrawRectangle(xl, tt, xl, tb - 1, clrCyan); |