Changeset View
Changeset View
Standalone View
Standalone View
src/ktipdialog.cpp
Show All 28 Lines | |||||
29 | 29 | | |||
30 | #include <QApplication> | 30 | #include <QApplication> | ||
31 | #include <QFile> | 31 | #include <QFile> | ||
32 | #include <QCheckBox> | 32 | #include <QCheckBox> | ||
33 | #include <QKeyEvent> | 33 | #include <QKeyEvent> | ||
34 | #include <QLabel> | 34 | #include <QLabel> | ||
35 | #include <QDesktopWidget> | 35 | #include <QDesktopWidget> | ||
36 | #include <QPushButton> | 36 | #include <QPushButton> | ||
37 | #include <QScreen> | ||||
37 | #include <QTextBrowser> | 38 | #include <QTextBrowser> | ||
38 | #include <QHBoxLayout> | 39 | #include <QHBoxLayout> | ||
39 | #include <QVBoxLayout> | 40 | #include <QVBoxLayout> | ||
40 | 41 | | |||
41 | #include <kconfig.h> | 42 | #include <kconfig.h> | ||
42 | #include <kconfiggroup.h> | 43 | #include <kconfiggroup.h> | ||
43 | #include <klocalizedstring.h> | 44 | #include <klocalizedstring.h> | ||
44 | #include <ksharedconfig.h> | 45 | #include <ksharedconfig.h> | ||
▲ Show 20 Lines • Show All 241 Lines • ▼ Show 20 Line(s) | 239 | { | |||
286 | label->setPixmap(QStringLiteral(":/kconfigwidgets/pics/ktip-bulb.png")); | 287 | label->setPixmap(QStringLiteral(":/kconfigwidgets/pics/ktip-bulb.png")); | ||
287 | label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); | 288 | label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); | ||
288 | browserLayout->addWidget(label); | 289 | browserLayout->addWidget(label); | ||
289 | 290 | | |||
290 | if (!isTipDialog) { | 291 | if (!isTipDialog) { | ||
291 | resize(520, 280); | 292 | resize(520, 280); | ||
292 | QSize sh = size(); | 293 | QSize sh = size(); | ||
293 | 294 | | |||
294 | QRect rect = QApplication::desktop()->screenGeometry(QCursor::pos()); | 295 | QScreen *screen = QGuiApplication::screenAt(QCursor::pos()); | ||
295 | 296 | if (screen) { | |||
297 | const QRect rect = screen->geometry(); | ||||
296 | move(rect.x() + (rect.width() - sh.width()) / 2, | 298 | move(rect.x() + (rect.width() - sh.width()) / 2, | ||
297 | rect.y() + (rect.height() - sh.height()) / 2); | 299 | rect.y() + (rect.height() - sh.height()) / 2); | ||
298 | } | 300 | } | ||
301 | } | ||||
299 | 302 | | |||
300 | KSeparator *sep = new KSeparator(Qt::Horizontal); | 303 | KSeparator *sep = new KSeparator(Qt::Horizontal); | ||
301 | mainLayout->addWidget(sep); | 304 | mainLayout->addWidget(sep); | ||
302 | 305 | | |||
303 | QHBoxLayout *buttonLayout = new QHBoxLayout(); | 306 | QHBoxLayout *buttonLayout = new QHBoxLayout(); | ||
304 | 307 | | |||
305 | mainLayout->addLayout(buttonLayout); | 308 | mainLayout->addLayout(buttonLayout); | ||
306 | 309 | | |||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |