~ubuntu-branches/ubuntu/intrepid/digikam/intrepid

« back to all changes in this revision

Viewing changes to digikam/libs/widgets/metadata/mdkeylistviewitem.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Mark Purcell
  • Date: 2008-07-17 20:25:39 UTC
  • mfrom: (1.3.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 39.
  • Revision ID: james.westby@ubuntu.com-20080717202539-ttj4and3ds1ldgn1
Tags: upstream-0.9.4
ImportĀ upstreamĀ versionĀ 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 * Description : a generic list view item widget to 
8
8
 *               display metadata key like a title
9
9
 * 
10
 
 * Copyright (C) 2006-2007 by Gilles Caulier <caulier dot gilles at gmail dot com>
 
10
 * Copyright (C) 2006-2008 by Gilles Caulier <caulier dot gilles at gmail dot com>
11
11
 *
12
12
 * This program is free software; you can redistribute it
13
13
 * and/or modify it under the terms of the GNU General
34
34
 
35
35
// Local includes.
36
36
 
 
37
#include "themeengine.h"
37
38
#include "ddebug.h"
38
39
#include "mdkeylistviewitem.h"
39
40
 
40
41
namespace Digikam
41
42
{
42
43
 
43
 
MdKeyListViewItem::MdKeyListViewItem(KListView *parent, const QString& key)
44
 
                 : KListViewItem(parent)
 
44
MdKeyListViewItem::MdKeyListViewItem(QListView *parent, const QString& key)
 
45
                 : QListViewItem(parent)
45
46
{
46
47
    m_decryptedKey = key;
47
 
    
 
48
 
48
49
    // Standard Exif key descriptions.
49
50
    if      (key == "Iop")       m_decryptedKey = i18n("Interoperability");
50
51
    else if (key == "Image")     m_decryptedKey = i18n("Image Information");
51
52
    else if (key == "Photo")     m_decryptedKey = i18n("Photograph Information");
52
53
    else if (key == "GPSInfo")   m_decryptedKey = i18n("Global Positioning System");
53
54
    else if (key == "Thumbnail") m_decryptedKey = i18n("Embedded Thumbnail");
54
 
    
 
55
 
55
56
    // Standard IPTC key descriptions.
56
57
    else if (key == "Envelope")     m_decryptedKey = i18n("IIM Envelope");
57
58
    else if (key == "Application2") m_decryptedKey = i18n("IIM Application 2");
63
64
 
64
65
MdKeyListViewItem::~MdKeyListViewItem()
65
66
{
66
 
 
67
}
67
68
 
68
69
QString MdKeyListViewItem::getMdKey()
69
70
{
78
79
    fn.setBold(true);
79
80
    fn.setItalic(false);
80
81
    p->setFont(fn);
81
 
    p->setPen( Qt::white );
 
82
    p->setPen(ThemeEngine::instance()->textSelColor());
82
83
    int width = listView()->contentsWidth();
83
84
    QRect rect(0, 0, width, fn.weight());
84
85
 
85
86
    if (column == 1)
86
87
        rect.moveLeft(-width/2);
87
88
 
88
 
    p->fillRect( rect, Qt::gray );
89
 
    p->drawText( rect, Qt::AlignHCenter, m_decryptedKey);
 
89
    p->fillRect(rect, ThemeEngine::instance()->thumbSelColor());
 
90
    p->drawText(rect, Qt::AlignHCenter, m_decryptedKey);
90
91
    p->restore();
91
92
}
92
93
 
93
94
}  // namespace Digikam
94