forked from github_mirror/framelesshelper
Minor improvements.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
a4b50d3136
commit
8ec1cfcf35
|
@ -522,9 +522,17 @@ bool FramelessHelper::eventFilter(QObject *object, QEvent *event) {
|
||||||
&isResizePermitted](const QPointF &globalPoint, const QPointF &point,
|
&isResizePermitted](const QPointF &globalPoint, const QPointF &point,
|
||||||
QObject *const window) -> bool {
|
QObject *const window) -> bool {
|
||||||
if (window) {
|
if (window) {
|
||||||
return ((point.y() <= m_titleBarHeight) &&
|
const bool customDragAreas = !getDraggableAreas(window).isEmpty();
|
||||||
isInDraggableAreas(point, window) &&
|
#if defined(QT_WIDGETS_LIB) || defined(QT_QUICK_LIB)
|
||||||
isInDraggableObjects(globalPoint, window) &&
|
const bool customDragObjects =
|
||||||
|
!getDraggableObjects(window).isEmpty();
|
||||||
|
#else
|
||||||
|
const bool customDragObjects = false;
|
||||||
|
#endif
|
||||||
|
const bool customDrag = customDragAreas || customDragObjects;
|
||||||
|
return ((customDrag ? (isInDraggableAreas(point, window) &&
|
||||||
|
isInDraggableObjects(globalPoint, window))
|
||||||
|
: (point.y() <= m_titleBarHeight)) &&
|
||||||
isResizePermitted(globalPoint, point, window) &&
|
isResizePermitted(globalPoint, point, window) &&
|
||||||
getTitleBarEnabled(window));
|
getTitleBarEnabled(window));
|
||||||
}
|
}
|
||||||
|
|
|
@ -688,18 +688,14 @@ qreal GetPreferedNumber(const qreal num) {
|
||||||
} else {
|
} else {
|
||||||
if (in < (m_defaultDotsPerInch * 1.5)) {
|
if (in < (m_defaultDotsPerInch * 1.5)) {
|
||||||
return m_defaultDotsPerInch;
|
return m_defaultDotsPerInch;
|
||||||
} else if (in == (m_defaultDotsPerInch * 1.5)) {
|
|
||||||
return m_defaultDotsPerInch * 1.5;
|
|
||||||
} else if (in < (m_defaultDotsPerInch * 2.5)) {
|
} else if (in < (m_defaultDotsPerInch * 2.5)) {
|
||||||
return m_defaultDotsPerInch * 2;
|
return m_defaultDotsPerInch * 2;
|
||||||
} else if (in == (m_defaultDotsPerInch * 2.5)) {
|
|
||||||
return m_defaultDotsPerInch * 2.5;
|
|
||||||
} else if (in < (m_defaultDotsPerInch * 3.5)) {
|
} else if (in < (m_defaultDotsPerInch * 3.5)) {
|
||||||
return m_defaultDotsPerInch * 3;
|
return m_defaultDotsPerInch * 3;
|
||||||
} else if (in == (m_defaultDotsPerInch * 3.5)) {
|
|
||||||
return m_defaultDotsPerInch * 3.5;
|
|
||||||
} else if (in < (m_defaultDotsPerInch * 4.5)) {
|
} else if (in < (m_defaultDotsPerInch * 4.5)) {
|
||||||
return m_defaultDotsPerInch * 4;
|
return m_defaultDotsPerInch * 4;
|
||||||
|
} else if (in < (m_defaultDotsPerInch * 5.5)) {
|
||||||
|
return m_defaultDotsPerInch * 5;
|
||||||
} else {
|
} else {
|
||||||
qWarning().noquote()
|
qWarning().noquote()
|
||||||
<< "DPI too large:" << static_cast<int>(in);
|
<< "DPI too large:" << static_cast<int>(in);
|
||||||
|
|
Loading…
Reference in New Issue