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

The scrollbar handle now always has a height that is at least the width of the scrollbar

This commit is contained in:
Klaus Schmidinger 2008-02-23 10:50:28 +01:00
parent 3a70484121
commit 1b1267674f
5 changed files with 18 additions and 13 deletions

View File

@ -5644,7 +5644,7 @@ Video Disk Recorder Revision History
should be used. should be used.
- Fixed calculating the scrollbar sizes in the skins. - Fixed calculating the scrollbar sizes in the skins.
2008-02-21: Version 1.5.16 2008-02-23: Version 1.5.16
- Fixed setting the current subtitle track in Transfer-Mode (reported by Petri Helin, - Fixed setting the current subtitle track in Transfer-Mode (reported by Petri Helin,
thanks to Reinhard Nissl for pointing out that cDevice::Transferring() doesn't thanks to Reinhard Nissl for pointing out that cDevice::Transferring() doesn't
@ -5655,4 +5655,5 @@ Video Disk Recorder Revision History
- Updated the Italian OSD texts (thanks to Diego Pierotto). - Updated the Italian OSD texts (thanks to Diego Pierotto).
- Fixed the format in cRemote::Put() to use "%016llX" instead of "%016LX" (thanks - Fixed the format in cRemote::Put() to use "%016llX" instead of "%016LX" (thanks
to Ludwig Nussel for pointing this out). to Ludwig Nussel for pointing this out).
- 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.

View File

@ -71,6 +71,7 @@ VDR Plugin 'skincurses' Revision History
- Using cString::sprintf() instead of asprintf(). - Using cString::sprintf() instead of asprintf().
- Implemented cSkinCursesDisplayMenu::SetScrollbar(). - 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.

View File

@ -3,7 +3,7 @@
* *
* See the README file for copyright information and how to reach the author. * 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> #include <ncurses.h>
@ -299,8 +299,9 @@ void cSkinCursesDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int
int yb = yt + Height; int yb = yt + Height;
int st = yt; int st = yt;
int sb = yb; int sb = yb;
int tt = st + (sb - st) * double(Offset) / Total + 0.5; int th = max(int((sb - st) * double(Shown) / Total + 0.5), 1);
int tb = tt + (sb - st) * double(Shown) / Total + 0.5; int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th);
int tb = min(tt + th, sb);
int xl = ScOsdWidth - 1; int xl = ScOsdWidth - 1;
osd->DrawRectangle(xl, st, xl, sb - 1, clrWhite); osd->DrawRectangle(xl, st, xl, sb - 1, clrWhite);
osd->DrawRectangle(xl, tt, xl, tb - 1, clrCyan); 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 * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: skinclassic.c 1.26 2008/02/22 16:56:29 kls Exp $ * $Id: skinclassic.c 1.27 2008/02/23 10:31:58 kls Exp $
*/ */
#include "skinclassic.h" #include "skinclassic.h"
@ -236,8 +236,9 @@ void cSkinClassicDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, in
int yb = yt + Height; int yb = yt + Height;
int st = yt; int st = yt;
int sb = yb; int sb = yb;
int tt = st + (sb - st) * double(Offset) / Total + 0.5; int th = max(int((sb - st) * double(Shown) / Total + 0.5), ScrollWidth);
int tb = tt + (sb - st) * double(Shown) / Total + 0.5; int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th);
int tb = min(tt + th, sb);
int xl = x3 - ScrollWidth; int xl = x3 - ScrollWidth;
osd->DrawRectangle(xl, st, x3 - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal)); osd->DrawRectangle(xl, st, x3 - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal));
osd->DrawRectangle(xl, tt, x3 - 1, tb - 1, Theme.Color(clrMenuScrollbarShown)); 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 * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * how to reach the author.
* *
* $Id: skinsttng.c 1.27 2008/02/22 16:56:30 kls Exp $ * $Id: skinsttng.c 1.28 2008/02/23 10:23:44 kls Exp $
*/ */
// Star Trek: The Next Generation® is a registered trademark of Paramount Pictures // Star Trek: The Next Generation® is a registered trademark of Paramount Pictures
@ -445,8 +445,9 @@ void cSkinSTTNGDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int
int yb = yt + Height; int yb = yt + Height;
int st = yt + h + Gap; int st = yt + h + Gap;
int sb = yb - h - Gap; int sb = yb - h - Gap;
int tt = st + (sb - st) * double(Offset) / Total + 0.5; int th = max(int((sb - st) * double(Shown) / Total + 0.5), ScrollWidth);
int tb = tt + (sb - st) * double(Shown) / Total + 0.5; int tt = min(int(st + (sb - st) * double(Offset) / Total + 0.5), sb - th);
int tb = min(tt + th, sb);
osd->DrawRectangle(x5, st, x5 + ScrollWidth - 1, sb - 1, Theme.Color(clrMenuScrollbarTotal)); 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, tt, x5 + ScrollWidth - 1, tb - 1, Theme.Color(clrMenuScrollbarShown));
osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor); osd->DrawRectangle(x5, yt, x6 - 1, yt + h - 1, frameColor);