mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
The LCARS menu now also works if the OSD has only 1bpp (two colors)
This commit is contained in:
parent
956ac7e70d
commit
b833de1761
1
HISTORY
1
HISTORY
@ -7538,3 +7538,4 @@ Video Disk Recorder Revision History
|
|||||||
|
|
||||||
- Now also using FindHeader() in cMpeg2Fixer::AdjTref() (pointed out by Sören Moch).
|
- 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).
|
- 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).
|
||||||
|
32
skinlcars.c
32
skinlcars.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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,
|
// "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 ------------------------------------------------------
|
// --- Helper functions ------------------------------------------------------
|
||||||
|
|
||||||
|
static bool TwoColors = false;
|
||||||
|
|
||||||
static cOsd *CreateOsd(int Left, int Top, int x0, int y0, int x1, int y1)
|
static cOsd *CreateOsd(int Left, int Top, int x0, int y0, int x1, int y1)
|
||||||
{
|
{
|
||||||
cOsd *Osd = cOsdProvider::NewOsd(Left, Top);
|
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];
|
Area.bpp = Bpp[i];
|
||||||
if (Osd->CanHandleAreas(&Area, 1) == oeOk) {
|
if (Osd->CanHandleAreas(&Area, 1) == oeOk) {
|
||||||
Osd->SetAreas(&Area, 1);
|
Osd->SetAreas(&Area, 1);
|
||||||
|
TwoColors = Area.bpp == 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -272,16 +275,25 @@ static void DrawDeviceSignal(cOsd *Osd, const cDevice *Device, int x0, int y0, i
|
|||||||
int y01 = y00 + h;
|
int y01 = y00 + h;
|
||||||
int y03 = y1 - d;
|
int y03 = y1 - d;
|
||||||
int y02 = y03 - h;
|
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)) {
|
if (SignalStrength >= 0 && (Initial || SignalStrength != LastSignalStrength)) {
|
||||||
int s = SignalStrength * w / 100;
|
int s = SignalStrength * w / 100;
|
||||||
Osd->DrawRectangle(x00, y00, x00 + s - 1, y01 - 1, Theme.Color(clrSignalValue));
|
Osd->DrawRectangle(x00, y00, x00 + s - 1, y01 - 1, ColorSignalValue);
|
||||||
Osd->DrawRectangle(x00 + s, y00, x01 - 1, y01 - 1, Theme.Color(clrSignalRest));
|
Osd->DrawRectangle(x00 + s, y00, x01 - 1, y01 - 1, ColorSignalRest);
|
||||||
LastSignalStrength = SignalStrength;
|
LastSignalStrength = SignalStrength;
|
||||||
}
|
}
|
||||||
if (SignalQuality >= 0 && (Initial || SignalQuality != LastSignalQuality)) {
|
if (SignalQuality >= 0 && (Initial || SignalQuality != LastSignalQuality)) {
|
||||||
int q = SignalQuality * w / 100;
|
int q = SignalQuality * w / 100;
|
||||||
Osd->DrawRectangle(x00, y02, x00 + q - 1, y03 - 1, Theme.Color(clrSignalValue));
|
Osd->DrawRectangle(x00, y02, x00 + q - 1, y03 - 1, ColorSignalValue);
|
||||||
Osd->DrawRectangle(x00 + q, y02, x01 - 1, y03 - 1, Theme.Color(clrSignalRest));
|
Osd->DrawRectangle(x00 + q, y02, x01 - 1, y03 - 1, ColorSignalRest);
|
||||||
LastSignalQuality = SignalQuality;
|
LastSignalQuality = SignalQuality;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1493,8 +1505,14 @@ void cSkinLCARSDisplayMenu::SetItem(const char *Text, int Index, bool Current, b
|
|||||||
int y = yi00 + Index * lineHeight;
|
int y = yi00 + Index * lineHeight;
|
||||||
tColor ColorFg, ColorBg;
|
tColor ColorFg, ColorBg;
|
||||||
if (Current) {
|
if (Current) {
|
||||||
ColorFg = Theme.Color(clrMenuItemCurrentFg);
|
if (TwoColors) {
|
||||||
ColorBg = Theme.Color(clrMenuItemCurrentBg);
|
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(xi00, y, xi01 - 1, y + lineHeight - 1, ColorBg);
|
||||||
osd->DrawRectangle(xi02, y, xi02 + lineHeight / 2 - 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);
|
osd->DrawEllipse (xi02 + lineHeight / 2, y, xi03 - 1, y + lineHeight - 1, ColorBg, 5);
|
||||||
|
Loading…
Reference in New Issue
Block a user