diff --git a/HISTORY b/HISTORY index 7434cf2..a1ad8ef 100644 --- a/HISTORY +++ b/HISTORY @@ -272,3 +272,5 @@ Version 0.4.0 its own time display - fixed bug that date was drawn every flush in displayreplay - fixed bug in metrixhd timers menu +- fixed bug that datetime was not correctly drawn if a submenu implements + its own datetime display diff --git a/views/displaymenurootview.c b/views/displaymenurootview.c index 311a1e5..5d429cd 100644 --- a/views/displaymenurootview.c +++ b/views/displaymenurootview.c @@ -479,15 +479,17 @@ bool cDisplayMenuRootView::RenderDynamicElements(void) { defaultTimeDrawn = true; updated = true; } - if (view->DrawDynamicViewElements()){ - updated = true; + + implemented = false; + if (view->DrawDateTime(implemented)) { + defaultDateTimeDrawn = false; + } else if (!implemented) { + DrawDateTime(); + defaultDateTimeDrawn = true; } - if (!view->DrawDateTime()) { - defaultDateTimeDrawn = true; - DrawDateTime(); - } else { - defaultDateTimeDrawn = false; + if (view->DrawDynamicViewElements()){ + updated = true; } return updated; diff --git a/views/displaymenuview.c b/views/displaymenuview.c index 3056cd5..f1fb7de 100644 --- a/views/displaymenuview.c +++ b/views/displaymenuview.c @@ -46,11 +46,11 @@ bool cDisplayMenuView::DrawHeader(void) { return true; } -bool cDisplayMenuView::DrawDateTime(void) { +bool cDisplayMenuView::DrawDateTime(bool &implemented) { if (!ExecuteViewElement(veDateTime)) { return false; } - + implemented = true; map < string, string > stringTokens; map < string, int > intTokens; @@ -67,7 +67,6 @@ bool cDisplayMenuView::DrawTime(bool &implemented) { if (!ExecuteViewElement(veTime)) { return false; } - implemented = true; map < string, string > stringTokens; map < string, int > intTokens; diff --git a/views/displaymenuview.h b/views/displaymenuview.h index bddfafa..52b3479 100644 --- a/views/displaymenuview.h +++ b/views/displaymenuview.h @@ -37,7 +37,7 @@ public: void SetButtonTexts(string *buttonTexts) { this->buttonTexts = buttonTexts; }; bool DrawBackground(void); virtual bool DrawHeader(void); - bool DrawDateTime(void); + bool DrawDateTime(bool &implemented); bool DrawTime(bool &implemented); bool DrawColorButtons(void); bool DrawMessage(eMessageType type, const char *text);