From 139a93156b9542c77fbad5afe423de4ccedbb754 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Fri, 23 Jun 2017 16:03:51 +0200 Subject: [PATCH] Fixed drawing very long menu titles in the LCARS skin --- CONTRIBUTORS | 1 + HISTORY | 1 + skinlcars.c | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 75696641..d6f2eff3 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -3274,6 +3274,7 @@ Matthias Senzel for reporting a bug in switching channels in the Schedule menu after going through various Now and Schedule menus for different channels for the "jumpingseconds" patch + for reporting a bug in drawing very long menu titles in the LCARS skin Marek Nazarko for translating OSD texts to the Polish language diff --git a/HISTORY b/HISTORY index d5c25527..941df537 100644 --- a/HISTORY +++ b/HISTORY @@ -9142,3 +9142,4 @@ Video Disk Recorder Revision History - Updated the Italian OSD texts (thanks to Diego Pierotto). - Now skipping a leading '/' in AddDirectory(), to avoid double slashes (reported by Chris Mayo). +- Fixed drawing very long menu titles in the LCARS skin (reported by Matthias Senzel). diff --git a/skinlcars.c b/skinlcars.c index c4278d27..a7c28f10 100644 --- a/skinlcars.c +++ b/skinlcars.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: skinlcars.c 4.4 2017/04/20 08:46:42 kls Exp $ + * $Id: skinlcars.c 4.5 2017/06/23 15:52:03 kls Exp $ */ // "Star Trek: The Next Generation"(R) is a registered trademark of Paramount Pictures, @@ -1551,7 +1551,7 @@ void cSkinLCARSDisplayMenu::SetTitle(const char *Title) { if (MenuCategory() != mcMain) { const cFont *font = cFont::GetFont(fontOsd); - int w = font->Width(Title); + int w = min(font->Width(Title), xa07 - xa06 - Gap); osd->DrawRectangle(xa06, yt00, xa07 - w - Gap - 1, yt01 - 1, frameColor); osd->DrawText(xa07 - w - Gap, yt00, Title, Theme.Color(clrMenuTitle), Theme.Color(clrBackground), font, w + Gap, yt01 - yt00, taRight); }