From 793230e9a7b521b07bc9ac55ce9dc4c951b16980 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 9 Jun 2014 14:35:39 +0200 Subject: [PATCH] CMenuWidget: add member to suppress paint of details line In some situations is it more senseful to suppress painting of details line. Required if menu window is painted over another window. The hide() functionality of detailsline paints only an empty background on screen so we have blank parts on screen. That looks bad. For example, this is to observe on context menu in channellist. We should see this as a workaround. It is not certain whether the details line is really needed in the future. --- src/gui/widget/menue.cpp | 5 ++++- src/gui/widget/menue.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d02ac880a..c0a1c6599 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -340,6 +340,7 @@ CMenuWidget::CMenuWidget() preselected = -1; details_line = NULL; info_box = NULL; + show_details_line = true; } CMenuWidget::CMenuWidget(const neutrino_locale_t Name, const std::string & Icon, const int mwidth, const mn_widget_id_t &w_index) @@ -364,6 +365,7 @@ void CMenuWidget::Init(const std::string & Icon, const int mwidth, const mn_widg frameBuffer = CFrameBuffer::getInstance(); iconfile = Icon; details_line = new CComponentsDetailLine(); + show_details_line = true; info_box = new CComponentsInfoBox(); //handle select values @@ -1184,7 +1186,8 @@ void CMenuWidget::paintHint(int pos) } //paint result - details_line->paint(savescreen); + if (show_details_line) + details_line->paint(savescreen); info_box->paint(savescreen); hint_painted = true; diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index ce311e3fc..e518034f8 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -630,7 +630,7 @@ class CMenuWidget : public CMenuTarget CComponentsDetailLine *details_line; CComponentsInfoBox *info_box; int hint_height; - + bool show_details_line; protected: std::string nameString; neutrino_locale_t name; @@ -725,6 +725,7 @@ class CMenuWidget : public CMenuTarget }; void addKey(neutrino_msg_t key, CMenuTarget *menue, const std::string &action); void setFooter(const struct button_label *_fbutton_label, const int _fbutton_count, bool repaint = false); + void suppressDetailsLine(bool suppress = true){show_details_line = !suppress ? false : true;}; }; class CPINProtection