summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordeva <deva>2010-02-26 07:34:44 +0000
committerdeva <deva>2010-02-26 07:34:44 +0000
commit3b6ec8ab7a007f65eb75ed377f4e4984257e5ba8 (patch)
treea5a04e5fdc4f3a5777be1934f6ccbaf2b927d8f0
parent01668a1b9433e22336ce925ff6e3510e2a8b4094 (diff)
Hack solution... but it does the job (Expands the resume widget on long wrapping lines).
-rw-r--r--client/resumewidget.cc21
1 files changed, 20 insertions, 1 deletions
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);
}