Changeset View
Changeset View
Standalone View
Standalone View
lib/crop/cropwidget.cpp
Show All 23 Lines | |||||
24 | #include <QApplication> | 24 | #include <QApplication> | ||
25 | #include <QCheckBox> | 25 | #include <QCheckBox> | ||
26 | #include <QComboBox> | 26 | #include <QComboBox> | ||
27 | #include <QDesktopWidget> | 27 | #include <QDesktopWidget> | ||
28 | #include <QDialogButtonBox> | 28 | #include <QDialogButtonBox> | ||
29 | #include <QHBoxLayout> | 29 | #include <QHBoxLayout> | ||
30 | #include <QLabel> | 30 | #include <QLabel> | ||
31 | #include <QPushButton> | 31 | #include <QPushButton> | ||
32 | #include <QSpinBox> | 32 | #include <QSpinBox> | ||
ngraham: Now we don't need this include anymore | |||||
33 | #include <QtMath> | 33 | #include <QtMath> | ||
34 | #include <QDebug> | 34 | #include <QDebug> | ||
35 | #include <QLineEdit> | 35 | #include <QLineEdit> | ||
36 | 36 | | |||
37 | // KDE | 37 | // KDE | ||
38 | #include <KLocalizedString> | 38 | #include <KLocalizedString> | ||
39 | 39 | | |||
40 | // Local | 40 | // Local | ||
▲ Show 20 Lines • Show All 153 Lines • ▼ Show 20 Line(s) | 191 | ratioList | |||
194 | << QSizeF(3, 2) | 194 | << QSizeF(3, 2) | ||
195 | << QSizeF(4, 3) | 195 | << QSizeF(4, 3) | ||
196 | << QSizeF(5, 4); | 196 | << QSizeF(5, 4); | ||
197 | 197 | | |||
198 | addRatioToComboBox(ratio(mDocument->size()), i18n("Current Image")); | 198 | addRatioToComboBox(ratio(mDocument->size()), i18n("Current Image")); | ||
199 | mCurrentImageComboBoxIndex = ratioComboBox->count() - 1; // We need to refer to this ratio later | 199 | mCurrentImageComboBoxIndex = ratioComboBox->count() - 1; // We need to refer to this ratio later | ||
200 | 200 | | |||
201 | addRatioToComboBox(QSizeF(1, 1), i18n("Square")); | 201 | addRatioToComboBox(QSizeF(1, 1), i18n("Square")); | ||
202 | addRatioToComboBox(ratio(QApplication::desktop()->screenGeometry().size()), i18n("This Screen")); | 202 | addRatioToComboBox(ratio(QApplication::desktop()->screenGeometry().size()), i18n("This Screen")); | ||
203 | // The previous string should be changed to | ||||
204 | // addRatioToComboBox(ratio(QGuiApplication::screenAt(QCursor::pos())->geometry().size()), i18n("This Screen")); | ||||
205 | // after switching to Qt > 5.9 | ||||
Might be better to use QGuiApplication::screenAt() and get the screen where the window is open, rather than assuming it's open on the primary screen (also, the concept of the primary screen does not exist on Wayland; not sure what QGuiApplication::primaryScreen() will return there) ngraham: Might be better to use `QGuiApplication::screenAt()` and get the screen where the window is… | |||||
This will introduce the dependency on Qt 5.10: https://doc.qt.io/qt-5/qguiapplication.html#screenAt How should I proceed? yurchor: This will introduce the dependency on Qt 5.10:
https://doc.qt.io/qt-5/qguiapplication. | |||||
203 | addSectionHeaderToComboBox(i18n("Landscape")); | 206 | addSectionHeaderToComboBox(i18n("Landscape")); | ||
204 | 207 | | |||
205 | Q_FOREACH(const QSizeF& size, ratioList) { | 208 | Q_FOREACH(const QSizeF& size, ratioList) { | ||
206 | addRatioToComboBox(size); | 209 | addRatioToComboBox(size); | ||
207 | } | 210 | } | ||
208 | addRatioToComboBox(QSizeF(sqrt2, 1), i18n("ISO (A4, A3...)")); | 211 | addRatioToComboBox(QSizeF(sqrt2, 1), i18n("ISO (A4, A3...)")); | ||
209 | addRatioToComboBox(QSizeF(11, 8.5), i18n("US Letter")); | 212 | addRatioToComboBox(QSizeF(11, 8.5), i18n("US Letter")); | ||
210 | addSectionHeaderToComboBox(i18n("Portrait")); | 213 | addSectionHeaderToComboBox(i18n("Portrait")); | ||
▲ Show 20 Lines • Show All 362 Lines • Show Last 20 Lines |
Now we don't need this include anymore