diff options
author | louis <louis.braun@gmx.de> | 2013-05-08 18:31:01 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-05-08 18:31:01 +0200 |
commit | ec606cea46a25009182b03eb9bbd53bea362bdbd (patch) | |
tree | 4bf273553e9bb826dd57c566e97cabc47ec2f008 | |
parent | cdcbf602021a64393669a28fbd7de1c7ddd23fa1 (diff) | |
download | skin-nopacity-ec606cea46a25009182b03eb9bbd53bea362bdbd.tar.gz skin-nopacity-ec606cea46a25009182b03eb9bbd53bea362bdbd.tar.bz2 |
Introduced plain style without any blending effects
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | config.c | 4 | ||||
-rw-r--r-- | config.h | 3 | ||||
-rw-r--r-- | displaychannel.c | 59 | ||||
-rw-r--r-- | displaymenu.c | 19 | ||||
-rw-r--r-- | displaymenuview.c | 40 | ||||
-rw-r--r-- | displaymenuview.h | 2 | ||||
-rw-r--r-- | displaymessage.c | 10 | ||||
-rw-r--r-- | displayreplay.c | 25 | ||||
-rw-r--r-- | displaytracks.c | 18 | ||||
-rw-r--r-- | displayvolume.c | 10 | ||||
-rw-r--r-- | menuitem.c | 161 | ||||
-rw-r--r-- | menuitem.h | 9 | ||||
-rw-r--r-- | nopacity.c | 8 | ||||
-rw-r--r-- | po/de_DE.po | 5 | ||||
-rw-r--r-- | po/it_IT.po | 5 | ||||
-rw-r--r-- | po/sk_SK.po | 5 | ||||
-rw-r--r-- | setup.c | 2 | ||||
-rw-r--r-- | textwindow.c | 5 | ||||
-rw-r--r-- | themes/nOpacity-darkblue.theme | 2 | ||||
-rw-r--r-- | themes/nOpacity-darkred.theme | 1 | ||||
-rw-r--r-- | themes/nOpacity-green.theme | 3 | ||||
-rw-r--r-- | timers.c | 24 |
23 files changed, 286 insertions, 136 deletions
@@ -209,3 +209,5 @@ Version 0.1.2 - Fixed a bug that slow motion trick speed during recording replay was not displayed - Added previous and next Channel Group in Channel Display +- Introduced "plain" style without any blending effects configurable by + dedicated theme color @@ -21,6 +21,7 @@ cNopacityConfig::cNopacityConfig() { logoExtension = "png"; logoBorder = 15; backgroundStyle = 0; + roundedCornersChannel = 1; displaySignalStrength = 1; displayPrevNextChannelGroup = 1; fontChannelHeaderSize = 0; @@ -162,6 +163,8 @@ cNopacityConfig::~cNopacityConfig() { } void cNopacityConfig::setDynamicValues() { +esyslog("nopacity: col blending %x, do Blending %x", Theme.Color(clrDoBlending), CLR_BLENDING_ON); + doBlending = (Theme.Color(clrDoBlending) == CLR_BLENDING_ON)?true:false; if (fontIndex == 0) { fontName = strdup(fontDefaultName); } else { @@ -300,6 +303,7 @@ bool cNopacityConfig::SetupParse(const char *Name, const char *Value) { else if (strcmp(Name, "logoHeight") == 0) logoHeight = atoi(Value); else if (strcmp(Name, "logoBorder") == 0) logoBorder = atoi(Value); else if (strcmp(Name, "backgroundStyle") == 0) backgroundStyle = atoi(Value); + else if (strcmp(Name, "roundedCornersChannel") == 0) roundedCornersChannel = atoi(Value); else if (strcmp(Name, "displaySignalStrength") == 0) displaySignalStrength = atoi(Value); else if (strcmp(Name, "displayPrevNextChannelGroup") == 0) displayPrevNextChannelGroup = atoi(Value); else if (strcmp(Name, "fontChannelHeaderSize") == 0) fontChannelHeaderSize = atoi(Value); @@ -24,6 +24,8 @@ class cNopacityConfig { cString epgImagePathDefault;
void setDynamicValues();
void loadRssFeeds(void);
+ //Theme Setting
+ bool doBlending;
//Common
int fontIndex;
const char *fontDefaultName;
@@ -44,6 +46,7 @@ class cNopacityConfig { int logoHeight;
int logoBorder;
int backgroundStyle;
+ int roundedCornersChannel;
int displaySignalStrength;
int displayPrevNextChannelGroup;
int fontChannelHeaderSize;
diff --git a/displaychannel.c b/displaychannel.c index de8ff1d..77c1488 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -187,43 +187,52 @@ void cNopacityDisplayChannel::CreateFonts(void) { } void cNopacityDisplayChannel::DrawBackground(void){ - - DrawBlendedBackground(pixmapBackgroundTop, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), true); + if (config.doBlending) { + DrawBlendedBackground(pixmapBackgroundTop, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), true); + DrawBlendedBackground(pixmapBackgroundBottom, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), false); + } else { + pixmapBackgroundTop->Fill(Theme.Color(clrChannelBackground)); + pixmapBackgroundBottom->Fill(Theme.Color(clrChannelBackground)); + } if (withInfo) pixmapBackgroundMiddle->Fill(Theme.Color(clrChannelBackground)); - DrawBlendedBackground(pixmapBackgroundBottom, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), false); if ((config.backgroundStyle == bsFull) && withInfo) { pixmapLogoBackground->Fill(Theme.Color(clrChannelBackground)); - DrawBlendedBackground(pixmapLogoBackgroundTop, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), true); - DrawBlendedBackground(pixmapLogoBackgroundBottom, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), false); + if (config.doBlending) { + DrawBlendedBackground(pixmapLogoBackgroundTop, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), true); + DrawBlendedBackground(pixmapLogoBackgroundBottom, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), false); + } else { + pixmapLogoBackgroundTop->Fill(Theme.Color(clrChannelBackground)); + pixmapLogoBackgroundBottom->Fill(Theme.Color(clrChannelBackground)); + } } else { pixmapLogoBackgroundTop->Fill(clrTransparent); pixmapLogoBackground->Fill(clrTransparent); pixmapLogoBackgroundBottom->Fill(clrTransparent); } - - int cornerTopSize = channelInfoHeight/2; - int cornerBottomSize = streamInfoHeight/2; - if ((cornerTopSize > 2)&&(cornerBottomSize > 2)) { - if ((config.backgroundStyle == bsTrans) || ((config.logoPosition == lpNone))) { - pixmapBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2); - pixmapBackgroundTop->DrawEllipse(cRect(infoWidth - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1); - pixmapBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3); - pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4); - } else if ((config.backgroundStyle == bsFull) && (config.logoPosition == lpLeft)){ - pixmapLogoBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2); - pixmapBackgroundTop->DrawEllipse(cRect(infoWidth - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1); - pixmapLogoBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3); - pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4); - } else if ((config.backgroundStyle == bsFull) && (config.logoPosition == lpRight)){ - pixmapBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2); - pixmapLogoBackgroundTop->DrawEllipse(cRect(pixmapLogoBackgroundTop->ViewPort().Width() - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1); - pixmapBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3); - pixmapLogoBackgroundBottom->DrawEllipse(cRect(pixmapLogoBackgroundBottom->ViewPort().Width() - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4); + if (config.roundedCornersChannel) { + int cornerTopSize = channelInfoHeight/2; + int cornerBottomSize = streamInfoHeight/2; + if ((cornerTopSize > 2)&&(cornerBottomSize > 2)) { + if ((config.backgroundStyle == bsTrans) || ((config.logoPosition == lpNone))) { + pixmapBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2); + pixmapBackgroundTop->DrawEllipse(cRect(infoWidth - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1); + pixmapBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3); + pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4); + } else if ((config.backgroundStyle == bsFull) && (config.logoPosition == lpLeft)){ + pixmapLogoBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2); + pixmapBackgroundTop->DrawEllipse(cRect(infoWidth - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1); + pixmapLogoBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3); + pixmapBackgroundBottom->DrawEllipse(cRect(infoWidth - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4); + } else if ((config.backgroundStyle == bsFull) && (config.logoPosition == lpRight)){ + pixmapBackgroundTop->DrawEllipse(cRect(0, 0, cornerTopSize, cornerTopSize), clrTransparent, -2); + pixmapLogoBackgroundTop->DrawEllipse(cRect(pixmapLogoBackgroundTop->ViewPort().Width() - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1); + pixmapBackgroundBottom->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3); + pixmapLogoBackgroundBottom->DrawEllipse(cRect(pixmapLogoBackgroundBottom->ViewPort().Width() - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4); + } } } - pixmapChannelInfo->Fill(clrTransparent); pixmapDate->Fill(clrTransparent); pixmapLogo->Fill(clrTransparent); diff --git a/displaymenu.c b/displaymenu.c index e99da16..d62416e 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -59,11 +59,12 @@ cNopacityDisplayMenu::~cNopacityDisplayMenu() { delete detailView; } timers.Clear(); - for (int i=0; i<14; i++) - cOsdProvider::DropImage(handleBackgrounds[i]); - for (int i=0; i<4; i++) - cOsdProvider::DropImage(handleButtons[i]); - + if (config.doBlending) { + for (int i=0; i<14; i++) + cOsdProvider::DropImage(handleBackgrounds[i]); + for (int i=0; i<4; i++) + cOsdProvider::DropImage(handleButtons[i]); + } delete osd; cDevice::PrimaryDevice()->ScaleVideo(cRect::Null); menuActive = false; @@ -362,22 +363,22 @@ void cNopacityDisplayMenu::SetButtonPositions(void) { void cNopacityDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { if (Red) { - menuView->DrawButton(Red, handleButtons[0], Theme.Color(clrButtonRedBorder), positionButtons[0]); + menuView->DrawButton(Red, handleButtons[0], Theme.Color(clrButtonRed), Theme.Color(clrButtonRedBorder), positionButtons[0]); } else menuView->ClearButton(positionButtons[0]); if (Green) { - menuView->DrawButton(Green, handleButtons[1], Theme.Color(clrButtonGreenBorder), positionButtons[1]); + menuView->DrawButton(Green, handleButtons[1],Theme.Color(clrButtonGreen), Theme.Color(clrButtonGreenBorder), positionButtons[1]); } else menuView->ClearButton(positionButtons[1]); if (Yellow) { - menuView->DrawButton(Yellow, handleButtons[2], Theme.Color(clrButtonYellowBorder), positionButtons[2]); + menuView->DrawButton(Yellow, handleButtons[2], Theme.Color(clrButtonYellow), Theme.Color(clrButtonYellowBorder), positionButtons[2]); } else menuView->ClearButton(positionButtons[2]); if (Blue) { - menuView->DrawButton(Blue, handleButtons[3], Theme.Color(clrButtonBlueBorder), positionButtons[3]); + menuView->DrawButton(Blue, handleButtons[3], Theme.Color(clrButtonBlue), Theme.Color(clrButtonBlueBorder), positionButtons[3]); } else menuView->ClearButton(positionButtons[3]); } diff --git a/displaymenuview.c b/displaymenuview.c index 4dcb244..6fce559 100644 --- a/displaymenuview.c +++ b/displaymenuview.c @@ -399,6 +399,8 @@ const cFont *cNopacityDisplayMenuView::GetTextAreaFont(bool FixedFont) { } void cNopacityDisplayMenuView::CreateBackgroundImages(int *handleBackgrounds, int *handleButtons) { + if (!config.doBlending) + return; cImageLoader imgLoader; //Default Menus imgLoader.DrawBackground(Theme.Color(clrMenuItem), Theme.Color(clrMenuItemBlend), menuItemWidthDefault-2, menuItemHeightDefault-2); @@ -442,7 +444,7 @@ void cNopacityDisplayMenuView::CreateBackgroundImages(int *handleBackgrounds, in handleBackgrounds[12] = cOsdProvider::StoreImage(imgLoader.GetImage()); imgLoader.DrawBackground(Theme.Color(clrMenuItemHigh), Theme.Color(clrMenuItemHighBlend), itemSize.X()-2, itemSize.Y()-2); handleBackgrounds[13] = cOsdProvider::StoreImage(imgLoader.GetImage()); - + //Color Buttons imgLoader.DrawBackground(Theme.Color(clrMenuBack), Theme.Color(clrButtonRed), buttonWidth-4, buttonHeight-4); handleButtons[0] = cOsdProvider::StoreImage(imgLoader.GetImage()); imgLoader.DrawBackground(Theme.Color(clrMenuBack), Theme.Color(clrButtonGreen), buttonWidth-4, buttonHeight-4); @@ -454,10 +456,13 @@ void cNopacityDisplayMenuView::CreateBackgroundImages(int *handleBackgrounds, in } void cNopacityDisplayMenuView::DrawBorderDecoration() { - cImageLoader imgLoader; - bool mirrorHeader = (config.menuAdjustLeft) ? false : true; - imgLoader.DrawBackground(Theme.Color(clrMenuHeaderBlend), Theme.Color(clrMenuHeader), osdWidth, headerHeight, mirrorHeader); - pixmapHeader->DrawImage(cPoint(0,0), imgLoader.GetImage()); + if (config.doBlending) { + cImageLoader imgLoader; + bool mirrorHeader = (config.menuAdjustLeft) ? false : true; + imgLoader.DrawBackground(Theme.Color(clrMenuHeaderBlend), Theme.Color(clrMenuHeader), osdWidth, headerHeight, mirrorHeader); + pixmapHeader->DrawImage(cPoint(0,0), imgLoader.GetImage()); + } else + pixmapHeader->Fill(Theme.Color(clrMenuBack)); pixmapFooter->Fill(Theme.Color(clrMenuBack)); int borderWidth = 2; @@ -689,14 +694,17 @@ void cNopacityDisplayMenuView::ShowDiskUsage(bool show) { } } -void cNopacityDisplayMenuView::DrawButton(const char *text, int handleImage, tColor borderColor, int num) { +void cNopacityDisplayMenuView::DrawButton(const char *text, int handleImage, tColor buttonColor, tColor borderColor, int num) { if (num < 0) return; int top = 2*buttonsBorder; int left = num * buttonWidth + (2*num + 1) * buttonsBorder; - pixmapFooter->DrawRectangle(cRect(left, top, buttonWidth, buttonHeight), borderColor); - pixmapFooter->DrawImage(cPoint(left+2, top+2), handleImage); - + if (config.doBlending) { + pixmapFooter->DrawRectangle(cRect(left, top, buttonWidth, buttonHeight), borderColor); + pixmapFooter->DrawImage(cPoint(left+2, top+2), handleImage); + } else { + pixmapFooter->DrawRectangle(cRect(left, top, buttonWidth, buttonHeight), buttonColor); + } if (config.roundedCorners) { int radius = config.cornerRadius; if (radius > 2) { @@ -716,7 +724,8 @@ void cNopacityDisplayMenuView::DrawButton(const char *text, int handleImage, tCo int textWidth = fontButtons->Width(text); int textHeight = fontButtons->Height(); - pixmapFooter->DrawText(cPoint(left + (buttonWidth-textWidth)/2, top + (buttonHeight-textHeight)/2), text, Theme.Color(clrMenuFontButton), clrTransparent, fontButtons); + tColor clrFontBack = (config.doBlending)?(clrTransparent):buttonColor; + pixmapFooter->DrawText(cPoint(left + (buttonWidth-textWidth)/2, top + (buttonHeight-textHeight)/2), text, Theme.Color(clrMenuFontButton), clrFontBack, fontButtons); } void cNopacityDisplayMenuView::ClearButton(int num) { @@ -796,11 +805,14 @@ void cNopacityDisplayMenuView::DrawMessage(eMessageType Type, const char *Text) } pixmapStatus = osd->CreatePixmap(7, cRect(0.1*osdWidth, 0.8*osdHeight, messageWidth, messageHeight)); pixmapStatus->Fill(col); - cImageLoader imgLoader; - imgLoader.DrawBackground2(Theme.Color(clrMenuBack), col, messageWidth-2, messageHeight-2); - pixmapStatus->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + if (config.doBlending) { + cImageLoader imgLoader; + imgLoader.DrawBackground2(Theme.Color(clrMenuBack), col, messageWidth-2, messageHeight-2); + pixmapStatus->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + } int textWidth = fontMessage->Width(Text); - pixmapStatus->DrawText(cPoint((messageWidth - textWidth) / 2, (messageHeight - fontMessage->Height()) / 2), Text, Theme.Color(clrMenuFontMessages), clrTransparent, fontMessage); + tColor clrFontBack = (config.doBlending)?(clrTransparent):col; + pixmapStatus->DrawText(cPoint((messageWidth - textWidth) / 2, (messageHeight - fontMessage->Height()) / 2), Text, Theme.Color(clrMenuFontMessages), clrFontBack, fontMessage); } void cNopacityDisplayMenuView::ClearMessage(void) { diff --git a/displaymenuview.h b/displaymenuview.h index 51eb053..a9c10b5 100644 --- a/displaymenuview.h +++ b/displaymenuview.h @@ -109,7 +109,7 @@ class cNopacityDisplayMenuView { void DrawDate(bool initial); void DrawDiskUsage(void); void ShowDiskUsage(bool show); - void DrawButton(const char *text, int handleImage, tColor borderColor, int num); + void DrawButton(const char *text, int handleImage, tColor buttonColor, tColor borderColor, int num); void ClearButton(int num); int GetTimersInitHeight(void); int GetTimersMaxHeight(void); diff --git a/displaymessage.c b/displaymessage.c index 780d17e..cc831a3 100644 --- a/displaymessage.c +++ b/displaymessage.c @@ -46,11 +46,13 @@ void cNopacityDisplayMessage::SetMessage(eMessageType Type, const char *Text) { } pixmapBackground->Fill(clrBlack); pixmap->Fill(col); - cImageLoader imgLoader; - imgLoader.DrawBackground2(Theme.Color(clrMessageBlend), col, width-2, height-2); - pixmap->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + if (config.doBlending) { + cImageLoader imgLoader; + imgLoader.DrawBackground2(Theme.Color(clrMessageBlend), col, width-2, height-2); + pixmap->DrawImage(cPoint(1, 1), imgLoader.GetImage()); + } int textWidth = font->Width(Text); - pixmap->DrawText(cPoint((width - textWidth) / 2, (height - font->Height()) / 2), Text, Theme.Color(clrMessageFont), clrTransparent, font); + pixmap->DrawText(cPoint((width - textWidth) / 2, (height - font->Height()) / 2), Text, Theme.Color(clrMessageFont), (config.doBlending)?clrTransparent:col, font); if (config.messageFadeTime) Start(); } diff --git a/displayreplay.c b/displayreplay.c index ed2ea95..0f3c845 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -134,15 +134,22 @@ void cNopacityDisplayReplay::CreateFonts(void) { void cNopacityDisplayReplay::DrawBackground(void) { if (!modeOnly) { - DrawBlendedBackground(pixmapHeader, Theme.Color(clrReplayBackground), Theme.Color(clrReplayBackBlend), true); - DrawBlendedBackground(pixmapFooter, Theme.Color(clrReplayBackground), Theme.Color(clrReplayBackBlend), false); - int cornerTopSize = headerHeight/2; - int cornerBottomSize = footerHeight/2; - if ((cornerTopSize > 2)&&(cornerBottomSize > 2)) { - pixmapHeader->DrawEllipse(cRect(0,0, cornerTopSize, cornerTopSize), clrTransparent, -2); - pixmapHeader->DrawEllipse(cRect(width - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1); - pixmapFooter->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3); - pixmapFooter->DrawEllipse(cRect(width - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4); + if (config.doBlending) { + DrawBlendedBackground(pixmapHeader, Theme.Color(clrReplayBackground), Theme.Color(clrReplayBackBlend), true); + DrawBlendedBackground(pixmapFooter, Theme.Color(clrReplayBackground), Theme.Color(clrReplayBackBlend), false); + } else { + pixmapHeader->Fill(Theme.Color(clrReplayBackground)); + pixmapFooter->Fill(Theme.Color(clrReplayBackground)); + } + if (config.roundedCornersChannel) { + int cornerTopSize = headerHeight/2; + int cornerBottomSize = footerHeight/2; + if ((cornerTopSize > 2)&&(cornerBottomSize > 2)) { + pixmapHeader->DrawEllipse(cRect(0,0, cornerTopSize, cornerTopSize), clrTransparent, -2); + pixmapHeader->DrawEllipse(cRect(width - cornerTopSize, 0, cornerTopSize, cornerTopSize), clrTransparent, -1); + pixmapFooter->DrawEllipse(cRect(0, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -3); + pixmapFooter->DrawEllipse(cRect(width - cornerBottomSize, cornerBottomSize, cornerBottomSize, cornerBottomSize), clrTransparent, -4); + } } pixmapBackground->Fill(Theme.Color(clrReplayBackground)); pixmapControls->Fill(clrTransparent); diff --git a/displaytracks.c b/displaytracks.c index 8dcdc96..bbcc8ce 100644 --- a/displaytracks.c +++ b/displaytracks.c @@ -25,8 +25,10 @@ cNopacityDisplayTracks::~cNopacityDisplayTracks() { osd->DestroyPixmap(pixmapHeader); osd->DestroyPixmap(pixmapHeaderAudio); menuItems.Clear(); - for (int i=0; i<2; i++) - cOsdProvider::DropImage(handleBackgrounds[i]); + if (config.doBlending) { + for (int i=0; i<2; i++) + cOsdProvider::DropImage(handleBackgrounds[i]); + } delete font; delete fontHeader; delete osd; @@ -98,6 +100,8 @@ void cNopacityDisplayTracks::CreateFonts(void) { } void cNopacityDisplayTracks::CreateBackgroundImages(void) { + if (!config.doBlending) + return; cImageLoader imgLoader; imgLoader.DrawBackground(Theme.Color(clrMenuItem), Theme.Color(clrMenuItemBlend), menuItemWidth-2, menuItemHeight-2); handleBackgrounds[0] = cOsdProvider::StoreImage(imgLoader.GetImage()); @@ -108,16 +112,20 @@ void cNopacityDisplayTracks::CreateBackgroundImages(void) { void cNopacityDisplayTracks::DrawHeader(const char *Title) { pixmapContainer->Fill(Theme.Color(clrMenuBorder)); pixmapContainer->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrMenuBack)); - pixmapHeader->Fill(Theme.Color(clrMenuItem)); - pixmapHeader->DrawImage(cPoint(1, 1), handleBackgrounds[0]); + if (config.doBlending) { + pixmapHeader->DrawImage(cPoint(1, 1), handleBackgrounds[0]); + } else { + pixmapHeader->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrMenuItemHigh)); + } pixmapIcon = osd->CreatePixmap(3, cRect(2, 2, menuItemHeight-2, menuItemHeight-2)); pixmapIcon->Fill(clrTransparent); cImageLoader imgLoader; if (imgLoader.LoadIcon("skinIcons/tracks", menuItemHeight-6)) { pixmapIcon->DrawImage(cPoint(3, 3), imgLoader.GetImage()); } - pixmapHeader->DrawText(cPoint((width - fontHeader->Width(Title)) / 2, (menuItemHeight - fontHeader->Height()) / 2), Title, Theme.Color(clrTracksFontHead), clrTransparent, fontHeader); + int clrFontBack = (config.doBlending)?clrTransparent:Theme.Color(clrMenuItemHigh); + pixmapHeader->DrawText(cPoint((width - fontHeader->Width(Title)) / 2, (menuItemHeight - fontHeader->Height()) / 2), Title, Theme.Color(clrTracksFontHead), clrFontBack, fontHeader); } void cNopacityDisplayTracks::SetItem(const char *Text, int Index, bool Current) { diff --git a/displayvolume.c b/displayvolume.c index 9570e1a..5bbca51 100644 --- a/displayvolume.c +++ b/displayvolume.c @@ -18,9 +18,13 @@ cNopacityDisplayVolume::cNopacityDisplayVolume(void) { pixmapBackgroundTop = osd->CreatePixmap(1, cRect(0, 0, width, height/2)); pixmapBackgroundBottom = osd->CreatePixmap(1, cRect(0, height/2, width, height/2)); - - DrawBlendedBackground(pixmapBackgroundTop, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), true); - DrawBlendedBackground(pixmapBackgroundBottom, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), false); + if (config.doBlending) { + DrawBlendedBackground(pixmapBackgroundTop, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), true); + DrawBlendedBackground(pixmapBackgroundBottom, Theme.Color(clrChannelBackground), Theme.Color(clrChannelBackBlend), false); + } else { + pixmapBackgroundTop->Fill(Theme.Color(clrChannelBackground)); + pixmapBackgroundBottom->Fill(Theme.Color(clrChannelBackground)); + } int cornerSize = height/4; if (cornerSize > 2) { pixmapBackgroundTop->DrawEllipse(cRect(0, 0, cornerSize, cornerSize), clrTransparent, -2); @@ -84,7 +84,11 @@ void cNopacityMenuItem::SetBackgrounds(int *handleBackgrounds) { void cNopacityMenuItem::DrawDelimiter(const char *del, const char *icon, int handleBgrd) { pixmap->Fill(Theme.Color(clrSeparatorBorder)); - pixmap->DrawImage(cPoint(1, 1), handleBgrd); + if (handleBgrd >= 0) + pixmap->DrawImage(cPoint(1, 1), handleBackgrounds[handleBgrd]); + else + pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrMenuItem)); + if (config.roundedCorners) DrawRoundedCorners(Theme.Color(clrSeparatorBorder)); cImageLoader imgLoader; @@ -107,7 +111,8 @@ void cNopacityMenuItem::DrawDelimiter(const char *del, const char *icon, int han } catch (...) {} int x = config.iconHeight + 3; int y = (height - font->Height()) / 2; - pixmap->DrawText(cPoint(x, y), delimiter.c_str(), Theme.Color(clrMenuFontMenuItemSep), clrTransparent, font); + tColor clrFontBack = (config.doBlending)?(clrTransparent):Theme.Color(clrMenuItem); + pixmap->DrawText(cPoint(x, y), delimiter.c_str(), Theme.Color(clrMenuFontMenuItemSep), clrFontBack, font); } void cNopacityMenuItem::Action(void) { @@ -179,6 +184,23 @@ cNopacityMainMenuItem::cNopacityMainMenuItem(cOsd *osd, const char *text, bool s cNopacityMainMenuItem::~cNopacityMainMenuItem(void) { } +void cNopacityMainMenuItem::DrawBackground(void) { + pixmap->Fill(Theme.Color(clrMenuBorder)); + if (config.doBlending) { + int handleBgrd; + if (!isSetup) + handleBgrd = (current)?handleBackgrounds[3]:handleBackgrounds[2]; + else + handleBgrd = (current)?handleBackgrounds[13]:handleBackgrounds[12]; + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + } else { + tColor col = (current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem); + pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), col); + } + if (config.roundedCorners) + DrawRoundedCorners(Theme.Color(clrMenuBorder)); +} + std::string cNopacityMainMenuItem::items[16] = { "Schedule", "Channels", "Timers", "Recordings", "Setup", "Commands", "OSD", "EPG", "DVB", "LNB", "CAM", "Recording", "Replay", "Miscellaneous", "Plugins", "Restart"}; @@ -307,15 +329,7 @@ void cNopacityMainMenuItem::SetTextShort(void) { } void cNopacityMainMenuItem::Render() { - pixmap->Fill(Theme.Color(clrMenuBorder)); - int handleBgrd; - if (!isSetup) - handleBgrd = (current)?handleBackgrounds[3]:handleBackgrounds[2]; - else - handleBgrd = (current)?handleBackgrounds[13]:handleBackgrounds[12]; - pixmap->DrawImage(cPoint(1, 1), handleBgrd); - if (config.roundedCorners) - DrawRoundedCorners(Theme.Color(clrMenuBorder)); + DrawBackground(); if (selectable) { if (config.useMenuIcons) { cString cIcon = GetIconName(); @@ -337,7 +351,7 @@ void cNopacityMainMenuItem::Render() { Cancel(-1); } } else { - DrawDelimiter(*itemTabs[1], "skinIcons/Channelseparator", handleBgrd); + DrawDelimiter(*itemTabs[1], "skinIcons/Channelseparator", (config.doBlending)?-1:(isSetup?12:2)); } } @@ -470,18 +484,22 @@ void cNopacityScheduleMenuItem::Render() { } } else { if (Event) { - DrawDelimiter(Event->Title(), "skinIcons/daydelimiter", handleBackgrounds[4]); + DrawDelimiter(Event->Title(), "skinIcons/daydelimiter", (config.doBlending)?4:-1); } else if (Channel) { - DrawDelimiter(Channel->Name(), "skinIcons/Channelseparator", handleBackgrounds[4]); + DrawDelimiter(Channel->Name(), "skinIcons/Channelseparator", (config.doBlending)?4:-1); } } } void cNopacityScheduleMenuItem::DrawBackground(int textLeft) { - int handleBgrd = (current)?handleBackgrounds[5]:handleBackgrounds[4]; pixmap->Fill(Theme.Color(clrMenuBorder)); - pixmap->DrawImage(cPoint(1, 1), handleBgrd); - pixmap->DrawText(cPoint(textLeft, 3), strDateTime.c_str(), Theme.Color(clrMenuFontMenuItem), clrTransparent, font); + if (config.doBlending) { + int handleBgrd = (current)?handleBackgrounds[5]:handleBackgrounds[4]; + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + } else { + tColor col = (current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem); + pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), col); + } if (config.roundedCorners) DrawRoundedCorners(Theme.Color(clrMenuBorder)); if (TimerMatch == tmFull) { @@ -495,6 +513,9 @@ void cNopacityScheduleMenuItem::DrawBackground(int textLeft) { pixmapIcon->DrawImage(cPoint(width - 34, 2), imgLoader.GetImage()); } } + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + tColor clrFontBack = (config.doBlending)?(clrTransparent):((current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem)); + pixmap->DrawText(cPoint(textLeft, 3), strDateTime.c_str(), clrFont, clrFontBack, font); } void cNopacityScheduleMenuItem::DrawLogo(int logoWidth, int logoHeight) { @@ -590,16 +611,23 @@ void cNopacityChannelMenuItem::SetTextShort(void) { pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font); } -void cNopacityChannelMenuItem::DrawBackground(int handleBackground) { +void cNopacityChannelMenuItem::DrawBackground(void) { pixmap->Fill(Theme.Color(clrMenuBorder)); - pixmap->DrawImage(cPoint(1, 1), handleBackground); + if (config.doBlending) { + int handleBgrd = (current)?handleBackgrounds[7]:handleBackgrounds[6]; + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + } else { + tColor col = (current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem); + pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), col); + } if (config.roundedCorners) DrawRoundedCorners(Theme.Color(clrMenuBorder)); int encryptedSize = height/4-2; int sourceX = config.menuItemLogoWidth + 15; - - pixmap->DrawText(cPoint(sourceX, 3*height/4 + (height/4 - fontSmall->Height())/2), *strChannelInfo, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + tColor clrFontBack = (config.doBlending)?(clrTransparent):((current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem)); + pixmap->DrawText(cPoint(sourceX, 3*height/4 + (height/4 - fontSmall->Height())/2), *strChannelInfo, clrFont, clrFontBack, fontSmall); if (Channel->Ca()) { cImageLoader imgLoader; if (imgLoader.LoadIcon("skinIcons/encrypted", encryptedSize)) { @@ -607,7 +635,7 @@ void cNopacityChannelMenuItem::DrawBackground(int handleBackground) { sourceX += encryptedSize + 10; } } - pixmap->DrawText(cPoint(sourceX, height/2 + (height/4 - fontSmall->Height())/2), *strChannelSource, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + pixmap->DrawText(cPoint(sourceX, height/2 + (height/4 - fontSmall->Height())/2), *strChannelSource, clrFont, clrFontBack, fontSmall); } std::string cNopacityChannelMenuItem::readEPG(void) { @@ -645,10 +673,8 @@ std::string cNopacityChannelMenuItem::readEPG(void) { void cNopacityChannelMenuItem::Render() { - int handleBgrd = (current)?handleBackgrounds[7]:handleBackgrounds[6]; - if (selectable) { //Channels - DrawBackground(handleBgrd); + DrawBackground(); int logoWidth = config.menuItemLogoWidth; int logoHeight = config.menuItemLogoHeight; if (!drawn) { @@ -679,7 +705,7 @@ void cNopacityChannelMenuItem::Render() { infoTextWindow->Start(); } } else { //Channelseparators - DrawDelimiter(Channel->Name(), "skinIcons/Channelseparator", handleBgrd); + DrawDelimiter(Channel->Name(), "skinIcons/Channelseparator", (config.doBlending)?6:-1); } } @@ -759,9 +785,15 @@ void cNopacityTimerMenuItem::SetTextShort(void) { pixmapTextScroller->DrawText(cPoint(0, height/2 + (height/2 - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font); } -void cNopacityTimerMenuItem::DrawBackground(int handleBackground, int textLeft) { +void cNopacityTimerMenuItem::DrawBackground(int textLeft) { pixmap->Fill(Theme.Color(clrMenuBorder)); - pixmap->DrawImage(cPoint(1, 1), handleBackground); + if (config.doBlending) { + int handleBgrd = (current)?handleBackgrounds[11]:handleBackgrounds[10]; + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + } else { + tColor col = (current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem); + pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), col); + } if (config.roundedCorners) DrawRoundedCorners(Theme.Color(clrMenuBorder)); int iconSize = height/2; @@ -786,14 +818,15 @@ void cNopacityTimerMenuItem::DrawBackground(int handleBackground, int textLeft) dateTime = cString::sprintf("! %s", strDateTime.c_str()); else dateTime = strDateTime.c_str(); - pixmap->DrawText(cPoint(textLeft + iconSize, (height/2 - fontSmall->Height())/2), *dateTime, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + tColor clrFontBack = (config.doBlending)?(clrTransparent):((current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem)); + pixmap->DrawText(cPoint(textLeft + iconSize, (height/2 - fontSmall->Height())/2), *dateTime, clrFont, clrFontBack, fontSmall); } void cNopacityTimerMenuItem::Render() { - int handleBgrd = (current)?handleBackgrounds[11]:handleBackgrounds[10]; textLeft = config.menuItemLogoWidth + 10; if (selectable) { - DrawBackground(handleBgrd, textLeft); + DrawBackground(textLeft); int logoWidth = config.menuItemLogoWidth; int logoHeight = config.menuItemLogoHeight; if (!drawn) { @@ -926,6 +959,19 @@ void cNopacityRecordingMenuItem::SetTextFull(void) { SetTextFullRecording(); } +void cNopacityRecordingMenuItem::DrawBackground(void) { + pixmap->Fill(Theme.Color(clrMenuBorder)); + if (config.doBlending) { + int handleBgrd = (current)?handleBackgrounds[9]:handleBackgrounds[8]; + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + } else { + tColor col = (current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem); + pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), col); + } + if (config.roundedCorners) + DrawRoundedCorners(Theme.Color(clrMenuBorder)); +} + void cNopacityRecordingMenuItem::SetTextFullFolder(void) { tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); pixmapTextScroller->Fill(clrTransparent); @@ -1031,26 +1077,23 @@ void cNopacityRecordingMenuItem::DrawRecDateTime(void) { } int textHeight = height/2 + (height/4 - fontSmall->Height())/2; - pixmapIcon->DrawText(cPoint(iconDateTimeSize + 10, textHeight), *strDateTime, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + pixmapIcon->DrawText(cPoint(iconDateTimeSize + 10, textHeight), *strDateTime, clrFont, clrTransparent, fontSmall); textHeight += height/4; - pixmapIcon->DrawText(cPoint(iconDateTimeSize + 10, textHeight), *strDuration, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + pixmapIcon->DrawText(cPoint(iconDateTimeSize + 10, textHeight), *strDuration, clrFont, clrTransparent, fontSmall); } void cNopacityRecordingMenuItem::DrawFolderNewSeen(void) { int textHeight = 2*height/3 + (height/3 - fontSmall->Height())/2 - 10; cString strTotalNew = cString::sprintf("%d %s (%d %s)", Total, (Total > 1)?tr("recordings"):tr("recording"), New, tr("new")); - pixmapIcon->DrawText(cPoint(config.menuRecFolderSize + 10, textHeight), *strTotalNew, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall); + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); + pixmapIcon->DrawText(cPoint(config.menuRecFolderSize + 10, textHeight), *strTotalNew, clrFont, clrTransparent, fontSmall); } void cNopacityRecordingMenuItem::Render() { - - int handleBgrd = (current)?handleBackgrounds[9]:handleBackgrounds[8]; if (selectable) { - pixmap->Fill(Theme.Color(clrMenuBorder)); - pixmap->DrawImage(cPoint(1, 1), handleBgrd); - if (config.roundedCorners) - DrawRoundedCorners(Theme.Color(clrMenuBorder)); + DrawBackground(); if (isFolder) { DrawFolderNewSeen(); SetTextShort(); @@ -1102,6 +1145,19 @@ bool cNopacityDefaultMenuItem::CheckProgressBar(const char *text) { return false; } +void cNopacityDefaultMenuItem::DrawBackground(void) { + pixmap->Fill(Theme.Color(clrMenuBorder)); + if (config.doBlending) { + int handleBgrd = (current)?handleBackgrounds[1]:handleBackgrounds[0]; + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + } else { + tColor col = (current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem); + pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), col); + } + if (config.roundedCorners) + DrawRoundedCorners(Theme.Color(clrMenuBorder)); +} + void cNopacityDefaultMenuItem::DrawProgressBar(int x, int width, const char *bar, tColor color) { const char *p = bar + 1; bool isProgressbar = true; @@ -1188,19 +1244,17 @@ bool cNopacityDefaultMenuItem::DrawHeaderElement(void) { *(c2 + 1) = 0; int left = 5 + tabWidth[0]; - pixmap->DrawText(cPoint(left, (height - font->Height()) / 2), c, Theme.Color(clrMenuFontMenuItemSep), clrTransparent, font); + tColor clrFontBack = (config.doBlending)?(clrTransparent):((current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem)); + pixmap->DrawText(cPoint(left, (height - font->Height()) / 2), c, Theme.Color(clrMenuFontMenuItemSep), clrFontBack, font); return true; } return false; } void cNopacityDefaultMenuItem::Render() { - pixmap->Fill(Theme.Color(clrMenuBorder)); - int handleBgrd = (current)?handleBackgrounds[1]:handleBackgrounds[0]; + DrawBackground(); tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem); - pixmap->DrawImage(cPoint(1, 1), handleBgrd); - if (config.roundedCorners) - DrawRoundedCorners(Theme.Color(clrMenuBorder)); + tColor clrFontBack = (config.doBlending)?(clrTransparent):((current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem)); if (!selectable && (strncmp(Text, "---", 3) == 0)) { if (DrawHeaderElement()) return; @@ -1229,7 +1283,7 @@ void cNopacityDefaultMenuItem::Render() { itemText = itemTabs[i]; } if (i==0) posX += 5; - pixmap->DrawText(cPoint(posX, (height - font->Height()) / 2), *itemText, clrFont, clrTransparent, font); + pixmap->DrawText(cPoint(posX, (height - font->Height()) / 2), *itemText, clrFont, clrFontBack, font); } else { if (!Running()) SetTextShort(); @@ -1258,9 +1312,16 @@ cNopacityTrackMenuItem::~cNopacityTrackMenuItem(void) { void cNopacityTrackMenuItem::Render() { pixmap->Fill(Theme.Color(clrMenuBorder)); - int handleBgrd = (current)?handleBackgrounds[1]:handleBackgrounds[0]; - pixmap->DrawImage(cPoint(1, 1), handleBgrd); + if (config.doBlending) { + int handleBgrd = (current)?handleBackgrounds[1]:handleBackgrounds[0]; + pixmap->DrawImage(cPoint(1, 1), handleBgrd); + } else { + tColor col = (current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem); + pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), col); + } if (config.roundedCorners) DrawRoundedCorners(Theme.Color(clrMenuBorder)); - pixmap->DrawText(cPoint(5, (height - font->Height())/2), Text, Theme.Color(clrTracksFontButtons), clrTransparent, font); + tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrTracksFontButtons); + tColor clrFontBack = (config.doBlending)?(clrTransparent):((current)?Theme.Color(clrMenuItemHigh):Theme.Color(clrMenuItem)); + pixmap->DrawText(cPoint(5, (height - font->Height())/2), Text, clrFont, clrFontBack, font); } @@ -30,9 +30,9 @@ protected: virtual void SetTextFull(void) {}; virtual void SetTextShort(void) {}; void DrawDelimiter(const char *del, const char *icon, int handleBgrd); + void DrawRoundedCorners(tColor borderColor); virtual void Action(void); void DoSleep(int duration); - void DrawRoundedCorners(tColor borderColor); public: cNopacityMenuItem(cOsd *osd, const char *text, bool sel); virtual ~cNopacityMenuItem(void); @@ -64,6 +64,7 @@ private: std::string strEntryFull; static std::string items[16]; cString GetIconName(); + void DrawBackground(void); void SetTextFull(void); void SetTextShort(void); public: @@ -114,7 +115,7 @@ private: cRect *vidWin; void SetTextFull(void); void SetTextShort(void); - void DrawBackground(int handleBackground); + void DrawBackground(void); std::string readEPG(void); public: cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel, cRect *vidWin); @@ -133,7 +134,7 @@ private: std::string strDateTime; void SetTextFull(void); void SetTextShort(void); - void DrawBackground(int handleBackground, int textLeft); + void DrawBackground(int textLeft); void DrawLogo(int logoWidth, int logoHeight); std::string CreateDate(void); public: @@ -159,6 +160,7 @@ private: void SetTextShortFolder(void); void SetTextFullRecording(void); void SetTextShortRecording(void); + void DrawBackground(void); int DrawRecordingNewIcon(void); int DrawRecordingEditedIcon(int startLeft); void DrawFolderIcon(void); @@ -178,6 +180,7 @@ public: class cNopacityDefaultMenuItem : public cNopacityMenuItem { private: bool CheckProgressBar(const char *text); + void DrawBackground(void); void DrawProgressBar(int x, int width, const char *bar, tColor color); bool DrawHeaderElement(void); std::string strEntry; @@ -5,6 +5,9 @@ static cTheme Theme; static bool menuActive = false; static bool firstDisplay = true; +//ENABLE BLENDING +#define CLR_BLENDING_ON 0xFFFFFFFF + //COMMON #define CLR_TRANSBLACK 0xDD000000 #define CLR_TRANSBLACK2 0xB0000000 @@ -34,7 +37,7 @@ static bool firstDisplay = true; #define CLR_MENUITEMHIGHBLEND 0xEE0033FF #define CLR_SEPARATORBORDER 0xEE444444 #define CLR_DISKALERT 0xDDFF0000 -#define CLR_MENUHEADER 0xDD000000 +#define CLR_MENUHEADER 0xDD000000 #define CLR_MENUHEADERBLEND 0xEE0033FF //BUTTONS @@ -53,6 +56,9 @@ static bool firstDisplay = true; #define CLR_MESSAGEWARNING 0x90BBBB00 #define CLR_MESSAGEERROR 0x90BB0000 +//ENABLE BLENDING +THEME_CLR(Theme, clrDoBlending, CLR_BLENDING_ON); + //CHANNELS THEME_CLR(Theme, clrChannelBackground, CLR_TRANSBLACK2); THEME_CLR(Theme, clrChannelBackBlend, CLR_DARKBLUE2); diff --git a/po/de_DE.po b/po/de_DE.po index 6f6c027..42b2bbf 100644 --- a/po/de_DE.po +++ b/po/de_DE.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: skinnopacity 0.0.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-05-04 11:26+0200\n" +"POT-Creation-Date: 2013-05-07 16:23+0200\n" "PO-Revision-Date: 2012-11-11 17:49+0200\n" "Last-Translator: louis\n" "Language-Team: \n" @@ -365,6 +365,9 @@ msgstr "HĂśhe des unteren Rands" msgid "Background Style" msgstr "Hintergrund Stil" +msgid "Rounded Corners" +msgstr "" + msgid "Channel Logo Position" msgstr "Kanallogo Position" diff --git a/po/it_IT.po b/po/it_IT.po index 687359b..d733a45 100644 --- a/po/it_IT.po +++ b/po/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: skinnopacity 0.0.1\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-05-04 11:26+0200\n" +"POT-Creation-Date: 2013-05-07 16:23+0200\n" "PO-Revision-Date: 2013-03-19 22:56+0100\n" "Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n" "Language-Team: \n" @@ -368,6 +368,9 @@ msgstr "Altezza bordo inferiore" msgid "Background Style" msgstr "" +msgid "Rounded Corners" +msgstr "" + msgid "Channel Logo Position" msgstr "Posizione logo canale" diff --git a/po/sk_SK.po b/po/sk_SK.po index c981db1..4be4d1f 100644 --- a/po/sk_SK.po +++ b/po/sk_SK.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: vdr-skinnopacity 0.0.6\n" "Report-Msgid-Bugs-To: <see README>\n" -"POT-Creation-Date: 2013-05-04 11:26+0200\n" +"POT-Creation-Date: 2013-05-07 16:23+0200\n" "PO-Revision-Date: 2013-03-12 15:59+0100\n" "Last-Translator: Milan Hrala <hrala.milan@gmail.com>\n" "Language-Team: \n" @@ -368,6 +368,9 @@ msgstr "Výška spodného okraja" msgid "Background Style" msgstr "" +msgid "Rounded Corners" +msgstr "" + msgid "Channel Logo Position" msgstr "Pozícia loga kanálu" @@ -80,6 +80,7 @@ void cNopacitySetup::Store(void) { SetupStore("logoHeight", config.logoHeight); SetupStore("logoBorder", config.logoBorder); SetupStore("backgroundStyle", config.backgroundStyle); + SetupStore("roundedCornersChannel", config.roundedCornersChannel); SetupStore("displaySignalStrength", config.displaySignalStrength); SetupStore("displayPrevNextChannelGroup", config.displayPrevNextChannelGroup); SetupStore("channelFadeTime", config.channelFadeTime); @@ -470,6 +471,7 @@ void cNopacitySetupChannelDisplay::Set(void) { Add(new cMenuEditIntItem(tr("Left & Right Border Width"), &tmpNopacityConfig->channelBorderVertical, 0, 300)); Add(new cMenuEditIntItem(tr("Bottom Border Height"), &tmpNopacityConfig->channelBorderBottom, 0, 300)); Add(new cMenuEditStraItem(tr("Background Style"), &tmpNopacityConfig->backgroundStyle, 2, bgStyle)); + Add(new cMenuEditBoolItem(tr("Rounded Corners"), &tmpNopacityConfig->roundedCornersChannel)); Add(new cMenuEditStraItem(tr("Channel Logo Position"), &tmpNopacityConfig->logoPosition, 3, logoPos)); if (tmpNopacityConfig->logoPosition) { Add(new cMenuEditIntItem(cString::sprintf("%s%s", *spacer, tr("Channel Logo Width")), &tmpNopacityConfig->logoWidth, 30, 500)); diff --git a/textwindow.c b/textwindow.c index a51aa0b..6e55ef9 100644 --- a/textwindow.c +++ b/textwindow.c @@ -58,9 +58,10 @@ bool cNopacityTextWindow::CreatePixmap(int border) { void cNopacityTextWindow::DrawText(int border) { int lineHeight = font->Height(); int currentLineHeight = lineHeight/2; + tColor clrFontBack = (config.doBlending)?(clrTransparent):(Theme.Color(clrMenuBack)); cPixmap::Lock(); for (int i=0; (i < twText.Lines()) && Running(); i++) { - pixmap->DrawText(cPoint(border, currentLineHeight), twText.GetLine(i), Theme.Color(clrMenuFontDetailViewText), clrTransparent, font); + pixmap->DrawText(cPoint(border, currentLineHeight), twText.GetLine(i), Theme.Color(clrMenuFontDetailViewText), clrFontBack, font); currentLineHeight += lineHeight; } cPixmap::Unlock(); @@ -158,4 +159,4 @@ void cNopacityTextWindow::Action(void) { cCondWait::SleepMs(FrameTime - Delta); } } -}
\ No newline at end of file +} diff --git a/themes/nOpacity-darkblue.theme b/themes/nOpacity-darkblue.theme index 4ef3669..2428047 100644 --- a/themes/nOpacity-darkblue.theme +++ b/themes/nOpacity-darkblue.theme @@ -1,4 +1,6 @@ Description = Dark Blue +#DO BLENDING +clrDoBlending = FFFFFFFF clrChannelBackground = B0000000 clrChannelBackBlend = DD5078ab clrChannelHead = FFEEEEEE diff --git a/themes/nOpacity-darkred.theme b/themes/nOpacity-darkred.theme index c1df037..0d16e44 100644 --- a/themes/nOpacity-darkred.theme +++ b/themes/nOpacity-darkred.theme @@ -1,4 +1,5 @@ Description = Dark Red +clrDoBlending = FFFFFFFF clrChannelBackground = CC000000 clrChannelBackBlend = CC333333 clrChannelHead = FFEEEEEE diff --git a/themes/nOpacity-green.theme b/themes/nOpacity-green.theme index 876aa5e..6299d76 100644 --- a/themes/nOpacity-green.theme +++ b/themes/nOpacity-green.theme @@ -1,4 +1,5 @@ -Description = Green +Description = Green +clrDoBlending = FFFFFFFF clrChannelBackground = B0000000 clrChannelBackBlend = DD006600 clrChannelHead = FFFFCC00 @@ -117,8 +117,12 @@ void cNopacityTimer::Render(void) { if (isTimerConflict) {
pixmapLogo->Fill(clrTransparent);
pixmap->Fill(Theme.Color(clrDiskAlert));
- imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2);
- pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ if (config.doBlending) {
+ imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2);
+ pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ } else {
+ pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrDiskAlert));
+ }
int numLines = showName.Lines();
int textWidth = 0;
int x = 0;
@@ -133,12 +137,20 @@ void cNopacityTimer::Render(void) { DrawLogo();
if (timer->Recording()) {
pixmap->Fill(Theme.Color(clrDiskAlert));
- imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2);
- pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ if (config.doBlending) {
+ imgLoader.DrawBackground(Theme.Color(clrDiskAlert), Theme.Color(clrMenuItemHigh), width-2, height-2);
+ pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ } else {
+ pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrDiskAlert));
+ }
} else {
pixmap->Fill(Theme.Color(clrMenuBorder));
- imgLoader.DrawBackground(Theme.Color(clrMenuItemHighBlend), Theme.Color(clrMenuItemHigh), width-2, height-2);
- pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ if (config.doBlending) {
+ imgLoader.DrawBackground(Theme.Color(clrMenuItemHighBlend), Theme.Color(clrMenuItemHigh), width-2, height-2);
+ pixmap->DrawImage(cPoint(1,1), imgLoader.GetImage());
+ } else {
+ pixmap->DrawRectangle(cRect(1, 1, width-2, height-2), Theme.Color(clrMenuItemHigh));
+ }
}
pixmap->DrawText(cPoint(5, config.timersLogoHeight), *Date, Theme.Color(clrMenuFontTimersHeader), clrTransparent, fontLarge);
|