From 3b6ec8ab7a007f65eb75ed377f4e4984257e5ba8 Mon Sep 17 00:00:00 2001 From: deva Date: Fri, 26 Feb 2010 07:34:44 +0000 Subject: Hack solution... but it does the job (Expands the resume widget on long wrapping lines). --- client/resumewidget.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'client') diff --git a/client/resumewidget.cc b/client/resumewidget.cc index 6877c54..ae6bec9 100644 --- a/client/resumewidget.cc +++ b/client/resumewidget.cc @@ -79,6 +79,24 @@ static QString reformatString(QString help) return output; } +#define LONGLINE 100 +static size_t countLongLines(QString str) +{ + str += "\n"; // Make sure we end at a newline. + size_t n = 0; + size_t len = 0; + for(size_t i = 0; i < (size_t)str.length(); i++) { + if(str[i] != '\n') { + len++; + } else { + n += len / LONGLINE; + len = 0; + } + } + + return n; +} + void ResumeWidget::setText(QString text) { QString f; @@ -117,7 +135,8 @@ void ResumeWidget::setText(QString text) //resume->setWhatsThis(fulltext); // Only set tooltip if resume has actually been cut off. } } - + size_t n = countLongLines(f); + for(size_t i = 0; i < n; i++) f.append('\n'); resume->setText(f); } -- cgit v1.2.3