From 159b3865b49b6b0cb5a8623ec7b3ca57019407fe Mon Sep 17 00:00:00 2001 From: Tobias Grimm Date: Wed, 31 Dec 2008 23:14:08 +0100 Subject: Background toggling now allows to switch between black, the configured background transparency and full transparency as suggested by Walter K. (Closes #41) --- HISTORY | 3 +++ menu.c | 15 +++++++++++---- menu.h | 2 ++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index 667ffe5..537417b 100644 --- a/HISTORY +++ b/HISTORY @@ -10,6 +10,9 @@ VDR Plugin 'osdteletext' Revision History - Remove remnants of VDR < 1.6 support - Updated Russian translation provided by Oleg Roitburd (Closes #46) - Improved error handling +- Background toggling now allows to switch between black, the configured + background transparency and full transparency as suggested by + Walter K. (Closes #41) 2008-12-19: version 0.7.0 - switched completely to VDR 1.6's I18N system and removed the old crap - no diff --git a/menu.c b/menu.c index 69e77f0..3e55964 100644 --- a/menu.c +++ b/menu.c @@ -310,10 +310,7 @@ void TeletextBrowser::ExecuteAction(eTeletextAction e) { //suspendedReceiving=(!suspendedReceiving); break;*/ case DarkScreen: - if (Display::GetBackgroundColor() == clrBlack) - Display::SetBackgroundColor((tColor)ttSetup.configuredClrBackground); - else - Display::SetBackgroundColor(clrBlack); + ChangeBackground(); break; default: //In osdteletext.c, numbers are thought to be decimal, the setup page @@ -339,6 +336,16 @@ void TeletextBrowser::ExecuteAction(eTeletextAction e) { } } +void TeletextBrowser::ChangeBackground() +{ + if (Display::GetBackgroundColor() == clrBlack) + Display::SetBackgroundColor((tColor)ttSetup.configuredClrBackground); + else if (Display::GetBackgroundColor() == (tColor)ttSetup.configuredClrBackground) + Display::SetBackgroundColor(clrTransparent); + else + Display::SetBackgroundColor(clrBlack); +} + eTeletextAction TeletextBrowser::TranslateKey(eKeys Key) { switch(Key) { case kRed: return (eTeletextAction)ttSetup.mapKeyToAction[ActionKeyRed]; diff --git a/menu.h b/menu.h index 0aaf3d1..a24fab5 100644 --- a/menu.h +++ b/menu.h @@ -75,6 +75,8 @@ protected: static tChannelID channel; static int currentChannelNumber; static TeletextBrowser* self; +private: + void ChangeBackground(); }; -- cgit v1.2.3