~ubuntu-branches/ubuntu/quantal/gwenview/quantal-proposed

« back to all changes in this revision

Viewing changes to app/infocontextmanageritem.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac, Philip Muškovac, Scott Kitterman
  • Date: 2011-12-24 18:54:55 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20111224185455-zxffs6i6m5cwwuze
Tags: 4:4.7.95-0ubuntu1
[ Philip Muškovac ]
* New upstream release candiate

[ Scott Kitterman ]
* Fix Ubuntu Vcs- header in debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
#include <QVBoxLayout>
32
32
 
33
33
// KDE
34
 
#include <kfileitem.h>
35
 
#include <klocale.h>
36
 
#include <ksqueezedtextlabel.h>
 
34
#include <KFileItem>
 
35
#include <KLocale>
 
36
#include <KSqueezedTextLabel>
37
37
 
38
38
// Local
39
39
#include "contextmanager.h"
66
66
{
67
67
public:
68
68
    explicit FadingLabel(QWidget* parent = 0)
69
 
        : QLabel(parent) {
 
69
        : QLabel(parent)
 
70
        {
70
71
        setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
71
72
        setTextInteractionFlags(Qt::TextBrowserInteraction);
72
73
    }
73
74
 
74
 
    QSize minimumSizeHint() const {
 
75
    QSize minimumSizeHint() const
 
76
    {
75
77
        return QSize();
76
78
    }
77
79
 
116
118
        return QLabel::event(event);
117
119
    }
118
120
 
119
 
    inline bool isCropped() const {
 
121
    inline bool isCropped() const
 
122
 {
120
123
        return sizeHint().width() > width();
121
124
    }
122
125
};
126
129
 */
127
130
class KeyValueWidget : public QWidget
128
131
{
129
 
    struct Row {
 
132
    struct Row
 
133
    {
130
134
        Row()
131
 
            : keyLabel(new FadingLabel)
132
 
            , valueLabel(new FadingLabel) {
 
135
        : keyLabel(new FadingLabel)
 
136
        , valueLabel(new FadingLabel)
 
137
        {
133
138
            if (QApplication::isLeftToRight()) {
134
139
                keyLabel->setAlignment(Qt::AlignRight);
135
140
            } else {
137
142
            }
138
143
        }
139
144
 
140
 
        ~Row() {
 
145
        ~Row()
 
146
        {
141
147
            delete keyLabel;
142
148
            delete valueLabel;
143
149
        }
147
153
    };
148
154
public:
149
155
    KeyValueWidget(QWidget* parent)
150
 
        : QWidget(parent)
151
 
        , mLayout(new QGridLayout(this)) {
 
156
    : QWidget(parent)
 
157
    , mLayout(new QGridLayout(this))
 
158
    {
152
159
        mLayout->setMargin(0);
153
160
        mLayout->setVerticalSpacing(0);
154
161
        mLayout->setHorizontalSpacing(4);
155
162
        setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
156
163
    }
157
164
 
158
 
    QSize sizeHint() const {
 
165
    QSize sizeHint() const
 
166
    {
159
167
        int height = fontMetrics().height() * mRows.count();
160
168
        return QSize(150, height);
161
169
    }
211
219
    }
212
220
};
213
221
 
214
 
struct InfoContextManagerItemPrivate {
 
222
struct InfoContextManagerItemPrivate
 
223
{
215
224
    InfoContextManagerItem* q;
216
225
    SideBarGroup* mGroup;
217
226