mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Current channel positioned in middle of channellist when tvguide is opened
This commit is contained in:
parent
e6335e9c44
commit
45428b5162
2
HISTORY
2
HISTORY
@ -98,3 +98,5 @@ Version 1.1.0
|
|||||||
Tickets 1480 and 1486)
|
Tickets 1480 and 1486)
|
||||||
- Added possibility to search for reruns in case of a timer conflict
|
- Added possibility to search for reruns in case of a timer conflict
|
||||||
- Added timer Timeline view in red button recording menu
|
- Added timer Timeline view in red button recording menu
|
||||||
|
- Current channel positioned in middle of channellist when tvguide is
|
||||||
|
opened
|
||||||
|
20
tvguideosd.c
20
tvguideosd.c
@ -74,6 +74,22 @@ void cTvGuideOsd::Show(void) {
|
|||||||
void cTvGuideOsd::drawOsd() {
|
void cTvGuideOsd::drawOsd() {
|
||||||
cPixmap::Lock();
|
cPixmap::Lock();
|
||||||
cChannel *startChannel = Channels.GetByNumber(cDevice::CurrentChannel());
|
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) {
|
if (tvguideConfig.displayStatusHeader) {
|
||||||
statusHeader = new cStatusHeader();
|
statusHeader = new cStatusHeader();
|
||||||
statusHeader->Draw();
|
statusHeader->Draw();
|
||||||
@ -94,8 +110,8 @@ void cTvGuideOsd::drawOsd() {
|
|||||||
}
|
}
|
||||||
footer->drawBlueButton();
|
footer->drawBlueButton();
|
||||||
osdManager.flush();
|
osdManager.flush();
|
||||||
readChannels(startChannel);
|
readChannels(newStartChannel);
|
||||||
drawGridsChannelJump();
|
drawGridsChannelJump(offset);
|
||||||
osdManager.flush();
|
osdManager.flush();
|
||||||
cPixmap::Unlock();
|
cPixmap::Unlock();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user