summaryrefslogtreecommitdiff
path: root/displaytracks.c
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-08-05 13:25:03 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-08-31 16:27:16 +0200
commitd376fce4dbfe89a731ab7de8fc5581968b8e2350 (patch)
tree93cc5e9623a207707f30b733a283be954480a06c /displaytracks.c
parent1603289e38cdc5904a56bed465c8a5406014ecf1 (diff)
downloadskin-lcarsng-d376fce4dbfe89a731ab7de8fc5581968b8e2350.tar.gz
skin-lcarsng-d376fce4dbfe89a731ab7de8fc5581968b8e2350.tar.bz2
Optical changes to cLCARSNGDisplayTracks
Diffstat (limited to 'displaytracks.c')
-rw-r--r--displaytracks.c83
1 files changed, 47 insertions, 36 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)