┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/kmetadatawidget.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-12-12 18:53:05 +0000
committerPeter Penz <[email protected]>2009-12-12 18:53:05 +0000
commitdf0b75e8c86178d11b656cc456b8a58354e22293 (patch)
treeda9da239a648c2d3156447d66ba179de587ed041 /src/panels/information/kmetadatawidget.cpp
parent9b0057b543f5442f8378b49425772dedf4fce8de (diff)
use the same link style as used for tags
svn path=/trunk/KDE/kdebase/apps/; revision=1061705
Diffstat (limited to 'src/panels/information/kmetadatawidget.cpp')
-rw-r--r--src/panels/information/kmetadatawidget.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/panels/information/kmetadatawidget.cpp b/src/panels/information/kmetadatawidget.cpp
index d1deea1e7..3a0151004 100644
--- a/src/panels/information/kmetadatawidget.cpp
+++ b/src/panels/information/kmetadatawidget.cpp
@@ -368,16 +368,31 @@ void KMetaDataWidget::Private::slotLoadingFinished()
const QList<KLoadMetaDataThread::Item> items = mergedItems(m_loadMetaDataThread->items());
foreach (const KLoadMetaDataThread::Item& item, items) {
+ const QString itemLabel = item.label;
+ QString itemValue = item.value;
+ if (item.value.startsWith("<a href=")) {
+ // use the text color for the value-links, to create a visual difference
+ // to the semantically different links like "Change..."
+ const QColor linkColor = q->palette().text().color();
+ QString decoration;
+ if (m_readOnly) {
+ decoration = QString::fromLatin1("text-decoration:none;");
+ }
+ const QString styleText = QString::fromLatin1("style=\"color:%1;%2\" ")
+ .arg(linkColor.name())
+ .arg(decoration);
+ itemValue.insert(3 /* after "<a "*/, styleText);
+ }
if (index < rowCount) {
// adjust texts of the current row
- m_rows[index].label->setText(item.label);
+ m_rows[index].label->setText(itemLabel);
QLabel* infoValueLabel = qobject_cast<QLabel*>(m_rows[index].infoWidget);
Q_ASSERT(infoValueLabel != 0);
- infoValueLabel->setText(item.value);
+ infoValueLabel->setText(itemValue);
} else {
// create new row
- QLabel* infoLabel = new QLabel(item.label, q);
- QLabel* infoValue = new QLabel(item.value, q);
+ QLabel* infoLabel = new QLabel(itemLabel, q);
+ QLabel* infoValue = new QLabel(itemValue, q);
connect(infoValue, SIGNAL(linkActivated(QString)),
q, SLOT(slotLinkActivated(QString)));
addRow(infoLabel, infoValue);