Changeset View
Changeset View
Standalone View
Standalone View
src/kpixmapregionselectordialog.cpp
Show All 17 Lines | |||||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "kpixmapregionselectordialog.h" | 20 | #include "kpixmapregionselectordialog.h" | ||
21 | 21 | | |||
22 | #include <QDialogButtonBox> | 22 | #include <QDialogButtonBox> | ||
23 | #include <QDesktopWidget> | 23 | #include <QDesktopWidget> | ||
24 | #include <QImage> | 24 | #include <QImage> | ||
25 | #include <QLabel> | 25 | #include <QLabel> | ||
26 | #include <QScreen> | ||||
26 | #include <QVBoxLayout> | 27 | #include <QVBoxLayout> | ||
27 | 28 | | |||
28 | #include <kpixmapregionselectorwidget.h> | 29 | #include <kpixmapregionselectorwidget.h> | ||
29 | 30 | | |||
30 | class Q_DECL_HIDDEN KPixmapRegionSelectorDialog::Private | 31 | class Q_DECL_HIDDEN KPixmapRegionSelectorDialog::Private | ||
31 | { | 32 | { | ||
32 | public: | 33 | public: | ||
33 | Private(KPixmapRegionSelectorDialog *parent) | 34 | Private(KPixmapRegionSelectorDialog *parent) | ||
Show All 10 Lines | 43 | { | |||
44 | //KPixmapRegionSelectorWidget; in order to avoid the dialog to get out of the screen | 45 | //KPixmapRegionSelectorWidget; in order to avoid the dialog to get out of the screen | ||
45 | q->connect(pixmapSelectorWidget, SIGNAL(pixmapRotated()), q, SLOT(_k_adjustPixmapSize())); | 46 | q->connect(pixmapSelectorWidget, SIGNAL(pixmapRotated()), q, SLOT(_k_adjustPixmapSize())); | ||
46 | } | 47 | } | ||
47 | 48 | | |||
48 | void _k_adjustPixmapSize() | 49 | void _k_adjustPixmapSize() | ||
49 | { | 50 | { | ||
50 | if (pixmapSelectorWidget) { | 51 | if (pixmapSelectorWidget) { | ||
51 | //Set maximum size for picture | 52 | //Set maximum size for picture | ||
52 | QDesktopWidget desktopWidget; | 53 | const QRect screenGeometry = pixmapSelectorWidget->screen()->availableGeometry(); | ||
aacid: same, if you get bored, const | |||||
53 | QRect screen = desktopWidget.availableGeometry(); | | |||
54 | pixmapSelectorWidget->setMaximumWidgetSize( | 54 | pixmapSelectorWidget->setMaximumWidgetSize( | ||
55 | (int)(screen.width() * 4.0 / 5), (int)(screen.height() * 4.0 / 5)); | 55 | (int)(screenGeometry.width() * 4.0 / 5), (int)(screenGeometry.height() * 4.0 / 5)); | ||
56 | } | 56 | } | ||
57 | } | 57 | } | ||
58 | }; | 58 | }; | ||
59 | 59 | | |||
60 | KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog(QWidget *parent) | 60 | KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog(QWidget *parent) | ||
61 | : QDialog(parent), | 61 | : QDialog(parent), | ||
62 | d(new Private(this)) | 62 | d(new Private(this)) | ||
63 | { | 63 | { | ||
▲ Show 20 Lines • Show All 109 Lines • Show Last 20 Lines |
same, if you get bored, const