summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY4
-rw-r--r--textwindow.c11
-rw-r--r--textwindow.h1
-rw-r--r--timers.c14
-rw-r--r--timers.h1
5 files changed, 25 insertions, 6 deletions
diff --git a/HISTORY b/HISTORY
index 1edc007..0728b23 100644
--- a/HISTORY
+++ b/HISTORY
@@ -181,4 +181,6 @@ Version 0.1.1
separator logos
- time display for current schedule in channel display configurable
(elapsed / remaining)
-- fixed a bug that extraIcons directory was not used
+- fixed a bug that extraIcons directory was not used
+- added background pixmaps for main menu timers and epg info window
+ to avoid nasty font pixelation effect
diff --git a/textwindow.c b/textwindow.c
index 72f3c1b..26e4134 100644
--- a/textwindow.c
+++ b/textwindow.c
@@ -3,6 +3,7 @@
cNopacityTextWindow::cNopacityTextWindow(cOsd *osd, cFont *font) {
this->osd = osd;
this->font = font;
+ pixmapBackground = NULL;
pixmap = NULL;
}
@@ -10,6 +11,10 @@ cNopacityTextWindow::~cNopacityTextWindow(void) {
Cancel(-1);
while (Active())
cCondWait::SleepMs(10);
+ if (pixmapBackground) {
+ osd->DestroyPixmap(pixmapBackground);
+ pixmapBackground = NULL;
+ }
if (pixmap) {
osd->DestroyPixmap(pixmap);
pixmap = NULL;
@@ -27,8 +32,11 @@ bool cNopacityTextWindow::CreatePixmap(int border) {
scrolling = true;
}
cPixmap::Lock();
- pixmap = osd->CreatePixmap(4, cRect(geometry->X(), geometry->Y(), geometry->Width(), geometry->Height()),
+ pixmapBackground = osd->CreatePixmap(4, cRect(geometry->X(), geometry->Y(), geometry->Width(), geometry->Height()));
+ pixmap = osd->CreatePixmap(5, cRect(geometry->X(), geometry->Y(), geometry->Width(), geometry->Height()),
cRect(0, 0, geometry->Width(), drawportHeight));
+ pixmapBackground->SetAlpha(0);
+ pixmapBackground->Fill(clrBlack);
pixmap->SetAlpha(0);
pixmap->Fill(Theme.Color(clrMenuBorder));
pixmap->DrawRectangle(cRect(1, 1, geometry->Width()-2, drawportHeight-2), Theme.Color(clrMenuBack));
@@ -74,6 +82,7 @@ void cNopacityTextWindow::Action(void) {
cPixmap::Lock();
double t = min(double(Now - Start) / FadeTime, 1.0);
int Alpha = t * ALPHA_OPAQUE;
+ pixmapBackground->SetAlpha(Alpha);
pixmap->SetAlpha(Alpha);
if (Running())
osd->Flush();
diff --git a/textwindow.h b/textwindow.h
index 09fedc4..c9bd469 100644
--- a/textwindow.h
+++ b/textwindow.h
@@ -4,6 +4,7 @@ class cNopacityTextWindow : public cThread {
private:
cOsd *osd;
cFont *font;
+ cPixmap *pixmapBackground;
cPixmap *pixmap;
cRect *geometry;
const char *text;
diff --git a/timers.c b/timers.c
index d9955b4..2199a72 100644
--- a/timers.c
+++ b/timers.c
@@ -17,6 +17,7 @@ cNopacityTimer::cNopacityTimer(cOsd *osd, int numConflicts, const cFont *font, c
}
cNopacityTimer::~cNopacityTimer(void) {
+ osd->DestroyPixmap(pixmapBackground);
osd->DestroyPixmap(pixmap);
osd->DestroyPixmap(pixmapLogo);
}
@@ -27,16 +28,19 @@ void cNopacityTimer::SetGeometry(int width, int y) {
}
void cNopacityTimer::SetAlpha(int alpha) {
+ pixmapBackground->SetAlpha(alpha);
pixmap->SetAlpha(alpha);
pixmapLogo->SetAlpha(alpha);
}
void cNopacityTimer::Show(void) {
- pixmap->SetLayer(2);
- pixmapLogo->SetLayer(3);
+ pixmapBackground->SetLayer(2);
+ pixmap->SetLayer(3);
+ pixmapLogo->SetLayer(4);
}
void cNopacityTimer::Hide(void) {
+ pixmapBackground->SetLayer(-1);
pixmap->SetLayer(-1);
pixmapLogo->SetLayer(-1);
}
@@ -102,11 +106,13 @@ void cNopacityTimer::CalculateHeight(int space) {
}
void cNopacityTimer::CreatePixmaps(int x) {
- pixmap = osd->CreatePixmap(2, cRect(x, y, width, height));
- pixmapLogo = osd->CreatePixmap(3, cRect(x, y, width, height));
+ pixmapBackground = osd->CreatePixmap(2, cRect(x, y, width, height));
+ pixmap = osd->CreatePixmap(3, cRect(x, y, width, height));
+ pixmapLogo = osd->CreatePixmap(4, cRect(x, y, width, height));
}
void cNopacityTimer::Render(void) {
+ pixmapBackground->Fill(clrBlack);
cImageLoader imgLoader;
if (isTimerConflict) {
pixmapLogo->Fill(clrTransparent);
diff --git a/timers.h b/timers.h
index 423b4f8..dcb1935 100644
--- a/timers.h
+++ b/timers.h
@@ -4,6 +4,7 @@
class cNopacityTimer : public cListObject {
private:
cOsd *osd;
+ cPixmap *pixmapBackground;
cPixmap *pixmap;
cPixmap *pixmapLogo;
const cTimer *timer;