From a64fcbc3d0e1131026cf427691e2e734bbd803ed Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Sat, 12 Jan 2008 17:18:23 +0000 Subject: [PATCH] Fix #1453263 using Philipp Mueller's long text patch --- tbboxx.cc | 10 ++++++++-- tbboxx.h | 3 ++- vrecordinglist.cc | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tbboxx.cc b/tbboxx.cc index 4019b77..84f6af0 100644 --- a/tbboxx.cc +++ b/tbboxx.cc @@ -27,6 +27,7 @@ TBBoxx::TBBoxx() titleBarOn = 0; borderOn = 0; titleText = NULL; + titleBarTextWidth = 0; } TBBoxx::~TBBoxx() @@ -34,11 +35,12 @@ TBBoxx::~TBBoxx() if (titleText) delete[] titleText; } -void TBBoxx::setTitleText(const char* takeText) +void TBBoxx::setTitleText(const char* takeText, int width) { int length = strlen(takeText); titleText = new char[length + 1]; strcpy(titleText, takeText); + titleBarTextWidth = width; } void TBBoxx::draw() @@ -56,7 +58,11 @@ void TBBoxx::draw() if (titleBarOn) { rectangle(0, 0, area.w, 30, titleBarColour); - if (titleText) drawText(titleText, 5, 5, Colour::LIGHTTEXT); + if (titleText) + { + if (titleBarTextWidth) drawText(titleText, 5, 5, titleBarTextWidth, Colour::LIGHTTEXT); + else drawText(titleText, 5, 5, Colour::LIGHTTEXT); + } } Boxx::draw(); diff --git a/tbboxx.h b/tbboxx.h index b1290c3..39565ae 100644 --- a/tbboxx.h +++ b/tbboxx.h @@ -39,7 +39,7 @@ class TBBoxx : public Boxx void setBorderOn(UCHAR on); void setTitleBarOn(UCHAR on); - void setTitleText(const char* title); + void setTitleText(const char* title, int width=0); void setTitleBarColour(Colour& colour); char* getTitleText() { return titleText; }; @@ -47,6 +47,7 @@ class TBBoxx : public Boxx private: char* titleText; UCHAR borderOn; + int titleBarTextWidth; protected: Colour titleBarColour; diff --git a/vrecordinglist.cc b/vrecordinglist.cc index 4a2667a..4407ee6 100644 --- a/vrecordinglist.cc +++ b/vrecordinglist.cc @@ -134,7 +134,7 @@ void VRecordingList::draw(bool doIndexPop) { char title[300]; SNPRINTF(title, 299, tr("Recordings - %s"), recman->getCurDirName()); - setTitleText(title); + setTitleText(title, 364); } else { -- 2.39.5