Changeset View
Changeset View
Standalone View
Standalone View
lib/fullscreenbar.cpp
Show All 23 Lines | |||||
24 | // Qt | 24 | // Qt | ||
25 | #include <QAction> | 25 | #include <QAction> | ||
26 | #include <QApplication> | 26 | #include <QApplication> | ||
27 | #include <QDesktopWidget> | 27 | #include <QDesktopWidget> | ||
28 | #include <QBitmap> | 28 | #include <QBitmap> | ||
29 | #include <QEvent> | 29 | #include <QEvent> | ||
30 | #include <QMouseEvent> | 30 | #include <QMouseEvent> | ||
31 | #include <QLayout> | 31 | #include <QLayout> | ||
32 | #include <QTimeLine> | 32 | #include <QTimeLine> | ||
ngraham: ditto | |||||
33 | #include <QTimer> | 33 | #include <QTimer> | ||
34 | #include <QToolButton> | 34 | #include <QToolButton> | ||
35 | 35 | | |||
36 | // KDE | 36 | // KDE | ||
37 | #include <KLocalizedString> | 37 | #include <KLocalizedString> | ||
38 | 38 | | |||
39 | // Local | 39 | // Local | ||
40 | 40 | | |||
Show All 35 Lines | 55 | { | |||
76 | } | 76 | } | ||
77 | 77 | | |||
78 | /** | 78 | /** | ||
79 | * Returns the rectangle in which the mouse must enter to trigger bar | 79 | * Returns the rectangle in which the mouse must enter to trigger bar | ||
80 | * sliding. The rectangle is in global coords. | 80 | * sliding. The rectangle is in global coords. | ||
81 | */ | 81 | */ | ||
82 | QRect slideInTriggerRect() const | 82 | QRect slideInTriggerRect() const | ||
83 | { | 83 | { | ||
84 | QRect rect = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(q->parentWidget())); | 84 | QRect rect = QApplication::desktop()->screenGeometry(QApplication::desktop()->screenNumber(q->parentWidget())); | ||
85 | // The previous string should be changed to | ||||
86 | // QRect rect = QGuiApplication::screenAt(QCursor::pos())->geometry(); | ||||
87 | // after switching to Qt > 5.9 | ||||
88 | | ||||
ngraham: ditto | |||||
yurchor: Same here. | |||||
85 | // Take parent widget position into account because it may not be at | 89 | // Take parent widget position into account because it may not be at | ||
86 | // the top of the screen, for example when the save bar warning is | 90 | // the top of the screen, for example when the save bar warning is | ||
87 | // shown. | 91 | // shown. | ||
88 | rect.setHeight(q->parentWidget()->y() + q->height() + EXTRA_BAR_HEIGHT); | 92 | rect.setHeight(q->parentWidget()->y() + q->height() + EXTRA_BAR_HEIGHT); | ||
89 | return rect; | 93 | return rect; | ||
90 | } | 94 | } | ||
91 | 95 | | |||
92 | bool shouldHide() const | 96 | bool shouldHide() const | ||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |
ditto