diff options
-rw-r--r-- | displaymenu.c | 9 | ||||
-rw-r--r-- | displaymenuview.c | 31 | ||||
-rw-r--r-- | displaymenuview.h | 3 | ||||
-rw-r--r-- | menudetailview.c | 40 | ||||
-rw-r--r-- | menudetailview.h | 4 |
5 files changed, 31 insertions, 56 deletions
diff --git a/displaymenu.c b/displaymenu.c index 6fa5af1..da3ae7b 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -617,8 +617,7 @@ void cNopacityDisplayMenu::SetEvent(const cEvent *Event) { if (!Event) return; menuView->AdjustContentBackground(this->MenuCategory(), menuCategoryLast, videoWindowRect); - detailView = new cNopacityDetailView(dvEvent, osd); - menuView->SetDetailViewSize(dvEvent, detailView); + detailView = new cNopacityDetailView(dvEvent, osd, menuView->GetPixmapScrollbar(), menuView->GetPixmapScrollbarBack()); detailView->SetEvent(Event); detailView->Start(); } @@ -631,8 +630,7 @@ void cNopacityDisplayMenu::SetRecording(const cRecording *Recording) { return; } menuView->AdjustContentBackground(this->MenuCategory(), menuCategoryLast, videoWindowRect); - detailView = new cNopacityDetailView(dvRecording, osd); - menuView->SetDetailViewSize(dvRecording, detailView); + detailView = new cNopacityDetailView(dvRecording, osd, menuView->GetPixmapScrollbar(), menuView->GetPixmapScrollbarBack()); detailView->SetRecording(Recording); detailView->Start(); } @@ -641,8 +639,7 @@ void cNopacityDisplayMenu::SetText(const char *Text, bool FixedFont) { if (!Text) return; menuView->AdjustContentBackground(this->MenuCategory(), menuCategoryLast, videoWindowRect); - detailView = new cNopacityDetailView(dvText, osd); - menuView->SetDetailViewSize(dvText, detailView); + detailView = new cNopacityDetailView(dvText, osd, menuView->GetPixmapScrollbar(), menuView->GetPixmapScrollbarBack()); detailView->SetText(Text); detailView->Start(); } diff --git a/displaymenuview.c b/displaymenuview.c index 7b72b74..cd18b83 100644 --- a/displaymenuview.c +++ b/displaymenuview.c @@ -667,34 +667,3 @@ void cNopacityDisplayMenuView::DrawMessage(eMessageType Type, const char *Text) geoManager->messageWidth, geoManager->messageHeight), Type, Text, true); } - -void cNopacityDisplayMenuView::SetDetailViewSize(eDetailViewType detailViewType, cNopacityDetailView *detailView) { - int x = (config.GetValue("menuAdjustLeft")) ? 0 : geoManager->osdWidth - geoManager->menuContentWidthFull + 2*geoManager->menuSpace; - int width = 0; - int height = 0; - int top = 0; - int contentBorder = 30; - int detailHeaderHeight = 0; - - width = geoManager->menuContentWidthFull - 2*geoManager->menuSpace; - height = geoManager->menuContentHeight; - top = geoManager->menuHeaderHeight; - - switch (detailViewType) { - case dvEvent: - detailHeaderHeight = config.GetValue("headerDetailedEPG") * height / 100; - contentBorder = config.GetValue("borderDetailedEPG"); - break; - case dvRecording: - detailHeaderHeight = config.GetValue("headerDetailedRecordings") * height / 100; - contentBorder = config.GetValue("borderDetailedRecordings"); - break; - case dvText: - detailHeaderHeight = 0; - break; - default: - break; - } - detailView->SetGeometry(x, width, height, top, contentBorder, detailHeaderHeight); - detailView->SetScrollBar(pixmapScrollbar, pixmapScrollbarBack); -} diff --git a/displaymenuview.h b/displaymenuview.h index 6f5f094..725d39f 100644 --- a/displaymenuview.h +++ b/displaymenuview.h @@ -75,7 +75,8 @@ class cNopacityDisplayMenuView { void DrawScrollbar(double Height, double Offset); void ClearScrollbar(void); void DrawMessage(eMessageType Type, const char *Text); - void SetDetailViewSize(eDetailViewType detailViewType, cNopacityDetailView *detailView); + cPixmap *GetPixmapScrollbar(void) { return pixmapScrollbar; }; + cPixmap *GetPixmapScrollbarBack(void) { return pixmapScrollbarBack; }; }; diff --git a/menudetailview.c b/menudetailview.c index cb11226..26840d8 100644 --- a/menudetailview.c +++ b/menudetailview.c @@ -3,19 +3,36 @@ /******************************************************************************************** * cNopacityDetailView ********************************************************************************************/ -cNopacityDetailView::cNopacityDetailView(eDetailViewType detailViewType, cOsd *osd) { +cNopacityDetailView::cNopacityDetailView(eDetailViewType detailViewType, cOsd *osd, cPixmap *s, cPixmap *sBack) { type = detailViewType; this->osd = osd; + this->scrollBar = s; + this->scrollBarBack = sBack; ev = NULL; rec = NULL; text = NULL; view = NULL; - x = 0; - width = 0; - height = 0; - top = 0; - border = 0; + x = (config.GetValue("menuAdjustLeft")) ? 0 : geoManager->osdWidth - geoManager->menuContentWidthFull + 2 * geoManager->menuSpace; + width = geoManager->menuContentWidthFull - 2 * geoManager->menuSpace; + height = geoManager->menuContentHeight; + top = geoManager->menuHeaderHeight; + border = 30; headerHeight = 0; + switch (type) { + case dvEvent: + headerHeight = config.GetValue("headerDetailedEPG") * height / 100; + border = config.GetValue("borderDetailedEPG"); + break; + case dvRecording: + headerHeight = config.GetValue("headerDetailedRecordings") * height / 100; + border = config.GetValue("borderDetailedRecordings"); + break; + case dvText: + headerHeight = 0; + break; + default: + break; + } } cNopacityDetailView::~cNopacityDetailView(void) { @@ -26,15 +43,6 @@ cNopacityDetailView::~cNopacityDetailView(void) { delete view; } -void cNopacityDetailView::SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight) { - this->x = x; - this->width = width; - this->height = height; - this->top = top; - this->border = contentBorder; - this->headerHeight = headerHeight; -} - void cNopacityDetailView::InitiateViewType(void) { static cPlugin *pScraper = GetScraperPlugin(); ScraperGetEventType call; @@ -122,12 +130,14 @@ void cNopacityDetailView::KeyInput(bool Up, bool Page) { } else if (Up && !Page) { bool scrolled = view->KeyUp(); if (scrolled) { + view->SetScrollbarPixmaps(scrollBar, scrollBarBack); view->DrawScrollbar(); osd->Flush(); } }else if (!Up && !Page) { bool scrolled = view->KeyDown(); if (scrolled) { + view->SetScrollbarPixmaps(scrollBar, scrollBarBack); view->DrawScrollbar(); osd->Flush(); } diff --git a/menudetailview.h b/menudetailview.h index 593435b..7ced971 100644 --- a/menudetailview.h +++ b/menudetailview.h @@ -38,13 +38,11 @@ protected: int ReadSizeVdr(const char *strPath); virtual void Action(void); public: - cNopacityDetailView(eDetailViewType detailViewType, cOsd *osd); + cNopacityDetailView(eDetailViewType detailViewType, cOsd *osd, cPixmap *s, cPixmap *sBack); virtual ~cNopacityDetailView(void); - void SetGeometry(int x, int width, int height, int top, int contentBorder, int headerHeight); void SetEvent(const cEvent *e) { ev = e; }; void SetRecording(const cRecording *r) { rec = r; }; void SetText(const char *t) { text = t; }; - void SetScrollBar(cPixmap *s, cPixmap *sBack) { scrollBar = s; scrollBarBack = sBack; }; void KeyInput(bool Up, bool Page); }; |