fixed bug that time was not correctly drawn if a submenu implements its own time display

This commit is contained in:
louis 2015-04-03 15:42:08 +02:00
parent 54ca48045a
commit f1d5367a53
6 changed files with 15 additions and 6 deletions

View File

@ -268,3 +268,5 @@ Version 0.3.4
Version 0.4.0
- fixed bug that time was not correctly drawn if a submenu implements
its own time display

View File

@ -5,8 +5,7 @@
</area>
</header>
<scrollbar>
<scrollbar>
<area x="52%" y="10%" width="2%" height="80%" layer="2">
<drawimage imagetype="skinpart" path="scrollbarback" x="0" y="0" width="100%" height="100%"/>
</area>

View File

@ -29,6 +29,7 @@ cDisplayMenuRootView::cDisplayMenuRootView(cTemplateView *rootView) : cView(root
defaultHeaderDrawn = false;
defaultButtonsDrawn = false;
defaultDateTimeDrawn = false;
defaultTimeDrawn = false;
defaultMessageDrawn = false;
defaultSortmodeDrawn = false;
DeleteOsdOnExit();
@ -364,6 +365,8 @@ void cDisplayMenuRootView::ClearRootView(void) {
ClearViewElement(veButtons);
if (defaultDateTimeDrawn)
ClearViewElement(veDateTime);
if (defaultTimeDrawn)
ClearViewElement(veTime);
if (defaultMessageDrawn)
ClearViewElement(veMessage);
if (defaultSortmodeDrawn)
@ -468,9 +471,12 @@ bool cDisplayMenuRootView::RenderDynamicElements(void) {
if (!view)
return false;
bool updated = false;
if (view->DrawTime()) {
bool implemented = false;
if (view->DrawTime(implemented)) {
defaultTimeDrawn = false;
updated = true;
} else if (DrawTime()) {
} else if (!implemented && DrawTime()) {
defaultTimeDrawn = true;
updated = true;
}
if (view->DrawDynamicViewElements()){

View File

@ -34,6 +34,7 @@ private:
bool defaultHeaderDrawn;
bool defaultButtonsDrawn;
bool defaultDateTimeDrawn;
bool defaultTimeDrawn;
bool defaultMessageDrawn;
bool defaultSortmodeDrawn;
void DrawBackground(void);

View File

@ -63,11 +63,12 @@ bool cDisplayMenuView::DrawDateTime(void) {
return true;
}
bool cDisplayMenuView::DrawTime(void) {
bool cDisplayMenuView::DrawTime(bool &implemented) {
if (!ExecuteViewElement(veTime)) {
return false;
}
implemented = true;
map < string, string > stringTokens;
map < string, int > intTokens;

View File

@ -38,7 +38,7 @@ public:
bool DrawBackground(void);
virtual bool DrawHeader(void);
bool DrawDateTime(void);
bool DrawTime(void);
bool DrawTime(bool &implemented);
bool DrawColorButtons(void);
bool DrawMessage(eMessageType type, const char *text);
void DrawScrollbar(int numMax, int numDisplayed, int offset);