void cSkinSTTNGDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { int y = y3 + Roundness + Index * lineHeight; tColor ColorFg, ColorBg; if (Current) { ColorFg = Theme.Color(clrMenuItemCurrentFg); ColorBg = Theme.Color(clrMenuItemCurrentBg); osd->DrawEllipse (x1, y - Roundness, x2 - 1, y - 1, frameColor, -3); osd->DrawRectangle(x1, y, x2 - 1, y + lineHeight - 1, frameColor); osd->DrawEllipse (x1, y + lineHeight, x2 - 1, y + lineHeight + Roundness - 1, frameColor, -2); osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, ColorBg); currentIndex = Index; } else { ColorFg = Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable); ColorBg = Theme.Color(clrBackground); if (currentIndex == Index) { osd->DrawRectangle(x1, y - Roundness, x2 - 1, y + lineHeight + Roundness - 1, Theme.Color(clrBackground)); osd->DrawRectangle(x3, y, x4 - 1, y + lineHeight - 1, Theme.Color(clrBackground)); } } const cFont *font = cFont::GetFont(fontOsd); for (int i = 0; i < MaxTabs; i++) { const char *s = GetTabbedText(Text, i); if (s) { int xt = x3 + 5 + Tab(i); osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x4 - xt); } if (!Tab(i + 1)) break; } SetEditableWidth(x4 - x3 - 5 - Tab(1)); }
void cSkinCursesDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { int y = 2 + Index; int ColorFg, ColorBg; if (Current) { ColorFg = clrBlack; ColorBg = clrCyan; } else { ColorFg = Selectable ? clrWhite : clrCyan; ColorBg = clrBackground; } for (int i = 0; i < MaxTabs; i++) { const char *s = GetTabbedText(Text, i); if (s) { int xt = Tab(i) / AvgCharWidth();// Tab() is in "pixel" - see also skins.c!!! osd->DrawText(xt, y, s, ColorFg, ColorBg, &Font, ScOsdWidth - 2 - xt); } if (!Tab(i + 1)) break; } SetEditableWidth(ScOsdWidth - 2 - Tab(1) / AvgCharWidth()); // Tab() is in "pixel" - see also skins.c!!! }
void cSkinClassicDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { int y = y2 + Index * lineHeight; tColor ColorFg, ColorBg; if (Current) { ColorFg = Theme.Color(clrMenuItemCurrentFg); ColorBg = Theme.Color(clrMenuItemCurrentBg); } else { ColorFg = Theme.Color(Selectable ? clrMenuItemSelectable : clrMenuItemNonSelectable); ColorBg = Theme.Color(clrBackground); } const cFont *font = cFont::GetFont(fontOsd); for (int i = 0; i < MaxTabs; i++) { const char *s = GetTabbedText(Text, i); if (s) { int xt = x0 + Tab(i); osd->DrawText(xt, y, s, ColorFg, ColorBg, font, x2 - xt); } if (!Tab(i + 1)) break; } SetEditableWidth(x2 - x0 - Tab(1)); }