diff options
author | louis <louis.braun@gmx.de> | 2013-07-17 16:43:57 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-07-17 16:43:57 +0200 |
commit | 780e17395fbf1edad05bc160233186601a4ebbb7 (patch) | |
tree | 7133a3d2321142c13b43c42bfd565b8adc529115 | |
parent | 40825804445fc2df30783c09b6c97c4204881242 (diff) | |
download | vdr-plugin-tvguide-780e17395fbf1edad05bc160233186601a4ebbb7.tar.gz vdr-plugin-tvguide-780e17395fbf1edad05bc160233186601a4ebbb7.tar.bz2 |
page scrolling with keys left and right in detail view
-rw-r--r-- | HISTORY | 1 | ||||
-rw-r--r-- | detailview.c | 31 | ||||
-rw-r--r-- | detailview.h | 6 | ||||
-rw-r--r-- | tvguideosd.c | 1 |
4 files changed, 36 insertions, 3 deletions
@@ -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 <sstream> #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"
|