summaryrefslogtreecommitdiff
path: root/detailview.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-07-17 16:43:57 +0200
committerlouis <louis.braun@gmx.de>2013-07-17 16:43:57 +0200
commit780e17395fbf1edad05bc160233186601a4ebbb7 (patch)
tree7133a3d2321142c13b43c42bfd565b8adc529115 /detailview.c
parent40825804445fc2df30783c09b6c97c4204881242 (diff)
downloadvdr-plugin-tvguide-780e17395fbf1edad05bc160233186601a4ebbb7.tar.gz
vdr-plugin-tvguide-780e17395fbf1edad05bc160233186601a4ebbb7.tar.bz2
page scrolling with keys left and right in detail view
Diffstat (limited to 'detailview.c')
-rw-r--r--detailview.c31
1 files changed, 30 insertions, 1 deletions
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;