From e7abb8557eb8397172a360845b7ac5f7607ca158 Mon Sep 17 00:00:00 2001 From: louis Date: Tue, 18 Nov 2014 18:33:27 +0100 Subject: [PATCH] clearing displaymessage if it is called without text --- HISTORY | 1 + displaymessage.c | 4 +++- views/displaymessageview.c | 4 ++++ views/displaymessageview.h | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/HISTORY b/HISTORY index 981d680..8973546 100644 --- a/HISTORY +++ b/HISTORY @@ -86,3 +86,4 @@ Version 0.0.5 - fixed {hasicon} Token in displaymenu header - added {newmails} Token in displaychannel statusinfo, mailbox plugin has to be installed +- clearing displaymessage if it is called without text diff --git a/displaymessage.c b/displaymessage.c index f64a898..9d2ebed 100644 --- a/displaymessage.c +++ b/displaymessage.c @@ -25,8 +25,10 @@ cSDDisplayMessage::~cSDDisplayMessage() { void cSDDisplayMessage::SetMessage(eMessageType Type, const char *Text) { if (!doOutput) return; - if (!Text) + if (!Text) { + messageView->ClearMessage(); return; + } messageView->DrawMessage(Type, Text); } diff --git a/views/displaymessageview.c b/views/displaymessageview.c index f4cedc2..c1ffe47 100644 --- a/views/displaymessageview.c +++ b/views/displaymessageview.c @@ -41,6 +41,10 @@ void cDisplayMessageView::DrawMessage(eMessageType type, const char *text) { DrawViewElement(veMessage, &stringTokens, &intTokens); } +void cDisplayMessageView::ClearMessage(void) { + ClearViewElement(veMessage); +} + void cDisplayMessageView::Action(void) { SetInitFinished(); FadeIn(); diff --git a/views/displaymessageview.h b/views/displaymessageview.h index 1bcc908..2fc1428 100644 --- a/views/displaymessageview.h +++ b/views/displaymessageview.h @@ -13,6 +13,7 @@ public: bool createOsd(void); void DrawBackground(void); void DrawMessage(eMessageType type, const char *text); + void ClearMessage(void); void DoFadeIn(void) { Start(); }; void Flush(void) { DoFlush(); }; };