Minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
fe2d5716e2
commit
c29c4cc409
|
@ -38,8 +38,6 @@
|
||||||
Q_GLOBAL_STATIC(FramelessHelper, framelessHelperUnix)
|
Q_GLOBAL_STATIC(FramelessHelper, framelessHelperUnix)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(const QObject *)
|
|
||||||
|
|
||||||
void FramelessWindowsManager::addWindow(QWindow *window)
|
void FramelessWindowsManager::addWindow(QWindow *window)
|
||||||
{
|
{
|
||||||
Q_ASSERT(window);
|
Q_ASSERT(window);
|
||||||
|
@ -132,11 +130,11 @@ int FramelessWindowsManager::getTitleBarHeight(const QWindow *window)
|
||||||
{
|
{
|
||||||
Q_ASSERT(window);
|
Q_ASSERT(window);
|
||||||
if (!window) {
|
if (!window) {
|
||||||
return 30;
|
return 31;
|
||||||
}
|
}
|
||||||
#ifdef FRAMELESSHELPER_USE_UNIX_VERSION
|
#ifdef FRAMELESSHELPER_USE_UNIX_VERSION
|
||||||
const int value = window->property(_flh_global::_flh_titleBarHeight_flag).toInt();
|
const int value = window->property(_flh_global::_flh_titleBarHeight_flag).toInt();
|
||||||
return value <= 0 ? 30 : value;
|
return value <= 0 ? 31 : value;
|
||||||
#else
|
#else
|
||||||
return Utilities::getSystemMetric(window, Utilities::SystemMetric::TitleBarHeight, false);
|
return Utilities::getSystemMetric(window, Utilities::SystemMetric::TitleBarHeight, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -26,8 +26,7 @@
|
||||||
#include <QtCore/qdebug.h>
|
#include <QtCore/qdebug.h>
|
||||||
#include <QtCore/qvariant.h>
|
#include <QtCore/qvariant.h>
|
||||||
#include <QtGui/qguiapplication.h>
|
#include <QtGui/qguiapplication.h>
|
||||||
|
#include <QtGui/qscreen.h>
|
||||||
Q_DECLARE_METATYPE(const QObject *)
|
|
||||||
|
|
||||||
QWindow *Utilities::findWindow(const WId winId)
|
QWindow *Utilities::findWindow(const WId winId)
|
||||||
{
|
{
|
||||||
|
@ -73,9 +72,9 @@ bool Utilities::isWindowFixedSize(const QWindow *window)
|
||||||
QPointF Utilities::getGlobalMousePosition(const QWindow *window)
|
QPointF Utilities::getGlobalMousePosition(const QWindow *window)
|
||||||
{
|
{
|
||||||
if (window) {
|
if (window) {
|
||||||
return QPointF(QCursor::pos(window->screen()) * window->devicePixelRatio());
|
return QPointF(QCursor::pos(window->screen())) * window->devicePixelRatio();
|
||||||
} else {
|
} else {
|
||||||
return QPointF(QCursor::pos() * qGuiApp->devicePixelRatio());
|
return QPointF(QCursor::pos()) * QGuiApplication::primaryScreen()->devicePixelRatio();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue