summaryrefslogtreecommitdiff
path: root/tvguideosd.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2014-01-02 11:45:43 +0100
committerlouis <louis.braun@gmx.de>2014-01-02 11:45:43 +0100
commit45428b5162afea4bb318222c7f2a37e2c7dfb6ba (patch)
tree78cea7ffcbdfb075f44d5b3745d639ef327da4d5 /tvguideosd.c
parente6335e9c4499bb1eae8e8115ae6ce26e878aa344 (diff)
downloadvdr-plugin-tvguide-45428b5162afea4bb318222c7f2a37e2c7dfb6ba.tar.gz
vdr-plugin-tvguide-45428b5162afea4bb318222c7f2a37e2c7dfb6ba.tar.bz2
Current channel positioned in middle of channellist when tvguide is opened
Diffstat (limited to 'tvguideosd.c')
-rw-r--r--tvguideosd.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/tvguideosd.c b/tvguideosd.c
index 34a1d5a..a10cd01 100644
--- a/tvguideosd.c
+++ b/tvguideosd.c
@@ -74,6 +74,22 @@ void cTvGuideOsd::Show(void) {
void cTvGuideOsd::drawOsd() {
cPixmap::Lock();
cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel());
+ int numBack = tvguideConfig.numGrids / 2;
+ int offset = 0;
+ const cChannel *newStartChannel = startChannel;
+ for (; newStartChannel ; newStartChannel = Channels.Prev(newStartChannel)) {
+ if (newStartChannel && !newStartChannel->GroupSep()) {
+ offset++;
+ }
+ if (offset == numBack)
+ break;
+ }
+ if (!newStartChannel)
+ newStartChannel = Channels.First();
+ offset--;
+ if (offset < 0)
+ offset = 0;
+
if (tvguideConfig.displayStatusHeader) {
statusHeader = new cStatusHeader();
statusHeader->Draw();
@@ -94,8 +110,8 @@ void cTvGuideOsd::drawOsd() {
}
footer->drawBlueButton();
osdManager.flush();
- readChannels(startChannel);
- drawGridsChannelJump();
+ readChannels(newStartChannel);
+ drawGridsChannelJump(offset);
osdManager.flush();
cPixmap::Unlock();
}