diff options
author | Soeren Moch <smoch@web.de> | 2021-02-13 14:03:29 +0100 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-02-16 11:57:40 +0100 |
commit | 6bd0b842406f3098753161601899aefb680bd32c (patch) | |
tree | 16a5c0d5afda1d94f7c5a275f2dc599bc3121bf5 | |
parent | f0da5c8eacd54de7346bc000e86ad90ca0d18003 (diff) | |
download | skin-nopacity-6bd0b842406f3098753161601899aefb680bd32c.tar.gz skin-nopacity-6bd0b842406f3098753161601899aefb680bd32c.tar.bz2 |
Use MessageBox for DisplayReplay
Besides the unified message view this fixes a segfault when displaying
a message with modeOnly display.
Signed-off-by: Soeren Moch <smoch@web.de>
-rw-r--r-- | displayreplay.c | 28 | ||||
-rw-r--r-- | displayreplay.h | 5 |
2 files changed, 14 insertions, 19 deletions
diff --git a/displayreplay.c b/displayreplay.c index 1010723..9cf0d29 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -14,6 +14,7 @@ cNopacityDisplayReplay::cNopacityDisplayReplay(cImageCache *imgCache, bool ModeO CreatePixmaps(); DrawBackground(); LoadControlIcons(); + messageBox = NULL; } cNopacityDisplayReplay::~cNopacityDisplayReplay() { @@ -32,13 +33,13 @@ cNopacityDisplayReplay::~cNopacityDisplayReplay() { osd->DestroyPixmap(pixmapScreenResBackground); osd->DestroyPixmap(pixmapScreenRes); osd->DestroyPixmap(pixmapJump); - osd->DestroyPixmap(pixmapMessage); } osd->DestroyPixmap(pixmapControls); osd->DestroyPixmap(pixmapRew); osd->DestroyPixmap(pixmapPause); osd->DestroyPixmap(pixmapPlay); osd->DestroyPixmap(pixmapFwd); + delete messageBox; delete osd; } @@ -59,7 +60,7 @@ void cNopacityDisplayReplay::CreatePixmaps(void) { 0, geoManager->replayWidth, geoManager->replayHeight)); - pixmapTop = osd->CreatePixmap(7, cRect(0, + pixmapTop = osd->CreatePixmap(5, cRect(0, 0, geoManager->replayWidth, geoManager->replayHeight)); @@ -92,11 +93,11 @@ void cNopacityDisplayReplay::CreatePixmaps(void) { + geoManager->replayProgressBarHeight, geoManager->replayWidth/5, geoManager->replayCurrentHeight)); - pixmapScreenResBackground = osd->CreatePixmap(5, cRect(geoManager->replayResolutionX - 10, + pixmapScreenResBackground = osd->CreatePixmap(3, cRect(geoManager->replayResolutionX - 10, geoManager->replayResolutionY - 5, geoManager->replayResolutionSize * 3 + 20, geoManager->replayResolutionSize + 10)); - pixmapScreenRes = osd->CreatePixmap(6, cRect(geoManager->replayResolutionX, + pixmapScreenRes = osd->CreatePixmap(4, cRect(geoManager->replayResolutionX, geoManager->replayResolutionY, geoManager->replayResolutionSize * 3, geoManager->replayResolutionSize)); @@ -104,10 +105,6 @@ void cNopacityDisplayReplay::CreatePixmaps(void) { geoManager->replayJumpY, geoManager->replayJumpWidth, geoManager->replayJumpHeight)); - pixmapMessage = osd->CreatePixmap(4, cRect(0, - geoManager->replayMessageY, - geoManager->replayMessageWidth, - geoManager->replayMessageHeight)); } int controlY = geoManager->replayHeaderHeight @@ -160,7 +157,6 @@ void cNopacityDisplayReplay::CreatePixmaps(void) { pixmapScreenResBackground->SetAlpha(0); pixmapScreenRes->SetAlpha(0); pixmapJump->SetAlpha(0); - pixmapMessage->SetAlpha(0); } pixmapControls->SetAlpha(0); pixmapRew->SetAlpha(0); @@ -219,7 +215,6 @@ void cNopacityDisplayReplay::DrawBackground(void) { pixmapScreenResBackground->Fill(clrTransparent); pixmapScreenRes->Fill(clrTransparent); pixmapJump->Fill(clrTransparent); - pixmapMessage->Fill(clrTransparent); } else { pixmapControls->Fill(Theme.Color(clrMenuBorder)); pixmapControls->DrawRectangle(cRect(2, 2, pixmapControls->ViewPort().Width() - 4, pixmapControls->ViewPort().Height() - 4),Theme.Color(clrReplayBackground)); @@ -470,14 +465,14 @@ void cNopacityDisplayReplay::SetJump(const char *Jump) { } void cNopacityDisplayReplay::SetMessage(eMessageType Type, const char *Text) { - pixmapMessage->Fill(clrTransparent); + DELETENULL(messageBox); if (!Text) return; - pixmapMessage->DrawText(cPoint(geoManager->replayMessageHeight/2, 0), - Text, - Theme.Color(clrReplayHead), - clrTransparent, - fontManager->replayHeader); + messageBox = new cNopacityMessageBox(osd, imgCache, + cRect((geoManager->replayWidth - geoManager->messageWidth) / 2, + geoManager->replayHeight - geoManager->messageHeight - 20, + geoManager->messageWidth, geoManager->messageHeight), + Type, Text); } void cNopacityDisplayReplay::Flush(void) { @@ -512,7 +507,6 @@ void cNopacityDisplayReplay::Action(void) { pixmapScreenResBackground->SetAlpha(Alpha); pixmapScreenRes->SetAlpha(Alpha); pixmapJump->SetAlpha(Alpha); - pixmapMessage->SetAlpha(Alpha); } pixmapControls->SetAlpha(Alpha); diff --git a/displayreplay.h b/displayreplay.h index 9ada0fc..2d160c6 100644 --- a/displayreplay.h +++ b/displayreplay.h @@ -4,6 +4,7 @@ #include <vdr/skins.h> #include <vdr/thread.h> #include "imagecache.h" +#include "messagebox.h" class cNopacityDisplayReplay : public cSkinDisplayReplay , cThread{ private: @@ -30,7 +31,7 @@ private: cPixmap *pixmapPlay; cPixmap *pixmapFwd; cPixmap *pixmapJump; - cPixmap *pixmapMessage; + cNopacityMessageBox *messageBox; virtual void Action(void); void createOSD(void); void CreatePixmaps(void); @@ -52,4 +53,4 @@ public: virtual void Flush(void); }; -#endif //__NOPACITY_DISPLAYREPLAY_H
\ No newline at end of file +#endif //__NOPACITY_DISPLAYREPLAY_H |