forked from github_mirror/framelesshelper
Simplify FramelessHelper code
Remove unused code. Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
ba4095251d
commit
684b05ccad
|
@ -27,65 +27,12 @@
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <QGuiApplication>
|
|
||||||
#include <QMargins>
|
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
#include <QScreen>
|
|
||||||
#include <QTouchEvent>
|
#include <QTouchEvent>
|
||||||
#include <QWindow>
|
#include <QWindow>
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
|
||||||
#include <qpa/qplatformnativeinterface.h>
|
|
||||||
#else
|
|
||||||
#include <qpa/qplatformwindow.h>
|
|
||||||
#include <qpa/qplatformwindow_p.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(QMargins)
|
|
||||||
|
|
||||||
FramelessHelper::FramelessHelper(QObject *parent) : QObject(parent) {}
|
FramelessHelper::FramelessHelper(QObject *parent) : QObject(parent) {}
|
||||||
|
|
||||||
void FramelessHelper::updateQtFrame(QWindow *window, const int titleBarHeight)
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
if (titleBarHeight >= 0) {
|
|
||||||
// Reduce top frame to zero since we paint it ourselves. Use
|
|
||||||
// device pixel to avoid rounding errors.
|
|
||||||
const QMargins margins = {0, -titleBarHeight, 0, 0};
|
|
||||||
const QVariant marginsVar = QVariant::fromValue(margins);
|
|
||||||
// The dynamic property takes effect when creating the platform
|
|
||||||
// window.
|
|
||||||
window->setProperty("_q_windowsCustomMargins", marginsVar);
|
|
||||||
// If a platform window exists, change via native interface.
|
|
||||||
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
|
|
||||||
QPlatformWindow *platformWindow = window->handle();
|
|
||||||
if (platformWindow) {
|
|
||||||
QGuiApplication::platformNativeInterface()
|
|
||||||
->setWindowProperty(platformWindow,
|
|
||||||
QString::fromUtf8("WindowsCustomMargins"),
|
|
||||||
marginsVar);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
auto *platformWindow = dynamic_cast<QNativeInterface::Private::QWindowsWindow *>(
|
|
||||||
window->handle());
|
|
||||||
if (platformWindow) {
|
|
||||||
platformWindow->setCustomMargins(margins);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FramelessHelper::moveWindowToDesktopCenter(QWindow *window)
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
const QSize ss = window->screen()->size();
|
|
||||||
const int sw = ss.width();
|
|
||||||
const int sh = ss.height();
|
|
||||||
const int ww = window->width();
|
|
||||||
const int wh = window->height();
|
|
||||||
window->setX(qRound(static_cast<qreal>(sw - ww) / 2.0));
|
|
||||||
window->setY(qRound(static_cast<qreal>(sh - wh) / 2.0));
|
|
||||||
}
|
|
||||||
|
|
||||||
int FramelessHelper::getBorderWidth() const
|
int FramelessHelper::getBorderWidth() const
|
||||||
{
|
{
|
||||||
return m_borderWidth;
|
return m_borderWidth;
|
||||||
|
@ -116,34 +63,6 @@ void FramelessHelper::setTitleBarHeight(const int val)
|
||||||
m_titleBarHeight = val;
|
m_titleBarHeight = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QRectF> FramelessHelper::getIgnoreAreas(const QWindow *window) const
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
return m_ignoreAreas.value(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FramelessHelper::addIgnoreArea(const QWindow *window, const QRectF &val)
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
QList<QRectF> areas = m_ignoreAreas[window];
|
|
||||||
areas.append(val);
|
|
||||||
m_ignoreAreas[window] = areas;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<QRectF> FramelessHelper::getDraggableAreas(const QWindow *window) const
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
return m_draggableAreas.value(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FramelessHelper::addDraggableArea(const QWindow *window, const QRectF &val)
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
QList<QRectF> areas = m_draggableAreas[window];
|
|
||||||
areas.append(val);
|
|
||||||
m_draggableAreas[window] = areas;
|
|
||||||
}
|
|
||||||
|
|
||||||
QObjectList FramelessHelper::getIgnoreObjects(const QWindow *window) const
|
QObjectList FramelessHelper::getIgnoreObjects(const QWindow *window) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(window);
|
Q_ASSERT(window);
|
||||||
|
@ -167,29 +86,6 @@ void FramelessHelper::addIgnoreObject(const QWindow *window, QObject *val)
|
||||||
m_ignoreObjects[window] = objs;
|
m_ignoreObjects[window] = objs;
|
||||||
}
|
}
|
||||||
|
|
||||||
QObjectList FramelessHelper::getDraggableObjects(const QWindow *window) const
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
QObjectList ret{};
|
|
||||||
const QObjectList objs = m_draggableObjects.value(window);
|
|
||||||
if (!objs.isEmpty()) {
|
|
||||||
for (auto &&_obj : qAsConst(objs)) {
|
|
||||||
if (_obj) {
|
|
||||||
ret.append(_obj);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FramelessHelper::addDraggableObject(const QWindow *window, QObject *val)
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
QObjectList objs = m_draggableObjects[window];
|
|
||||||
objs.append(val);
|
|
||||||
m_draggableObjects[window] = objs;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool FramelessHelper::getResizable(const QWindow *window) const
|
bool FramelessHelper::getResizable(const QWindow *window) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(window);
|
Q_ASSERT(window);
|
||||||
|
@ -202,28 +98,13 @@ void FramelessHelper::setResizable(const QWindow *window, const bool val)
|
||||||
m_fixedSize[window] = !val;
|
m_fixedSize[window] = !val;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FramelessHelper::getTitleBarEnabled(const QWindow *window) const
|
void FramelessHelper::removeWindowFrame(QWindow *window)
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
return !m_disableTitleBar.value(window);
|
|
||||||
}
|
|
||||||
|
|
||||||
void FramelessHelper::setTitleBarEnabled(const QWindow *window, const bool val)
|
|
||||||
{
|
|
||||||
Q_ASSERT(window);
|
|
||||||
m_disableTitleBar[window] = !val;
|
|
||||||
}
|
|
||||||
|
|
||||||
void FramelessHelper::removeWindowFrame(QWindow *window, const bool center)
|
|
||||||
{
|
{
|
||||||
Q_ASSERT(window);
|
Q_ASSERT(window);
|
||||||
window->setFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint
|
window->setFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowSystemMenuHint
|
||||||
| Qt::WindowMinMaxButtonsHint | Qt::WindowTitleHint);
|
| Qt::WindowMinMaxButtonsHint | Qt::WindowTitleHint);
|
||||||
// MouseTracking is always enabled for QWindow.
|
// MouseTracking is always enabled for QWindow.
|
||||||
window->installEventFilter(this);
|
window->installEventFilter(this);
|
||||||
if (center) {
|
|
||||||
moveWindowToDesktopCenter(window);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
|
@ -283,17 +164,6 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
}
|
}
|
||||||
return Qt::CursorShape::ArrowCursor;
|
return Qt::CursorShape::ArrowCursor;
|
||||||
};
|
};
|
||||||
const auto isInSpecificAreas = [](const QPointF &mousePos, const QList<QRectF> &areas) -> bool {
|
|
||||||
if (areas.isEmpty()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
for (auto &&area : qAsConst(areas)) {
|
|
||||||
if (area.contains(mousePos)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
const auto isInSpecificObjects = [](const QPointF &mousePos,
|
const auto isInSpecificObjects = [](const QPointF &mousePos,
|
||||||
const QObjectList &objects) -> bool {
|
const QObjectList &objects) -> bool {
|
||||||
if (objects.isEmpty()) {
|
if (objects.isEmpty()) {
|
||||||
|
@ -303,9 +173,7 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const bool isWidget = obj->inherits("QWidget");
|
if (!obj->isWidgetType() && !obj->inherits("QQuickItem")) {
|
||||||
const bool isQuickItem = obj->inherits("QQuickItem");
|
|
||||||
if (!isWidget && !isQuickItem) {
|
|
||||||
qWarning() << obj << "is not a QWidget or QQuickItem!";
|
qWarning() << obj << "is not a QWidget or QQuickItem!";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -326,55 +194,17 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
const auto isInIgnoreAreas = [this, &isInSpecificAreas](const QPointF &point,
|
const auto isInTitlebarArea = [this, &isInSpecificObjects](const QPointF &globalPoint,
|
||||||
const QWindow *window) -> bool {
|
const QPointF &point,
|
||||||
Q_ASSERT(window);
|
|
||||||
return isInSpecificAreas(point, getIgnoreAreas(window));
|
|
||||||
};
|
|
||||||
const auto isInIgnoreObjects = [this, &isInSpecificObjects](const QPointF &point,
|
|
||||||
const QWindow *window) -> bool {
|
|
||||||
Q_ASSERT(window);
|
|
||||||
return isInSpecificObjects(point, getIgnoreObjects(window));
|
|
||||||
};
|
|
||||||
const auto isInDraggableAreas = [this, &isInSpecificAreas](const QPointF &point,
|
|
||||||
const QWindow *window) -> bool {
|
const QWindow *window) -> bool {
|
||||||
Q_ASSERT(window);
|
Q_ASSERT(window);
|
||||||
const auto areas = getDraggableAreas(window);
|
return (point.y() <= m_titleBarHeight)
|
||||||
return (areas.isEmpty() ? true : isInSpecificAreas(point, areas));
|
&& !isInSpecificObjects(globalPoint, getIgnoreObjects(window));
|
||||||
};
|
|
||||||
const auto isInDraggableObjects = [this, &isInSpecificObjects](const QPointF &point,
|
|
||||||
const QWindow *window) -> bool {
|
|
||||||
Q_ASSERT(window);
|
|
||||||
const auto objs = getDraggableObjects(window);
|
|
||||||
return (objs.isEmpty() ? true : isInSpecificObjects(point, objs));
|
|
||||||
};
|
|
||||||
const auto isResizePermitted = [&isInIgnoreAreas,
|
|
||||||
&isInIgnoreObjects](const QPointF &globalPoint,
|
|
||||||
const QPointF &point,
|
|
||||||
const QWindow *window) -> bool {
|
|
||||||
Q_ASSERT(window);
|
|
||||||
return (!isInIgnoreAreas(point, window) && !isInIgnoreObjects(globalPoint, window));
|
|
||||||
};
|
|
||||||
const auto isInTitlebarArea = [this,
|
|
||||||
&isInDraggableAreas,
|
|
||||||
&isInDraggableObjects,
|
|
||||||
&isResizePermitted](const QPointF &globalPoint,
|
|
||||||
const QPointF &point,
|
|
||||||
const QWindow *window) -> bool {
|
|
||||||
Q_ASSERT(window);
|
|
||||||
const bool customDragAreas = !getDraggableAreas(window).isEmpty();
|
|
||||||
const bool customDragObjects = !getDraggableObjects(window).isEmpty();
|
|
||||||
const bool customDrag = customDragAreas || customDragObjects;
|
|
||||||
return ((customDrag ? (isInDraggableAreas(point, window)
|
|
||||||
&& isInDraggableObjects(globalPoint, window))
|
|
||||||
: (point.y() <= m_titleBarHeight))
|
|
||||||
&& isResizePermitted(globalPoint, point, window) && getTitleBarEnabled(window));
|
|
||||||
return false;
|
|
||||||
};
|
};
|
||||||
const auto moveOrResize =
|
const auto moveOrResize =
|
||||||
[this, &getWindowEdges, &isResizePermitted, &isInTitlebarArea](const QPointF &globalPoint,
|
[this, &getWindowEdges, &isInTitlebarArea, &isInSpecificObjects](const QPointF &globalPoint,
|
||||||
const QPointF &point,
|
const QPointF &point,
|
||||||
QWindow *window) {
|
QWindow *window) {
|
||||||
Q_ASSERT(window);
|
Q_ASSERT(window);
|
||||||
//const QPointF deltaPoint = globalPoint - m_pOldMousePos;
|
//const QPointF deltaPoint = globalPoint - m_pOldMousePos;
|
||||||
const Qt::Edges edges = getWindowEdges(point, window->width(), window->height());
|
const Qt::Edges edges = getWindowEdges(point, window->width(), window->height());
|
||||||
|
@ -382,17 +212,28 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
if (isInTitlebarArea(globalPoint, point, window)) {
|
if (isInTitlebarArea(globalPoint, point, window)) {
|
||||||
if (!window->startSystemMove()) {
|
if (!window->startSystemMove()) {
|
||||||
// ### FIXME: TO BE IMPLEMENTED!
|
// ### FIXME: TO BE IMPLEMENTED!
|
||||||
|
qWarning() << "Current OS doesn't support QWindow::startSystemMove().";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (window->windowStates().testFlag(Qt::WindowState::WindowNoState)
|
if (window->windowStates().testFlag(Qt::WindowState::WindowNoState)
|
||||||
&& isResizePermitted(globalPoint, point, window) && getResizable(window)) {
|
&& !isInSpecificObjects(globalPoint, getIgnoreObjects(window))
|
||||||
|
&& getResizable(window)) {
|
||||||
if (!window->startSystemResize(edges)) {
|
if (!window->startSystemResize(edges)) {
|
||||||
// ### FIXME: TO BE IMPLEMENTED!
|
// ### FIXME: TO BE IMPLEMENTED!
|
||||||
|
qWarning() << "Current OS doesn't support QWindow::startSystemResize().";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
const auto getMousePos = [](const QMouseEvent *e, const bool global) -> QPointF {
|
||||||
|
Q_ASSERT(e);
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
return global ? e->globalPosition() : e->scenePosition();
|
||||||
|
#else
|
||||||
|
return global ? e->screenPos() : e->windowPos();
|
||||||
|
#endif
|
||||||
|
};
|
||||||
switch (event->type()) {
|
switch (event->type()) {
|
||||||
case QEvent::MouseButtonDblClick: {
|
case QEvent::MouseButtonDblClick: {
|
||||||
const auto mouseEvent = static_cast<QMouseEvent *>(event);
|
const auto mouseEvent = static_cast<QMouseEvent *>(event);
|
||||||
|
@ -400,7 +241,9 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
if (mouseEvent->button() != Qt::MouseButton::LeftButton) {
|
if (mouseEvent->button() != Qt::MouseButton::LeftButton) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isInTitlebarArea(mouseEvent->screenPos(), mouseEvent->windowPos(), currentWindow)) {
|
if (isInTitlebarArea(getMousePos(mouseEvent, true),
|
||||||
|
getMousePos(mouseEvent, false),
|
||||||
|
currentWindow)) {
|
||||||
if (currentWindow->windowStates().testFlag(Qt::WindowState::WindowFullScreen)) {
|
if (currentWindow->windowStates().testFlag(Qt::WindowState::WindowFullScreen)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -420,8 +263,10 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
m_bIsMRBPressed = true;
|
m_bIsMRBPressed = true;
|
||||||
m_pOldMousePos = mouseEvent->screenPos();
|
m_pOldMousePos = getMousePos(mouseEvent, true);
|
||||||
moveOrResize(mouseEvent->screenPos(), mouseEvent->windowPos(), currentWindow);
|
moveOrResize(getMousePos(mouseEvent, true),
|
||||||
|
getMousePos(mouseEvent, false),
|
||||||
|
currentWindow);
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case QEvent::MouseMove: {
|
case QEvent::MouseMove: {
|
||||||
|
@ -429,9 +274,10 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
if (mouseEvent) {
|
if (mouseEvent) {
|
||||||
if (currentWindow->windowStates().testFlag(Qt::WindowState::WindowNoState)
|
if (currentWindow->windowStates().testFlag(Qt::WindowState::WindowNoState)
|
||||||
&& getResizable(currentWindow)) {
|
&& getResizable(currentWindow)) {
|
||||||
currentWindow->setCursor(getCursorShape(getWindowEdges(mouseEvent->windowPos(),
|
currentWindow->setCursor(
|
||||||
currentWindow->width(),
|
getCursorShape(getWindowEdges(getMousePos(mouseEvent, false),
|
||||||
currentWindow->height())));
|
currentWindow->width(),
|
||||||
|
currentWindow->height())));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
@ -447,8 +293,13 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event)
|
||||||
} break;
|
} break;
|
||||||
case QEvent::TouchBegin:
|
case QEvent::TouchBegin:
|
||||||
case QEvent::TouchUpdate: {
|
case QEvent::TouchUpdate: {
|
||||||
|
#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))
|
||||||
|
const auto point = static_cast<QTouchEvent *>(event)->points().first();
|
||||||
|
moveOrResize(point.globalPosition(), point.position(), currentWindow);
|
||||||
|
#else
|
||||||
const auto point = static_cast<QTouchEvent *>(event)->touchPoints().first();
|
const auto point = static_cast<QTouchEvent *>(event)->touchPoints().first();
|
||||||
moveOrResize(point.screenPos(), point.pos(), currentWindow);
|
moveOrResize(point.screenPos(), point.pos(), currentWindow);
|
||||||
|
#endif
|
||||||
} break;
|
} break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QRectF>
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
QT_FORWARD_DECLARE_CLASS(QWindow)
|
QT_FORWARD_DECLARE_CLASS(QWindow)
|
||||||
|
@ -44,10 +43,7 @@ public:
|
||||||
explicit FramelessHelper(QObject *parent = nullptr);
|
explicit FramelessHelper(QObject *parent = nullptr);
|
||||||
~FramelessHelper() override = default;
|
~FramelessHelper() override = default;
|
||||||
|
|
||||||
void removeWindowFrame(QWindow *window, const bool center = false);
|
void removeWindowFrame(QWindow *window);
|
||||||
|
|
||||||
static void updateQtFrame(QWindow *window, const int titleBarHeight);
|
|
||||||
static void moveWindowToDesktopCenter(QWindow *window);
|
|
||||||
|
|
||||||
int getBorderWidth() const;
|
int getBorderWidth() const;
|
||||||
void setBorderWidth(const int val);
|
void setBorderWidth(const int val);
|
||||||
|
@ -58,24 +54,12 @@ public:
|
||||||
int getTitleBarHeight() const;
|
int getTitleBarHeight() const;
|
||||||
void setTitleBarHeight(const int val);
|
void setTitleBarHeight(const int val);
|
||||||
|
|
||||||
void addIgnoreArea(const QWindow *window, const QRectF &val);
|
|
||||||
QList<QRectF> getIgnoreAreas(const QWindow *window) const;
|
|
||||||
|
|
||||||
void addDraggableArea(const QWindow *window, const QRectF &val);
|
|
||||||
QList<QRectF> getDraggableAreas(const QWindow *window) const;
|
|
||||||
|
|
||||||
void addIgnoreObject(const QWindow *window, QObject *val);
|
void addIgnoreObject(const QWindow *window, QObject *val);
|
||||||
QObjectList getIgnoreObjects(const QWindow *window) const;
|
QObjectList getIgnoreObjects(const QWindow *window) const;
|
||||||
|
|
||||||
void addDraggableObject(const QWindow *window, QObject *val);
|
|
||||||
QObjectList getDraggableObjects(const QWindow *window) const;
|
|
||||||
|
|
||||||
bool getResizable(const QWindow *window) const;
|
bool getResizable(const QWindow *window) const;
|
||||||
void setResizable(const QWindow *window, const bool val);
|
void setResizable(const QWindow *window, const bool val);
|
||||||
|
|
||||||
bool getTitleBarEnabled(const QWindow *window) const;
|
|
||||||
void setTitleBarEnabled(const QWindow *window, const bool val);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *object, QEvent *event) override;
|
bool eventFilter(QObject *object, QEvent *event) override;
|
||||||
|
|
||||||
|
@ -84,8 +68,7 @@ private:
|
||||||
// the scale factor is 1.0. Don't know how to acquire these values on UNIX
|
// the scale factor is 1.0. Don't know how to acquire these values on UNIX
|
||||||
// platforms through native API.
|
// platforms through native API.
|
||||||
int m_borderWidth = 8, m_borderHeight = 8, m_titleBarHeight = 30;
|
int m_borderWidth = 8, m_borderHeight = 8, m_titleBarHeight = 30;
|
||||||
QHash<const QWindow *, QList<QRectF>> m_ignoreAreas = {}, m_draggableAreas = {};
|
QHash<const QWindow *, QObjectList> m_ignoreObjects = {};
|
||||||
QHash<const QWindow *, QObjectList> m_ignoreObjects = {}, m_draggableObjects = {};
|
QHash<const QWindow *, bool> m_fixedSize = {};
|
||||||
QHash<const QWindow *, bool> m_fixedSize = {}, m_disableTitleBar = {};
|
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue