From dd1a19177332b6a2ab1cf3b3e95ee2f9aed5119e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 3 Jun 2019 23:33:29 +0200 Subject: [PATCH] mb.cpp: truncate title name in info menu Minimal view of title should be enough information in this menu and avoids possible issues after hide when user has changed movie data. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/631fb60af279f488d927e1fefe0cbd447d93d809 Author: Thilo Graf Date: 2019-06-03 (Mon, 03 Jun 2019) ------------------ This commit was generated by Migit --- src/gui/moviebrowser/mb.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 6d09495eb..8966d6ca2 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3670,6 +3670,9 @@ bool CMovieBrowser::showMenu(bool calledExternally) { if (!m_movieSelectionHandler->epgTitle.empty()) title = m_movieSelectionHandler->epgTitle; + const size_t max_size = 32; + if (title.size() > max_size) + title = title.substr (0, max_size) + " ..."; } mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), title, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL , this, "show_movie_cut_menu", CRCInput::RC_green));