From 18ee548cd1bf401be27346bb5aab66cade7da074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Sun, 11 Jan 2009 14:16:56 +0200 Subject: If background is configured to completely black or transparent, toggle between black and transparent only. --- HISTORY | 2 ++ menu.c | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/HISTORY b/HISTORY index bddfb41..db08541 100644 --- a/HISTORY +++ b/HISTORY @@ -5,6 +5,8 @@ VDR Plugin 'osdteletext' Revision History - More refactoring of the TxtStatus class (Thx to Sören Moch!) - Install plug-in to lib dir with --remove-destination as suggested by Christian Wieninger (Closes #57) +- If background is configured to completely black or transparent, + toggle between black and transparent only. 2009-01-10: version 0.8.1 - Small bugfix in channel switching code diff --git a/menu.c b/menu.c index 9255503..cfa7a3b 100644 --- a/menu.c +++ b/menu.c @@ -336,13 +336,24 @@ void TeletextBrowser::ExecuteAction(eTeletextAction e) { } } +// 3-state toggling between configured->transparent->black. +// If configured is black or transparent, do 2-state transparent->black only. void TeletextBrowser::ChangeBackground() { - if (Display::GetBackgroundColor() == clrBlack) - Display::SetBackgroundColor((tColor)ttSetup.configuredClrBackground); - else if (Display::GetBackgroundColor() == (tColor)ttSetup.configuredClrBackground) - Display::SetBackgroundColor(clrTransparent); - else + tColor clrConfig = (tColor)ttSetup.configuredClrBackground; + tColor clrCurrent = Display::GetBackgroundColor(); + + if (clrCurrent == clrConfig) + if (clrConfig == clrTransparent) + Display::SetBackgroundColor(clrBlack); + else + Display::SetBackgroundColor(clrTransparent); + else if (clrCurrent == clrBlack) + if (clrConfig == clrBlack) + Display::SetBackgroundColor(clrTransparent); + else + Display::SetBackgroundColor(clrConfig); + else // clrCurrent == clrTransparent Display::SetBackgroundColor(clrBlack); } -- cgit v1.2.3