summaryrefslogtreecommitdiff
path: root/client/resumewidget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/resumewidget.cc')
-rw-r--r--client/resumewidget.cc34
1 files changed, 29 insertions, 5 deletions
diff --git a/client/resumewidget.cc b/client/resumewidget.cc
index 563d2df..8e67b92 100644
--- a/client/resumewidget.cc
+++ b/client/resumewidget.cc
@@ -29,6 +29,9 @@
#include <QHBoxLayout>
#include <QBoxLayout>
+#include <QTextEdit>
+#include <QDialog>
+
#define MAX_COMPACT_SIZE 100
//#define RICH // Experimental syntax highlighter (numbers turn blue)
@@ -48,6 +51,8 @@ ResumeWidget::ResumeWidget(bool compact)
resume->setWordWrap(true);
layout()->addWidget(resume);
+
+ connect(resume, SIGNAL(linkActivated(const QString &)), this, SLOT(showFull(const QString &)));
}
#define LINEWIDTH 80
@@ -78,6 +83,8 @@ void ResumeWidget::setText(QString text)
{
QString f;
+ fulltext = text;
+
#ifdef FIXED_FONT
QFont font = resume->font();
font.setFamily("Courier New");
@@ -98,19 +105,36 @@ void ResumeWidget::setText(QString text)
#endif
if(compact) {
- QString origtext = f;
-
if(f.count('\n') > 0) f = f.left(f.indexOf('\n')); // Limit to one line.
if(f.length() > MAX_COMPACT_SIZE) {
f = f.left(MAX_COMPACT_SIZE); // limit to first MAX_COMPACT_SIZE characters.
}
- if(text != f) {
- f += " <img src=\"compressed.png\"/>";
- resume->setToolTip(reformatString(origtext)); // Only set tooltip if resume has actually been cut off.
+ if(fulltext != f) {
+ f += " <a href=\"#\"><img src=\":icons/compressed.png\"/></a>";
+ resume->setToolTip(reformatString(fulltext)); // Only set tooltip if resume has actually been cut off.
+ resume->setWhatsThis(fulltext); // Only set tooltip if resume has actually been cut off.
}
}
resume->setText(f);
}
+
+void ResumeWidget::showFull(const QString &)
+{
+ QDialog d(this);
+ d.setWindowTitle("Resume");
+
+ QTextEdit *t = new QTextEdit(&d);
+ d.resize(500, 200);
+ d.move(mapToGlobal(pos()));
+ t->setText(reformatString(fulltext));
+ t->setReadOnly(true);
+ t->setLineWrapMode(QTextEdit::NoWrap);
+
+ d.setLayout(new QHBoxLayout());
+ d.layout()->addWidget(t);
+
+ d.exec();
+}