summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2008-02-22 17:02:31 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2008-02-22 17:02:31 +0100
commit3a704841210fa2b939e0158e29e79333da5817e7 (patch)
tree190c4697bf3a09ce3b8aa3e6555bbd8f87ce6452
parent8bf512690ae3c1d367b79dc79674115be1e29571 (diff)
downloadvdr-3a704841210fa2b939e0158e29e79333da5817e7.tar.gz
vdr-3a704841210fa2b939e0158e29e79333da5817e7.tar.bz2
Revised the fix of calculating the scrollbar height in the skins
-rw-r--r--HISTORY1
-rw-r--r--PLUGINS/src/skincurses/HISTORY4
-rw-r--r--PLUGINS/src/skincurses/skincurses.c14
-rw-r--r--skinclassic.c12
-rw-r--r--skinsttng.c12
5 files changed, 24 insertions, 19 deletions
diff --git a/HISTORY b/HISTORY
index e8f2c4dc..3b6d78bc 100644
--- a/HISTORY
+++ b/HISTORY
@@ -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);