1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

cOsdMenu::Display() now checks whether the OSD size has changed and if so calls SetDisplayMenu()

This commit is contained in:
Klaus Schmidinger 2017-04-03 12:49:56 +02:00
parent 792b9dc45f
commit e622854789
5 changed files with 19 additions and 9 deletions

View File

@ -8951,3 +8951,5 @@ Video Disk Recorder Revision History
- Added a note to the "Pausing live video" section of the MANUAL, stating that
the timer for paused live video will always record on the local VDR, even if
an "SVDRP default host" has been set for normal timer recordings.
- cOsdMenu::Display() now checks whether the OSD size has changed and if so calls
SetDisplayMenu().

7
menu.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: menu.c 4.23 2017/03/30 15:15:03 kls Exp $
* $Id: menu.c 4.24 2017/04/03 12:26:23 kls Exp $
*/
#include "menu.h"
@ -3347,10 +3347,8 @@ eOSState cMenuSetupOSD::ProcessKey(eKeys Key)
int oldOsdLanguageIndex = osdLanguageIndex;
eOSState state = cMenuSetupBase::ProcessKey(Key);
if (ModifiedAppearance) {
if (ModifiedAppearance)
cOsdProvider::UpdateOsdSize(true);
SetDisplayMenu();
}
if (osdLanguageIndex != oldOsdLanguageIndex || skinIndex != oldSkinIndex) {
strn0cpy(data.OSDLanguage, I18nLocale(osdLanguageIndex), sizeof(data.OSDLanguage));
@ -4107,7 +4105,6 @@ eOSState cMenuSetupPlugins::ProcessKey(eKeys Key)
Store();
// Reinitialize OSD and skin, in case any plugin setup change has an influence on these:
cOsdProvider::UpdateOsdSize(true);
SetDisplayMenu();
Display();
}
}

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osdbase.c 4.1 2015/09/10 11:23:07 kls Exp $
* $Id: osdbase.c 4.2 2017/04/03 12:30:52 kls Exp $
*/
#include "osdbase.h"
@ -77,6 +77,7 @@ void cOsdObject::Show(void)
cSkinDisplayMenu *cOsdMenu::displayMenu = NULL;
int cOsdMenu::displayMenuCount = 0;
int cOsdMenu::osdState = 0;
cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4)
{
@ -96,8 +97,10 @@ cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4)
helpRed = helpGreen = helpYellow = helpBlue = NULL;
helpDisplayed = false;
status = NULL;
if (!displayMenuCount++)
if (!displayMenuCount++) {
cOsdProvider::OsdSizeChanged(osdState); // to get the current state
SetDisplayMenu();
}
}
cOsdMenu::~cOsdMenu()
@ -226,6 +229,8 @@ void cOsdMenu::Display(void)
subMenu->Display();
return;
}
if (cOsdProvider::OsdSizeChanged(osdState))
SetDisplayMenu();
displayMenu->SetMessage(mtStatus, NULL);
displayMenu->Clear();
cStatus::MsgOsdClear();

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osdbase.h 4.1 2015/09/10 11:17:52 kls Exp $
* $Id: osdbase.h 4.2 2017/04/03 12:02:16 kls Exp $
*/
#ifndef __OSDBASE_H
@ -87,6 +87,7 @@ class cOsdMenu : public cOsdObject, public cList<cOsdItem> {
private:
static cSkinDisplayMenu *displayMenu;
static int displayMenuCount;
static int osdState;
int displayMenuItems;
char *title;
int cols[cSkinDisplayMenu::MaxTabs];

7
vdr.c
View File

@ -22,7 +22,7 @@
*
* The project's page is at http://www.tvdr.de
*
* $Id: vdr.c 4.11 2017/03/25 14:20:30 kls Exp $
* $Id: vdr.c 4.12 2017/04/03 12:35:37 kls Exp $
*/
#include <getopt.h>
@ -986,6 +986,11 @@ int main(int argc, char *argv[])
static time_t lastOsdSizeUpdate = 0;
if (Now != lastOsdSizeUpdate) { // once per second
cOsdProvider::UpdateOsdSize();
static int OsdState = 0;
if (cOsdProvider::OsdSizeChanged(OsdState)) {
if (cOsdMenu *OsdMenu = dynamic_cast<cOsdMenu *>(Menu))
OsdMenu->Display();
}
lastOsdSizeUpdate = Now;
}
}