summaryrefslogtreecommitdiff
path: root/client/resumewidget.cc
diff options
context:
space:
mode:
authordeva <deva>2008-12-03 13:01:08 +0000
committerdeva <deva>2008-12-03 13:01:08 +0000
commit816278b4cb0fe5040d890f2678908dcae0fed12c (patch)
tree2de524f37dcf292537387d3646200018457190be /client/resumewidget.cc
parentf8876e46818361e6adce312a24b0ca230fbbefe1 (diff)
Made some fixups on the way compressed resumes are shown.
Diffstat (limited to 'client/resumewidget.cc')
-rw-r--r--client/resumewidget.cc35
1 files changed, 33 insertions, 2 deletions
diff --git a/client/resumewidget.cc b/client/resumewidget.cc
index 6581797..563d2df 100644
--- a/client/resumewidget.cc
+++ b/client/resumewidget.cc
@@ -32,6 +32,7 @@
#define MAX_COMPACT_SIZE 100
//#define RICH // Experimental syntax highlighter (numbers turn blue)
+//#define FIXED_FONT // Show the resume, using a fixed font.
ResumeWidget::ResumeWidget(bool compact)
{
@@ -49,10 +50,40 @@ ResumeWidget::ResumeWidget(bool compact)
layout()->addWidget(resume);
}
+#define LINEWIDTH 80
+static QString reformatString(QString help)
+{
+ QString output;
+
+ int lastnl = 0;
+ for(int i = 0; i < help.size(); i++) {
+ if(help[i] == '\n') {
+ lastnl = 0;
+ } else {
+ if(lastnl > LINEWIDTH && help[i] == ' ') {
+ output += '\n';
+ lastnl = 0;
+ } else {
+ lastnl++;
+ }
+ }
+
+ output += help[i];
+
+ }
+ return output;
+}
+
void ResumeWidget::setText(QString text)
{
QString f;
+#ifdef FIXED_FONT
+ QFont font = resume->font();
+ font.setFamily("Courier New");
+ resume->setFont(font);
+#endif
+
#ifdef RICH
for(int i = 0; i < text.length(); i++) {
if(text[i] >= '0' && text[i] <= '9') f += "<font style='color: #55F;'>" + text[i] + "</font>";
@@ -76,8 +107,8 @@ void ResumeWidget::setText(QString text)
}
if(text != f) {
- f += " <font style='color: #0b0;'>...</font>";
- resume->setToolTip(origtext); // Only set tooltip if resume has actually been cut off.
+ f += " <img src=\"compressed.png\"/>";
+ resume->setToolTip(reformatString(origtext)); // Only set tooltip if resume has actually been cut off.
}
}