From d376fce4dbfe89a731ab7de8fc5581968b8e2350 Mon Sep 17 00:00:00 2001 From: kamel5 Date: Mon, 5 Aug 2019 13:25:03 +0200 Subject: Optical changes to cLCARSNGDisplayTracks --- displaytracks.c | 83 ++++++++++++++++++++++++++-------------------- displaytracks.h | 4 ++- lcarsng.h | 1 + themes/lcarsng-meins.theme | 13 ++++---- 4 files changed, 58 insertions(+), 43 deletions(-) diff --git a/displaytracks.c b/displaytracks.c index 068f86a..0f923da 100644 --- a/displaytracks.c +++ b/displaytracks.c @@ -12,7 +12,9 @@ cLCARSNGDisplayTracks::cLCARSNGDisplayTracks(const char *Title, int NumTracks, c { const cFont *font = cFont::GetFont(fontOsd); lineHeight = font->Height(); - frameColor = Theme.Color(clrTrackFrameBg); + frameColorFg = Theme.Color(clrTrackFrameFg); + frameColorBg = Theme.Color(clrTrackFrameBg); + frameColorMg = Theme.Color(clrTrackFrameMg); currentIndex = -1; xt00 = 0; xt01 = xt00 + lineHeight / 2; @@ -21,7 +23,7 @@ cLCARSNGDisplayTracks::cLCARSNGDisplayTracks(const char *Title, int NumTracks, c int ItemsWidth = font->Width(Title) + xt03 - xt02; for (int i = 0; i < NumTracks; i++) ItemsWidth = max(ItemsWidth, font->Width(Tracks[i]) + 2 * TextFrame); - xt04 = xt02 + ItemsWidth; + xt04 = xt02 + ItemsWidth + 2 * Margin; xt05 = xt04 + Gap; xt06 = xt04 + lineHeight; xt07 = xt05 + lineHeight; @@ -31,45 +33,53 @@ cLCARSNGDisplayTracks::cLCARSNGDisplayTracks(const char *Title, int NumTracks, c xt11 = xt10 + Gap; xt12 = xt11 + lineHeight; yt00 = 0; - yt01 = yt00 + lineHeight; - yt02 = yt01 + lineHeight; + yt01 = yt00 + lineHeight + Margin; + yt02 = yt01 + lineHeight + Margin; yt03 = yt02 + Gap; - yt04 = yt03 + NumTracks * lineHeight + (NumTracks - 1) * Gap; + yt04 = yt03 + NumTracks * (lineHeight + 2 * Margin) + (NumTracks - 1) * Gap; yt05 = yt04 + Gap; - yt06 = yt05 + lineHeight; - yt07 = yt06 + lineHeight; + yt06 = yt05 + lineHeight + Margin; + yt07 = yt06 + lineHeight + Margin; while (yt07 > cOsd::OsdHeight()) { - yt04 -= lineHeight + Gap; + yt04 -= lineHeight + Gap - 2 * Margin; yt05 = yt04 + Gap; - yt06 = yt05 + lineHeight; - yt07 = yt06 + lineHeight; + yt06 = yt05 + lineHeight + Margin; + yt07 = yt06 + lineHeight + Margin; } osd = CreateOsd(cOsd::OsdLeft(), cOsd::OsdTop() + cOsd::OsdHeight() - yt07, xt00, yt00, xt12 - 1, yt07 - 1); // The upper elbow: osd->DrawRectangle(xt00, yt00, xt12 - 1, yt07 - 1, Theme.Color(clrBackground)); osd->DrawRectangle(xt00, yt00, xt03 - 1, yt02 - 1, clrTransparent); - osd->DrawEllipse (xt00, yt00, xt03 - 1, yt02 - 1, frameColor, 2); - osd->DrawRectangle(xt03, yt00, xt04 - 1, yt02 - 1, frameColor); - osd->DrawRectangle(xt04, yt00, xt08 - 1, yt01 - 1, frameColor); - osd->DrawEllipse (xt04, yt01, xt06 - 1, yt02 - 1, frameColor, -2); - osd->DrawRectangle(xt09, yt00, xt10 - 1, yt01 - 1, frameColor); - osd->DrawRectangle(xt11, yt00, xt11 + lineHeight / 2 - 1, yt01 - 1, frameColor); + osd->DrawEllipse (xt00, yt00, xt03 - 1, yt02 - 1, frameColorMg, 2); + osd->DrawEllipse (xt00 + Margin, yt00 + Margin, xt03 - 1, yt02 - 1 - Margin, frameColorBg, 2); + DrawRectangleOutline(osd, xt03, yt00, xt04 - 1, yt01 - 1, frameColorMg, frameColorBg, 2); + DrawRectangleOutline(osd, xt03, yt01, xt04 - 1, yt02 - 1, frameColorMg, frameColorBg, 12); + DrawRectangleOutline(osd, xt04, yt00, xt08 - 1, yt01 - 1, frameColorMg, frameColorBg, 14); + osd->DrawEllipse (xt04 - 1, yt01, xt06 - 1, yt02 - 1, frameColorMg, -2); + osd->DrawEllipse (xt04 - 1 - Margin, yt01 - Margin, xt06 - 1 - Margin, yt02 - 1 - Margin, frameColorBg, -2); + DrawRectangleOutline(osd, xt09, yt00, xt10 - 1, yt01 - 1, frameColorMg, frameColorBg, 15); + DrawRectangleOutline(osd, xt11, yt00, xt11 + lineHeight / 2 - 1, yt01 - 1, frameColorMg, frameColorBg, 11); osd->DrawRectangle(xt11 + lineHeight / 2, yt00, xt12 - 1, yt00 + lineHeight / 2 - 1, clrTransparent); - osd->DrawEllipse (xt11 + lineHeight / 2, yt00, xt12 - 1, yt01 - 1, frameColor, 5); - osd->DrawText(xt03, yt00, Title, Theme.Color(clrTrackFrameFg), frameColor, font, xt04 - xt03, 0, taTop | taRight); + osd->DrawEllipse (xt11 + lineHeight / 2, yt00, xt12 - 1, yt01 - 1, frameColorMg, 5); + osd->DrawEllipse (xt11 + lineHeight / 2, yt00 + Margin, xt12 - 1 - Margin, yt01 - 1 - Margin, frameColorBg, 5); + osd->DrawText(xt03, yt00 + Margin, Title, frameColorFg, frameColorBg, font, xt04 - xt03, 0, taTop | taRight); // The items: for (int i = 0; i < NumTracks; i++) SetItem(Tracks[i], i, false); // The lower elbow: osd->DrawRectangle(xt00, yt05, xt03 - 1, yt07 - 1, clrTransparent); - osd->DrawEllipse (xt00, yt05, xt03 - 1, yt07 - 1, frameColor, 3); - osd->DrawRectangle(xt03, yt05, xt04 - 1, yt07 - 1, frameColor); - osd->DrawRectangle(xt04, yt06, xt08 - 1, yt07 - 1, frameColor); - osd->DrawEllipse (xt04, yt05, xt06 - 1, yt06 - 1, frameColor, -3); - osd->DrawRectangle(xt09, yt06, xt10 - 1, yt07 - 1, frameColor); - osd->DrawRectangle(xt11, yt06, xt11 + lineHeight / 2 - 1, yt07 - 1, frameColor); + osd->DrawEllipse (xt00, yt05, xt03 - 1, yt07 - 1, frameColorMg, 3); + osd->DrawEllipse (xt00 + Margin, yt05 + Margin, xt03 - 1, yt07 - 1 - Margin, frameColorBg, 3); + DrawRectangleOutline(osd, xt03, yt05, xt04 - 1, yt06 - 1, frameColorMg, frameColorBg, 6); + DrawRectangleOutline(osd, xt03, yt06, xt04 - 1, yt07 - 1, frameColorMg, frameColorBg, 8); + DrawRectangleOutline(osd, xt04, yt06, xt08 - 1, yt07 - 1, frameColorMg, frameColorBg, 14); + osd->DrawEllipse (xt04 - 1, yt05, xt06 - 1, yt06 - 1, frameColorMg, -3); + osd->DrawEllipse (xt04 - 1 - Margin, yt05 + Margin, xt06 - 1 - Margin, yt06 - 1 + Margin, frameColorBg, -3); + DrawRectangleOutline(osd, xt09, yt06, xt10 - 1, yt07 - 1, frameColorMg, frameColorBg, 15); + DrawRectangleOutline(osd, xt11, yt06, xt11 + lineHeight / 2 - 1, yt07 - 1, frameColorMg, frameColorBg, 11); osd->DrawRectangle(xt11 + lineHeight / 2, yt06 + lineHeight / 2, xt12 - 1, yt07 - 1, clrTransparent); - osd->DrawEllipse (xt11 + lineHeight / 2, yt06, xt12 - 1, yt07 - 1, frameColor, 5); + osd->DrawEllipse (xt11 + lineHeight / 2, yt06, xt12 - 1, yt07 - 1, frameColorMg, 5); + osd->DrawEllipse (xt11 + lineHeight / 2, yt06 + Margin, xt12 - 1 - Margin, yt07 - 1 - Margin, frameColorBg, 5); } cLCARSNGDisplayTracks::~cLCARSNGDisplayTracks() @@ -80,30 +90,31 @@ cLCARSNGDisplayTracks::~cLCARSNGDisplayTracks() void cLCARSNGDisplayTracks::SetItem(const char *Text, int Index, bool Current) { - int y0 = yt03 + Index * (lineHeight + Gap); - int y1 = y0 + lineHeight; + int y0 = yt03 + Index * (lineHeight + Gap + 2 * Margin); + int y1 = y0 + lineHeight + 2 * Margin; if (y1 > yt04) return; tColor ColorFg, ColorBg; if (Current) { ColorFg = Theme.Color(clrTrackItemCurrentFg); ColorBg = Theme.Color(clrTrackItemCurrentBg); - osd->DrawRectangle(xt00, y0, xt01 - 1, y1 - 1, frameColor); - osd->DrawRectangle(xt02, y0, xt04 - 1, y1 - 1, ColorBg); - osd->DrawRectangle(xt05, y0, xt05 + lineHeight / 2 - 1, y1 - 1, ColorBg); - osd->DrawEllipse (xt05 + lineHeight / 2, y0, xt07 - 1, y1 - 1, ColorBg, 5); + DrawRectangleOutline(osd, xt00, y0, xt01 - 1, y1 - 1, frameColorMg, frameColorBg, 15); + DrawRectangleOutline(osd, xt02, y0, xt04 - 1, y1 - 1, frameColorMg, frameColorBg, 15); + DrawRectangleOutline(osd, xt05, y0, xt05 + lineHeight / 2 - 1, y1 - 1, frameColorMg, ColorBg, 11); + osd->DrawEllipse (xt05 + lineHeight / 2, y0, xt07 - 1, y1 - 1, frameColorMg, 5); + osd->DrawEllipse (xt05 + lineHeight / 2, y0 + Margin, xt07 - 1 - Margin, y1 - 1 - Margin, ColorBg, 5); currentIndex = Index; } else { ColorFg = Theme.Color(clrTrackItemFg); ColorBg = Theme.Color(clrTrackItemBg); - osd->DrawRectangle(xt00, y0, xt01 - 1, y1 - 1, frameColor); - osd->DrawRectangle(xt02, y0, xt04 - 1, y1 - 1, ColorBg); + DrawRectangleOutline(osd, xt00, y0, xt01 - 1, y1 - 1, frameColorMg, frameColorBg, 15); + DrawRectangleOutline(osd, xt02, y0, xt04 - 1, y1 - 1, frameColorMg, frameColorBg, 15); if (currentIndex == Index) osd->DrawRectangle(xt05, y0, xt07 - 1, y1 - 1, Theme.Color(clrBackground)); } const cFont *font = cFont::GetFont(fontOsd); - osd->DrawText(xt02, y0, Text, ColorFg, ColorBg, font, xt04 - xt02, y1 - y0, taTop | taLeft | taBorder); + osd->DrawText(xt02 + Margin, y0 + Margin, Text, ColorFg, ColorBg, font, xt04 - xt02 - 2 * Margin, y1 - y0 - 2 * Margin, taTop | taLeft | taBorder); } void cLCARSNGDisplayTracks::SetTrack(int Index, const char * const *Tracks) @@ -123,9 +134,9 @@ void cLCARSNGDisplayTracks::SetAudioChannel(int AudioChannel) default: ; } if (bm) - osd->DrawBitmap(xt04 - bm->Width(), (yt06 + yt07 - bm->Height()) / 2, *bm, Theme.Color(clrTrackFrameFg), frameColor); + osd->DrawBitmap(xt04 - bm->Width(), (yt06 + yt07 - bm->Height()) / 2 - 2 * Margin, *bm, Theme.Color(clrTrackItemCurrentFg), frameColorBg); else - osd->DrawRectangle(xt03, yt06, xt04 - 1, yt07 - 1, frameColor); + osd->DrawRectangle(xt03, yt06, xt04 - 1, yt07 - 1 - Margin, frameColorBg); } void cLCARSNGDisplayTracks::Flush(void) diff --git a/displaytracks.h b/displaytracks.h index 12dbd56..cd0a458 100644 --- a/displaytracks.h +++ b/displaytracks.h @@ -10,7 +10,9 @@ private: int xt00, xt01, xt02, xt03, xt04, xt05, xt06, xt07, xt08, xt09, xt10, xt11, xt12; int yt00, yt01, yt02, yt03, yt04, yt05, yt06, yt07; int lineHeight; - tColor frameColor; + tColor frameColorFg; + tColor frameColorBg; + tColor frameColorMg; int currentIndex; static cBitmap bmAudioLeft, bmAudioRight, bmAudioStereo; void SetItem(const char *Text, int Index, bool Current); diff --git a/lcarsng.h b/lcarsng.h index a5dd59e..934068e 100644 --- a/lcarsng.h +++ b/lcarsng.h @@ -191,6 +191,7 @@ THEME_CLR(Theme, clrReplayProgressCurrent, CLR_EXPOSED); THEME_CLR(Theme, clrTrackFrameFg, CLR_BLACK); THEME_CLR(Theme, clrTrackFrameBg, CLR_TRACK); +THEME_CLR(Theme, clrTrackFrameMg, CLR_WHITE); THEME_CLR(Theme, clrTrackItemFg, CLR_BLACK); THEME_CLR(Theme, clrTrackItemBg, RgbShade(CLR_TRACK, 0.5)); THEME_CLR(Theme, clrTrackItemCurrentFg, CLR_BLACK); diff --git a/themes/lcarsng-meins.theme b/themes/lcarsng-meins.theme index 7d2ad15..55f0aad 100644 --- a/themes/lcarsng-meins.theme +++ b/themes/lcarsng-meins.theme @@ -68,9 +68,10 @@ clrReplayProgressRest = FFCCCCCC clrReplayProgressSelected = FF990000 clrReplayProgressMark = FF000000 clrReplayProgressCurrent = FF990000 -clrTrackFrameFg = FF000000 -clrTrackFrameBg = FFFFCC66 -clrTrackItemFg = FF000000 -clrTrackItemBg = FFFFE6B3 -clrTrackItemCurrentFg = FF000000 -clrTrackItemCurrentBg = FFFFCC66 +clrTrackFrameFg = FFFFA060 +clrTrackFrameBg = 99404040 +clrTrackFrameMg = FF604040 +clrTrackItemFg = FFFFE6B3 +clrTrackItemBg = FF404040 +clrTrackItemCurrentFg = FFFFA060 +clrTrackItemCurrentBg = FF303030 -- cgit v1.2.3