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 12:04:57 +0100 |
commit | 820c96747f56de0c4857f801eb3c7e8adfc8c034 (patch) | |
tree | 1b0fcef8b5dc3f1289c677d6f7399e1c8b2c9087 | |
parent | 8edb4e42aedbe48e8c1e1d4caa54f116c83e2e18 (diff) | |
download | skin-nopacity-820c96747f56de0c4857f801eb3c7e8adfc8c034.tar.gz skin-nopacity-820c96747f56de0c4857f801eb3c7e8adfc8c034.tar.bz2 |
Use MessageBox for DisplayChannel
Also use MessageBox here to get the unified appearence of messages
everywhere.
Signed-off-by: Soeren Moch <smoch@web.de>
-rw-r--r-- | displaychannel.c | 10 | ||||
-rw-r--r-- | displaychannelview.c | 16 | ||||
-rw-r--r-- | displaychannelview.h | 4 |
3 files changed, 14 insertions, 16 deletions
diff --git a/displaychannel.c b/displaychannel.c index 3d4eed8..6a101d8 100644 --- a/displaychannel.c +++ b/displaychannel.c @@ -97,15 +97,7 @@ void cNopacityDisplayChannel::SetProgressBar(const cEvent *present) { void cNopacityDisplayChannel::SetMessage(eMessageType Type, const char *Text) { - channelView->ClearChannelLogo(); - channelView->ClearChannelName(); - channelView->ClearEPGInfo(); - channelView->ClearStatusIcons(); - channelView->ClearSourceInfo(); - channelView->ClearProgressBar(); - channelView->HideSignalMeter(); - channelView->DisplayMessage(Text); - groupSep = true; + channelView->DisplayMessage(Type, Text); } void cNopacityDisplayChannel::Flush(void) { diff --git a/displaychannelview.c b/displaychannelview.c index fcfc4f5..0d24c21 100644 --- a/displaychannelview.c +++ b/displaychannelview.c @@ -25,6 +25,7 @@ cNopacityDisplayChannelView::cNopacityDisplayChannelView(cImageCache *imgCache) pixmapSignalQuality = NULL; pixmapSignalLabel = NULL; pixmapPoster = NULL; + messageBox = NULL; } cNopacityDisplayChannelView::~cNopacityDisplayChannelView() { @@ -49,6 +50,7 @@ cNopacityDisplayChannelView::~cNopacityDisplayChannelView() { osd->DestroyPixmap(pixmapSignalLabel); if (pixmapPoster) osd->DestroyPixmap(pixmapPoster); + delete messageBox; delete osd; } @@ -69,7 +71,7 @@ void cNopacityDisplayChannelView::CreatePixmaps(void) { geoManager->channelWidth, geoManager->channelHeight) ); - pixmapTop = osd->CreatePixmap(7, + pixmapTop = osd->CreatePixmap(5, cRect(geoManager->channelX, geoManager->channelTop, geoManager->channelWidth, @@ -856,11 +858,13 @@ void cNopacityDisplayChannelView::ClearSourceInfo(void) { pixmapSourceInfo->Fill(clrTransparent); } -void cNopacityDisplayChannelView::DisplayMessage(const char *Text) { +void cNopacityDisplayChannelView::DisplayMessage(eMessageType Type, const char *Text) { + DELETENULL(messageBox); if (!Text) return; - int textWidth = fontManager->channelEPG->Width(Text); - int x = (geoManager->channelContentWidth - textWidth)/2; - int y = (geoManager->channelEpgInfoHeight - fontManager->channelEPG->Height())/2; - pixmapEPGInfo->DrawText(cPoint(x, y), Text, Theme.Color(clrChannelEPG), clrTransparent, fontManager->channelEPG); + messageBox = new cNopacityMessageBox(osd, imgCache, + cRect((geoManager->channelWidth - geoManager->messageWidth) / 2, + geoManager->channelTop + geoManager->channelHeight - geoManager->messageHeight - 20, + geoManager->messageWidth, geoManager->messageHeight), + Type, Text); } diff --git a/displaychannelview.h b/displaychannelview.h index 38f2401..076270b 100644 --- a/displaychannelview.h +++ b/displaychannelview.h @@ -2,6 +2,7 @@ #define __NOPACITY_DISPLAYCHANNELVIEW_H #include "imagecache.h" +#include "messagebox.h" #include <vdr/osd.h> class cNopacityDisplayChannelView { @@ -32,6 +33,7 @@ private: cPixmap *pixmapSignalLabel; cPixmap *pixmapSourceInfo; cPixmap *pixmapPoster; + cNopacityMessageBox *messageBox; tColor DrawProgressbarProgress(int left, int top, int width, int height); cString GetScreenResolutionIcon(void); std::string GetChannelSep(const cChannel *channel, bool prev); @@ -64,7 +66,7 @@ public: void DrawChannelGroups(const cChannel *Channel, cString ChannelName); void DrawSourceInfo(void); void ClearSourceInfo(void); - void DisplayMessage(const char *Text); + void DisplayMessage(eMessageType Type, const char *Text); void Flush(void) { osd->Flush(); }; }; #endif //__NOPACITY_DISPLAYCHANNELVIEW_H |