diff --git a/HISTORY b/HISTORY index aa84211..6e1152f 100644 --- a/HISTORY +++ b/HISTORY @@ -51,3 +51,4 @@ VDR Plugin 'tvguide' Revision History - added possibility to replace original VDR schedules menu - changed channel jump logic - red button also available in detail view +- page scrolling with keys left and right in detail view diff --git a/detailview.c b/detailview.c index 0ce16f0..dcca130 100644 --- a/detailview.c +++ b/detailview.c @@ -1,4 +1,3 @@ -#include "services/epgsearch.h" #include #include "detailview.h" @@ -154,6 +153,28 @@ void cDetailView::scrollDown() { } } +void cDetailView::pageUp() { + if (contentScrollable) { + int aktHeight = (-1)*content->DrawPort().Point().Y(); + int totalHeight = content->DrawPort().Height(); + int screenHeight = content->ViewPort().Height(); + int newHeight = max(aktHeight - screenHeight, 0); + content->SetDrawPortPoint(cPoint(0, (-1)*newHeight)); + drawScrollbar(); + } +} + +void cDetailView::pageDown() { + if (contentScrollable) { + int aktHeight = (-1)*content->DrawPort().Point().Y(); + int totalHeight = content->DrawPort().Height(); + int screenHeight = content->ViewPort().Height(); + int newHeight = min(aktHeight + screenHeight, totalHeight - screenHeight); + content->SetDrawPortPoint(cPoint(0, (-1)*newHeight)); + drawScrollbar(); + } +} + cImage *cDetailView::createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend) { cImage *image = new cImage(cSize(width, height)); image->Fill(clrBgr); @@ -296,6 +317,14 @@ eOSState cDetailView::ProcessKey(eKeys Key) { scrollDown(); osdManager.flush(); break; + case kLeft: + pageUp(); + osdManager.flush(); + break; + case kRight: + pageDown(); + osdManager.flush(); + break; case kOk: case kBack: state = osEnd; diff --git a/detailview.h b/detailview.h index 6b59bbb..61128e5 100644 --- a/detailview.h +++ b/detailview.h @@ -29,6 +29,10 @@ private: int heightEPGPics(void); void drawEPGPictures(int height); cImage *createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend); + void scrollUp(); + void scrollDown(); + void pageUp(); + void pageDown(); public: cDetailView(const cEvent *event); virtual ~cDetailView(void); @@ -36,8 +40,6 @@ public: void drawHeader(); void drawContent(); void drawScrollbar(); - void scrollUp(); - void scrollDown(); eOSState ProcessKey(eKeys Key); }; diff --git a/tvguideosd.c b/tvguideosd.c index b6b3c2b..0b27083 100644 --- a/tvguideosd.c +++ b/tvguideosd.c @@ -59,6 +59,7 @@ cTvguideConfig tvguideConfig; #include "osdmanager.c" cOsdManager osdManager; +#include "services/epgsearch.h" #include "tools.c" #include "switchtimer.c" #include "setup.c"