mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-06 15:13:57 +02:00
Use startSystemMove in export window
This commit is contained in:
parent
bb8f9a1b7f
commit
73b0153a66
2 changed files with 11 additions and 0 deletions
|
@ -25,6 +25,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "styles/style_info.h"
|
#include "styles/style_info.h"
|
||||||
#include "styles/style_calls.h"
|
#include "styles/style_calls.h"
|
||||||
|
|
||||||
|
#include <QtGui/QWindow>
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
#include <QtWidgets/QDesktopWidget>
|
#include <QtWidgets/QDesktopWidget>
|
||||||
|
|
||||||
|
@ -553,9 +554,13 @@ void SeparatePanel::mousePressEvent(QMouseEvent *e) {
|
||||||
st::separatePanelTitleHeight);
|
st::separatePanelTitleHeight);
|
||||||
if (e->button() == Qt::LeftButton) {
|
if (e->button() == Qt::LeftButton) {
|
||||||
if (dragArea.contains(e->pos())) {
|
if (dragArea.contains(e->pos())) {
|
||||||
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 15, 0) || defined DESKTOP_APP_QT_PATCHED
|
||||||
|
windowHandle()->startSystemMove();
|
||||||
|
#else // Qt >= 5.15 || DESKTOP_APP_QT_PATCHED
|
||||||
_dragging = true;
|
_dragging = true;
|
||||||
_dragStartMousePosition = e->globalPos();
|
_dragStartMousePosition = e->globalPos();
|
||||||
_dragStartMyPosition = QPoint(x(), y());
|
_dragStartMyPosition = QPoint(x(), y());
|
||||||
|
#endif // Qt < 5.15 && !DESKTOP_APP_QT_PATCHED
|
||||||
} else if (!rect().contains(e->pos()) && _hideOnDeactivate) {
|
} else if (!rect().contains(e->pos()) && _hideOnDeactivate) {
|
||||||
LOG(("Export Info: Panel Hide On Click."));
|
LOG(("Export Info: Panel Hide On Click."));
|
||||||
hideGetDuration();
|
hideGetDuration();
|
||||||
|
@ -564,6 +569,7 @@ void SeparatePanel::mousePressEvent(QMouseEvent *e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SeparatePanel::mouseMoveEvent(QMouseEvent *e) {
|
void SeparatePanel::mouseMoveEvent(QMouseEvent *e) {
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) && !defined DESKTOP_APP_QT_PATCHED
|
||||||
if (_dragging) {
|
if (_dragging) {
|
||||||
if (!(e->buttons() & Qt::LeftButton)) {
|
if (!(e->buttons() & Qt::LeftButton)) {
|
||||||
_dragging = false;
|
_dragging = false;
|
||||||
|
@ -572,12 +578,15 @@ void SeparatePanel::mouseMoveEvent(QMouseEvent *e) {
|
||||||
+ (e->globalPos() - _dragStartMousePosition));
|
+ (e->globalPos() - _dragStartMousePosition));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif // Qt < 5.15 && !DESKTOP_APP_QT_PATCHED
|
||||||
}
|
}
|
||||||
|
|
||||||
void SeparatePanel::mouseReleaseEvent(QMouseEvent *e) {
|
void SeparatePanel::mouseReleaseEvent(QMouseEvent *e) {
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) && !defined DESKTOP_APP_QT_PATCHED
|
||||||
if (e->button() == Qt::LeftButton) {
|
if (e->button() == Qt::LeftButton) {
|
||||||
_dragging = false;
|
_dragging = false;
|
||||||
}
|
}
|
||||||
|
#endif // Qt < 5.15 && !DESKTOP_APP_QT_PATCHED
|
||||||
}
|
}
|
||||||
|
|
||||||
void SeparatePanel::leaveEventHook(QEvent *e) {
|
void SeparatePanel::leaveEventHook(QEvent *e) {
|
||||||
|
|
|
@ -93,9 +93,11 @@ private:
|
||||||
bool _useTransparency = true;
|
bool _useTransparency = true;
|
||||||
style::margins _padding;
|
style::margins _padding;
|
||||||
|
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0) && !defined DESKTOP_APP_QT_PATCHED
|
||||||
bool _dragging = false;
|
bool _dragging = false;
|
||||||
QPoint _dragStartMousePosition;
|
QPoint _dragStartMousePosition;
|
||||||
QPoint _dragStartMyPosition;
|
QPoint _dragStartMyPosition;
|
||||||
|
#endif // Qt < 5.15 && !DESKTOP_APP_QT_PATCHED
|
||||||
|
|
||||||
Ui::Animations::Simple _titleLeft;
|
Ui::Animations::Simple _titleLeft;
|
||||||
bool _visible = false;
|
bool _visible = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue