~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/widgets/common/dfontselect.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
};
66
66
 
67
67
DFontSelect::DFontSelect(const QString& text=QString(), QWidget* parent=0)
68
 
           : KHBox(parent), d(new DFontSelectPriv)
 
68
    : KHBox(parent), d(new DFontSelectPriv)
69
69
{
70
70
    d->label     = new QLabel(this);
71
71
    d->label->setText(text);
72
72
    d->space     = new QLabel(this);
 
73
 
73
74
    if (text.isEmpty())
74
75
    {
75
76
        d->label->hide();
121
122
void DFontSelect::setFont(const QFont& font)
122
123
{
123
124
    d->font = font;
 
125
 
124
126
    if (d->font == KGlobalSettings::generalFont())
 
127
    {
125
128
        setMode(SystemFont);
 
129
    }
126
130
    else
 
131
    {
127
132
        setMode(CustomFont);
 
133
    }
128
134
}
129
135
 
130
136
bool DFontSelect::event(QEvent* e)
133
139
    {
134
140
        d->modeCombo->setFont(font());
135
141
    }
 
142
 
136
143
    return KHBox::event(e);
137
144
}
138
145
 
140
147
{
141
148
    QFont f = font();
142
149
    const int result = KFontDialog::getFont(f, KFontChooser::NoDisplayFlags, this);
 
150
 
143
151
    if (result == KFontDialog::Accepted)
144
152
    {
145
153
        d->font = f;