diff options
author | louis <louis.braun@gmx.de> | 2013-05-04 17:18:05 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-05-04 17:18:05 +0200 |
commit | 993bdf2ed543d832eebb1de158134223254dc8ee (patch) | |
tree | 81b8b7b98ff5ee3b4e31560cd768ed118e2d8af3 /displayvolume.c | |
parent | 1bfdd7c81c641cc0e782b7bf360497b060a1d39b (diff) | |
download | skin-nopacity-993bdf2ed543d832eebb1de158134223254dc8ee.tar.gz skin-nopacity-993bdf2ed543d832eebb1de158134223254dc8ee.tar.bz2 |
Implemented workaround for VDR DrawEllipse bug
Diffstat (limited to 'displayvolume.c')
-rw-r--r-- | displayvolume.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/displayvolume.c b/displayvolume.c index fcb8e25..9570e1a 100644 --- a/displayvolume.c +++ b/displayvolume.c @@ -21,12 +21,13 @@ cNopacityDisplayVolume::cNopacityDisplayVolume(void) { DrawBlendedBackground(pixmapBackgroundTop, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), true); DrawBlendedBackground(pixmapBackgroundBottom, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), false); - - pixmapBackgroundTop->DrawEllipse(cRect(0, 0, height/4, height/4), clrTransparent, -2); - pixmapBackgroundTop->DrawEllipse(cRect(width - height/4, 0, height/4, height/4), clrTransparent, -1); - pixmapBackgroundBottom->DrawEllipse(cRect(0, height/4, height/4, height/4), clrTransparent, -3); - pixmapBackgroundBottom->DrawEllipse(cRect(width - height/4, height/4, height/4, height/4), clrTransparent, -4); - + int cornerSize = height/4; + if (cornerSize > 2) { + pixmapBackgroundTop->DrawEllipse(cRect(0, 0, cornerSize, cornerSize), clrTransparent, -2); + pixmapBackgroundTop->DrawEllipse(cRect(width - cornerSize, 0, cornerSize, cornerSize), clrTransparent, -1); + pixmapBackgroundBottom->DrawEllipse(cRect(0, cornerSize, cornerSize, cornerSize), clrTransparent, -3); + pixmapBackgroundBottom->DrawEllipse(cRect(width - cornerSize, cornerSize, cornerSize, cornerSize), clrTransparent, -4); + } labelHeight = height/3; pixmapLabel = osd->CreatePixmap(2, cRect(0, 5, width, labelHeight)); progressBarWidth = 0.9 * width; @@ -69,6 +70,8 @@ void cNopacityDisplayVolume::SetVolume(int Current, int Total, bool Mute) { void cNopacityDisplayVolume::DrawProgressBar(int Current, int Total) { pixmapProgressBar->Fill(clrTransparent); + if (progressBarHeight < 5) + return; double percent = ((double)Current) / (double)Total; int barWidth = progressBarWidth - progressBarHeight; if ((Current > 0) || (Total > 0)) { |