diff options
author | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-07-12 15:55:09 +0200 |
---|---|---|
committer | kamel5 <vdr.kamel5 (at) gmx (dot) net> | 2021-07-30 14:18:01 +0200 |
commit | 0c8a7aefe8185e7e967a90b29eb95e65e844a994 (patch) | |
tree | 6c6beb3d2fe095d59f6c43bfacc3b2e7159f2ba7 | |
parent | b6e1d8c80056ad8b90cca019cba69186baa4519e (diff) | |
download | skin-nopacity-0c8a7aefe8185e7e967a90b29eb95e65e844a994.tar.gz skin-nopacity-0c8a7aefe8185e7e967a90b29eb95e65e844a994.tar.bz2 |
Eliminate separate cNopacityMenuDetailTextViewLight
cNopacityMenuDetailTextViewLight and cNopacityTextView have mostly the
same funktionality, so we can eliminate the first one.
-rw-r--r-- | menudetailview.c | 45 | ||||
-rw-r--r-- | menudetailview.h | 13 |
2 files changed, 1 insertions, 57 deletions
diff --git a/menudetailview.c b/menudetailview.c index a293a6d..070fc26 100644 --- a/menudetailview.c +++ b/menudetailview.c @@ -82,7 +82,7 @@ void cNopacityDetailView::SetAlpha(int Alpha) { } void cNopacityDetailView::InitiateViewType(void) { - if (!(config.GetValue("tabsInDetailView"))) { + if (!(config.GetValue("tabsInDetailView") && !(type == dvText))) { switch (type) { case dvEvent: viewLight = new cNopacityMenuDetailEventViewLight(osd, ev, scrollBar, scrollBarBack); @@ -90,9 +90,6 @@ void cNopacityDetailView::InitiateViewType(void) { case dvRecording: viewLight = new cNopacityMenuDetailRecordingViewLight(osd, rec, scrollBar, scrollBarBack); break; - case dvText: - viewLight = new cNopacityMenuDetailTextViewLight(osd, text, scrollBar, scrollBarBack); - break; default: break; } @@ -1816,43 +1813,3 @@ int cNopacityMenuDetailRecordingViewLight::ReadSizeVdr(const char *strPath) { } return dirSize; } - -//---------------cNopacityMenuDetailTextViewLight--------------------- - -cNopacityMenuDetailTextViewLight::cNopacityMenuDetailTextViewLight(cOsd *osd, const char *text, cPixmap *s, cPixmap *sBack) : cNopacityMenuDetailViewLight(osd, s, sBack) { - this->text = text; -} - -cNopacityMenuDetailTextViewLight::~cNopacityMenuDetailTextViewLight(void) { - osd->DestroyPixmap(pixmapContent); -} - -void cNopacityMenuDetailTextViewLight::SetContent(void) { - content.Set(text, font, width - 4 * border); -} - -void cNopacityMenuDetailTextViewLight::SetContentHeight(void) { - int lineHeight = font->Height(); - int linesContent = content.Lines() + 1; - - int heightContentText = linesContent * lineHeight; - if (heightContentText > contentHeight) { - contentDrawPortHeight = heightContentText; - hasScrollbar = true; - } else { - contentDrawPortHeight = contentHeight; - } -} - -void cNopacityMenuDetailTextViewLight::CreatePixmaps(void) { - contentHeight = contentHeight - border; - pixmapContent = osd->CreatePixmap(3, cRect(x, top + headerHeight + border, width, contentHeight), - cRect(0, 0, width, contentDrawPortHeight)); - - pixmapContent->Fill(clrTransparent); -} - -void cNopacityMenuDetailTextViewLight::Render(void) { - DrawTextWrapper(&content, 0); - DrawScrollbar(); -} diff --git a/menudetailview.h b/menudetailview.h index c77ef10..19567fc 100644 --- a/menudetailview.h +++ b/menudetailview.h @@ -151,17 +151,4 @@ public: void Render(void); }; -class cNopacityMenuDetailTextViewLight : public cNopacityMenuDetailViewLight { -private: - const char *text; - cTextWrapper content; -public: - cNopacityMenuDetailTextViewLight(cOsd *osd, const char *text, cPixmap *s, cPixmap *sBack); - virtual ~cNopacityMenuDetailTextViewLight(void); - void SetContent(void); - void SetContentHeight(void); - void CreatePixmaps(void); - void Render(void); -}; - #endif //__NOPACITY_MENUDETAILVIEW_H |