summaryrefslogtreecommitdiff
path: root/skinlcars.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2012-06-04 08:59:10 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2012-06-04 08:59:10 +0200
commit857e29a43d83428d322e4ccadcd3f8a2925e1fa5 (patch)
tree0be6ca0a96b4782c4b10142234a419d1045dba36 /skinlcars.c
parente16e8b182f43bb219ec35036427692a32d213c2c (diff)
downloadvdr-857e29a43d83428d322e4ccadcd3f8a2925e1fa5.tar.gz
vdr-857e29a43d83428d322e4ccadcd3f8a2925e1fa5.tar.bz2
Now scaling down the Transfer Mode indicator bitmap in the LCARS skin in case it doesn't fit with the selected font size
Diffstat (limited to 'skinlcars.c')
-rw-r--r--skinlcars.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/skinlcars.c b/skinlcars.c
index 60978f76..49a499b0 100644
--- a/skinlcars.c
+++ b/skinlcars.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: skinlcars.c 2.4 2012/06/04 08:05:03 kls Exp $
+ * $Id: skinlcars.c 2.5 2012/06/04 08:53:57 kls Exp $
*/
// "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures,
@@ -1254,8 +1254,21 @@ void cSkinLCARSDisplayMenu::DrawLiveIndicator(void)
tColor ColorBg = Theme.Color(clrChannelFrameBg);
osd->DrawRectangle(xs12, y, xs12 + lineHeight / 2 - 1, y + lineHeight - 1, ColorBg);
osd->DrawEllipse (xs12 + lineHeight / 2, y, xs13 - 1, y + lineHeight - 1, ColorBg, 5);
- if (Transferring)
- osd->DrawBitmap((xs12 + xs13 - bmTransferMode.Width()) / 2, y + (lineHeight - bmTransferMode.Height()) / 2, bmTransferMode, Theme.Color(clrChannelFrameFg), ColorBg);
+ if (Transferring) {
+ int w = bmTransferMode.Width();
+ int h = bmTransferMode.Height();
+ int b = w * w + h * h; // the diagonal of the bitmap (squared)
+ int c = lineHeight * lineHeight; // the diameter of the circle (squared)
+ const cBitmap *bm = &bmTransferMode;
+ if (b > c) {
+ // the bitmap doesn't fit, so scale it down:
+ double f = sqrt(double(c) / (2 * b));
+ bm = bmTransferMode.Scaled(f, f);
+ }
+ osd->DrawBitmap((xs12 + xs13 - bm->Width()) / 2, y + (lineHeight - bm->Height()) / 2, *bm, Theme.Color(clrChannelFrameFg), ColorBg);
+ if (bm != &bmTransferMode)
+ delete bm;
+ }
}
lastLiveIndicatorY = y;
lastLiveIndicatorTransferring = Transferring;