From c30c81a68219c33fade084300f77bc00c216f2cf Mon Sep 17 00:00:00 2001 From: louis Date: Sat, 9 Nov 2013 17:04:24 +0100 Subject: Cutting too long recording name in displayreplay --- HISTORY | 3 ++- displayreplay.c | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/HISTORY b/HISTORY index cf3bd44..5b550a7 100644 --- a/HISTORY +++ b/HISTORY @@ -361,4 +361,5 @@ Version 0.1.4 - size of channel logos in main menu timers display configurable as percent of timer width - Added theme dependend background for status icon in displayreplay -- Fixed editing of text if text is scrolling (closes Bug 1572) +- Fixed editing of text if text is scrolling (closes Bug 1572) +- Cutting too long recording name in displayreplay diff --git a/displayreplay.c b/displayreplay.c index c11c543..0f331bb 100644 --- a/displayreplay.c +++ b/displayreplay.c @@ -316,8 +316,13 @@ void cNopacityDisplayReplay::SetRecording(const cRecording *Recording) { void cNopacityDisplayReplay::SetTitle(const char *Title) { pixmapInfo->Fill(clrTransparent); + int titleLength = fontManager->replayHeader->Width(Title); + int titleSpace = geoManager->replayInfoWidth - geoManager->replayHeaderHeight/2; + std::string strTitle = Title; + if (titleLength > titleSpace) + strTitle = CutText(strTitle, titleSpace, fontManager->replayHeader); pixmapInfo->DrawText(cPoint(geoManager->replayHeaderHeight/2, 0), - Title, + strTitle.c_str(), Theme.Color(clrReplayHead), clrTransparent, fontManager->replayHeader); -- cgit v1.2.3