~ubuntu-branches/ubuntu/trusty/gwenview/trusty

« back to all changes in this revision

Viewing changes to lib/crop/cropwidget.cpp

  • Committer: Package Import Robot
  • Author(s): Philip Muškovac
  • Date: 2011-12-24 18:54:55 UTC
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: package-import@ubuntu.com-20111224185455-peofsmb92w3o944b
Tags: upstream-4.7.95
Import upstream version 4.7.95

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include <QPushButton>
28
28
 
29
29
// KDE
30
 
#include <kdebug.h>
31
 
#include <kdialog.h>
32
 
#include <kglobalsettings.h>
33
 
#include <klineedit.h>
34
 
#include <klocale.h>
 
30
#include <KDebug>
 
31
#include <KDialog>
 
32
#include <KGlobalSettings>
 
33
#include <KLineEdit>
 
34
#include <KLocale>
35
35
 
36
36
// Local
37
37
#include <lib/documentview/rasterimageview.h>
59
59
    return QSize(width / divisor, height / divisor);
60
60
}
61
61
 
62
 
struct CropWidgetPrivate : public Ui_CropWidget {
 
62
struct CropWidgetPrivate : public Ui_CropWidget
 
63
{
63
64
    CropWidget* q;
64
65
 
65
66
    Document::Ptr mDocument;
66
67
    CropTool* mCropTool;
67
68
    bool mUpdatingFromCropTool;
68
69
 
69
 
    bool ratioIsConstrained() const {
 
70
    bool ratioIsConstrained() const
 
71
    {
70
72
        return cropRatio() > 0;
71
73
    }
72
74
 
73
 
    double cropRatio() const {
 
75
    double cropRatio() const
 
76
    {
74
77
        const QStringList lst = ratioComboBox->currentText().split(':');
75
78
        if (lst.size() != 2) {
76
79
            return 0;
111
114
                << QSize(4, 3)
112
115
                << QSize(5, 4)
113
116
                << QSize(6, 4)
114
 
                << QSize(7, 5)
115
 
                << QSize(10, 8);
 
117
                << QSize(7, 5);
116
118
 
117
119
        addRatioToComboBox(QSize(1, 1), i18n("Square"));
118
120
        addRatioToComboBox(screenRatio(), i18n("This Screen"));
137
139
        edit->setClickMessage(QString("%1:%2").arg(i18n("Width")).arg(i18n("Height")));
138
140
    }
139
141
 
140
 
    QRect cropRect() const {
 
142
    QRect cropRect() const
 
143
    {
141
144
        QRect rect(
142
145
            leftSpinBox->value(),
143
146
            topSpinBox->value(),