1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Revised the fix of calculating the scrollbar height in the skins

This commit is contained in:
Klaus Schmidinger 2008-02-22 17:02:31 +01:00
parent 8bf512690a
commit 3a70484121
5 changed files with 24 additions and 19 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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);
}
}

View File

@ -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));
}
}

View File

@ -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);