diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/resumewidget.cc | 35 |
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. } } |