diff --git a/HISTORY b/HISTORY index 20b5bd3e..4b3b6a72 100644 --- a/HISTORY +++ b/HISTORY @@ -7538,3 +7538,4 @@ Video Disk Recorder Revision History - Now also using FindHeader() in cMpeg2Fixer::AdjTref() (pointed out by Sören Moch). - Added missing template for DVBDIR to Make.config.template (reported by Derek Kelly). +- The LCARS menu now also works if the OSD has only 1bpp (two colors). diff --git a/skinlcars.c b/skinlcars.c index b2dab50d..a28ba0e1 100644 --- a/skinlcars.c +++ b/skinlcars.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinlcars.c 2.15 2012/09/19 11:05:50 kls Exp $ + * $Id: skinlcars.c 2.16 2013/01/23 13:34:12 kls Exp $ */ // "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures, @@ -199,6 +199,8 @@ THEME_CLR(Theme, clrTrackItemCurrentBg, CLR_TRACK); // --- Helper functions ------------------------------------------------------ +static bool TwoColors = false; + static cOsd *CreateOsd(int Left, int Top, int x0, int y0, int x1, int y1) { cOsd *Osd = cOsdProvider::NewOsd(Left, Top); @@ -208,6 +210,7 @@ static cOsd *CreateOsd(int Left, int Top, int x0, int y0, int x1, int y1) Area.bpp = Bpp[i]; if (Osd->CanHandleAreas(&Area, 1) == oeOk) { Osd->SetAreas(&Area, 1); + TwoColors = Area.bpp == 1; break; } } @@ -272,16 +275,25 @@ static void DrawDeviceSignal(cOsd *Osd, const cDevice *Device, int x0, int y0, i int y01 = y00 + h; int y03 = y1 - d; int y02 = y03 - h; + tColor ColorSignalValue, ColorSignalRest; + if (TwoColors) { + ColorSignalValue = Theme.Color(clrBackground); + ColorSignalRest = Theme.Color(clrMenuFrameBg); + } + else { + ColorSignalValue = Theme.Color(clrSignalValue); + ColorSignalRest = Theme.Color(clrSignalRest); + } if (SignalStrength >= 0 && (Initial || SignalStrength != LastSignalStrength)) { int s = SignalStrength * w / 100; - Osd->DrawRectangle(x00, y00, x00 + s - 1, y01 - 1, Theme.Color(clrSignalValue)); - Osd->DrawRectangle(x00 + s, y00, x01 - 1, y01 - 1, Theme.Color(clrSignalRest)); + Osd->DrawRectangle(x00, y00, x00 + s - 1, y01 - 1, ColorSignalValue); + Osd->DrawRectangle(x00 + s, y00, x01 - 1, y01 - 1, ColorSignalRest); LastSignalStrength = SignalStrength; } if (SignalQuality >= 0 && (Initial || SignalQuality != LastSignalQuality)) { int q = SignalQuality * w / 100; - Osd->DrawRectangle(x00, y02, x00 + q - 1, y03 - 1, Theme.Color(clrSignalValue)); - Osd->DrawRectangle(x00 + q, y02, x01 - 1, y03 - 1, Theme.Color(clrSignalRest)); + Osd->DrawRectangle(x00, y02, x00 + q - 1, y03 - 1, ColorSignalValue); + Osd->DrawRectangle(x00 + q, y02, x01 - 1, y03 - 1, ColorSignalRest); LastSignalQuality = SignalQuality; } } @@ -1493,8 +1505,14 @@ void cSkinLCARSDisplayMenu::SetItem(const char *Text, int Index, bool Current, b int y = yi00 + Index * lineHeight; tColor ColorFg, ColorBg; if (Current) { - ColorFg = Theme.Color(clrMenuItemCurrentFg); - ColorBg = Theme.Color(clrMenuItemCurrentBg); + if (TwoColors) { + ColorFg = Theme.Color(clrBackground); + ColorBg = Theme.Color(clrMenuFrameBg); + } + else { + ColorFg = Theme.Color(clrMenuItemCurrentFg); + ColorBg = Theme.Color(clrMenuItemCurrentBg); + } osd->DrawRectangle(xi00, y, xi01 - 1, y + lineHeight - 1, ColorBg); osd->DrawRectangle(xi02, y, xi02 + lineHeight / 2 - 1, y + lineHeight - 1, ColorBg); osd->DrawEllipse (xi02 + lineHeight / 2, y, xi03 - 1, y + lineHeight - 1, ColorBg, 5);