forked from github_mirror/framelesshelper
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)
|
||||
#endif
|
||||
|
||||
Q_DECLARE_METATYPE(const QObject *)
|
||||
|
||||
void FramelessWindowsManager::addWindow(QWindow *window)
|
||||
{
|
||||
Q_ASSERT(window);
|
||||
|
@ -132,11 +130,11 @@ int FramelessWindowsManager::getTitleBarHeight(const QWindow *window)
|
|||
{
|
||||
Q_ASSERT(window);
|
||||
if (!window) {
|
||||
return 30;
|
||||
return 31;
|
||||
}
|
||||
#ifdef FRAMELESSHELPER_USE_UNIX_VERSION
|
||||
const int value = window->property(_flh_global::_flh_titleBarHeight_flag).toInt();
|
||||
return value <= 0 ? 30 : value;
|
||||
return value <= 0 ? 31 : value;
|
||||
#else
|
||||
return Utilities::getSystemMetric(window, Utilities::SystemMetric::TitleBarHeight, false);
|
||||
#endif
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
#include <QtCore/qdebug.h>
|
||||
#include <QtCore/qvariant.h>
|
||||
#include <QtGui/qguiapplication.h>
|
||||
|
||||
Q_DECLARE_METATYPE(const QObject *)
|
||||
#include <QtGui/qscreen.h>
|
||||
|
||||
QWindow *Utilities::findWindow(const WId winId)
|
||||
{
|
||||
|
@ -73,9 +72,9 @@ bool Utilities::isWindowFixedSize(const QWindow *window)
|
|||
QPointF Utilities::getGlobalMousePosition(const QWindow *window)
|
||||
{
|
||||
if (window) {
|
||||
return QPointF(QCursor::pos(window->screen()) * window->devicePixelRatio());
|
||||
return QPointF(QCursor::pos(window->screen())) * window->devicePixelRatio();
|
||||
} else {
|
||||
return QPointF(QCursor::pos() * qGuiApp->devicePixelRatio());
|
||||
return QPointF(QCursor::pos()) * QGuiApplication::primaryScreen()->devicePixelRatio();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue