summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2009-01-11 14:16:56 +0200
committerVille Skyttä <ville.skytta@iki.fi>2009-01-11 14:16:56 +0200
commit18ee548cd1bf401be27346bb5aab66cade7da074 (patch)
tree4520e5c6ce8178a54d415557400c4ad1bda3244a
parent0ad587f0d36bf12c1a80cee0131b4865c7de502d (diff)
downloadvdr-plugin-osdteletext-18ee548cd1bf401be27346bb5aab66cade7da074.tar.gz
vdr-plugin-osdteletext-18ee548cd1bf401be27346bb5aab66cade7da074.tar.bz2
If background is configured to completely black or transparent, toggle between black and transparent only.
-rw-r--r--HISTORY2
-rw-r--r--menu.c21
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);
}