forked from github_mirror/framelesshelper
fix unwanted cursor change when leave edge region (#80)
This commit is contained in:
parent
523e35fdb1
commit
01dd43c356
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>518</width>
|
||||
<height>362</height>
|
||||
<height>368</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
@ -152,6 +152,13 @@
|
|||
</attribute>
|
||||
<widget class="QWidget" name="dockWidgetContents">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><a href="https://www.google.com">https://www.google.com</a></string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="text">
|
||||
|
|
|
@ -158,19 +158,27 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
|||
}
|
||||
} else if (type == QEvent::MouseMove) {
|
||||
// Display resize indicators
|
||||
static bool cursorChanged = false;
|
||||
if ((window->windowState() == Qt::WindowState::WindowNoState) && resizable) {
|
||||
if (((edges & Qt::TopEdge) && (edges & Qt::LeftEdge))
|
||||
|| ((edges & Qt::BottomEdge) && (edges & Qt::RightEdge))) {
|
||||
window->setCursor(Qt::SizeFDiagCursor);
|
||||
cursorChanged = true;
|
||||
} else if (((edges & Qt::TopEdge) && (edges & Qt::RightEdge))
|
||||
|| ((edges & Qt::BottomEdge) && (edges & Qt::LeftEdge))) {
|
||||
window->setCursor(Qt::SizeBDiagCursor);
|
||||
cursorChanged = true;
|
||||
} else if ((edges & Qt::TopEdge) || (edges & Qt::BottomEdge)) {
|
||||
window->setCursor(Qt::SizeVerCursor);
|
||||
cursorChanged = true;
|
||||
} else if ((edges & Qt::LeftEdge) || (edges & Qt::RightEdge)) {
|
||||
window->setCursor(Qt::SizeHorCursor);
|
||||
cursorChanged = true;
|
||||
} else {
|
||||
window->setCursor(Qt::ArrowCursor);
|
||||
if (cursorChanged) {
|
||||
window->setCursor(Qt::ArrowCursor);
|
||||
cursorChanged = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue